[FEATURE] Cloud sessions: upload screenshots to GitHub issues and PRs (`gh --attach` / user-attachments)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
In a Claude Code cloud session, Claude cannot put images into a GitHub issue, PR or comment body.
Since GitHub CLI 2.99.0 (2026-09-01) there is an official way to do it. The repeatable --attach flag on gh issue create|edit|comment and gh pr create|edit|comment uploads a local image to https://github.com/user-attachments/assets/... and rewrites the body to point at it. That is the same storage the web editor's drag and drop uses, so nothing is committed to the repository.
In a cloud session the session's GitHub gateway refuses this in two places:
gh issue edit 62 -R owner/repo --body-file body.md --attach ./shots/C-before.pngfails with:
```
HTTP 403: GitHub GraphQL is not available from Claude Code sessions; use the REST API (gh api repos/{owner}/{repo}/...)
viewerPermission` through GraphQL.
gh looks up the issue and the repository's
- The upload itself, sent over REST the way gh sends it, is refused too. The request is
POST https://uploads.github.com/user-attachments/assets?name=C-before.png&content_type=image/png&repository_id=<id>withContent-Type: application/octet-streamand the file's bytes. It fails with:
````
HTTP 415 {"message":"Request bodies must declare Content-Type: application/json. Resend the JSON body with that header."}
The credential is not the problem. Through the same gateway, gh api repos/owner/repo returns "push": true.
The GitHub MCP server has no upload tool either. The container's preinstalled gh is 2.89.0, which has no --attach; I downloaded 2.99.0 into the session for this test.
So work that is about images ends up as text only. My case was a bug hunt where every bug was confirmed with a before/after screenshot, and the issue and PR got the descriptions while the screenshots stayed in the chat.
Proposed Solution
Let a cloud session attach images to issue, PR and comment bodies of repositories it has push access to. Any of these would do:
- Allow
POST https://uploads.github.com/user-attachments/assetswith a binary body for image and video content types, within GitHub's own size limits. Also allow the few GraphQL readsgh --attachneeds (issue/PR lookup andviewerPermission), or expose them as REST routes like the existing CCR routes for review threads and auto-merge. - Or add an upload tool to the GitHub MCP server, for example
upload_attachment(owner, repo, path). It would read a file from the session container and return theuser-attachmentsURL to put in a body.
Also update the preinstalled gh to 2.99.0 or newer, so --attach exists out of the box.
Alternative Solutions
- Commit screenshots to the repository, or to an orphan branch, and link raw URLs. This pollutes the repository, and many owners don't allow it (mine didn't).
- External image hosts (imgur, img402, uploads.sh). These are public third-party hosting with links that can expire, and they need extra egress.
- Google Drive connector. The image has to be passed as base64 inside the tool call, which is millions of tokens for a set of screenshots. The file must also be shared publicly, and Drive embeds through GitHub's image proxy are unreliable.
- Current workaround. Claude builds a zip with the finished bodies, the images and an
upload.shthat runsgh issue edit ... --attach ...on my own Mac. It works, but I have to download, unzip, upgrade gh and run it locally, which defeats the point of a cloud session.
Priority
Medium - Would be very helpful
Feature Category
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
- In a cloud session I ask Claude to find UI bugs in a CLI/TUI project and to confirm each one with a screenshot.
- Claude reproduces 30 bugs, renders before/after PNGs in the container, fixes them and opens a PR.
- I ask it to file an issue that describes the bugs with screenshots, and to put the before/after screenshots into the PR body.
- Today the issue and PR get the text and hidden placeholders only, and I have to run a script on my machine to fill in the images.
- With this feature, Claude runs
gh pr edit 61 --body-file pr.md --attach ./shots/A-after.png ...itself, and the images are in place when I open the PR.
Additional Context
--attachshipped in GitHub CLI v2.99.0: https://github.com/cli/cli/releases/tag/v2.99.0- The upload code is in
internal/attachments/client.go. It sendsPOST uploads.github.com/user-attachments/assetsand requires an OAuth or PAT credential plus write permission on the repository. - Related: #26831 asks for screenshots in PR comments and was closed as stale before
--attachexisted. #101156 is about GraphQL being blocked in cloud sessions, for Projects v2.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗