claude-code - 💡(How to fix) Fix [FEATURE] Resolve GitHub issue/PR image attachments into Claude Code's context (web/cloud)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

When Claude Code runs in the web/cloud environment on a GitHub-triggered task, it cannot see screenshots attached to the issue/PR it's working on. Many bug reports show the problem in an image rather than describing it in text, so the agent is missing part of its own task input. The session is given a shell plus an API-scoped GitHub token, and that token cannot fetch issue attachments: requesting github.com/user-attachments/assets/<uuid> returns HTTP 404 with set-cookie: logged_in=no, because that endpoint is the github.com web app and requires a web session cookie — the Authorization: header is ignored. Issue/PR text via api.github.com works fine (HTTP 200); only attachments fail. A broader-scoped PAT and installing gh fail identically. Codex handles this because its platform resolves the attachment server-side and inlines the image into the model's context.

Fix Action

Fix / Workaround

  • Passing a user PAT or a broader-scoped PAT: fails — the user-attachments endpoint ignores Authorization: entirely.
  • Installing the gh CLI in the startup script: fails — gh uses the same token auth and carries no web session cookie.
  • Current workaround: the user manually pastes the screenshot into chat, which defeats the point of an autonomous GitHub-triggered workflow.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

When Claude Code runs in the web/cloud environment on a GitHub-triggered task, it cannot see screenshots attached to the issue/PR it's working on. Many bug reports show the problem in an image rather than describing it in text, so the agent is missing part of its own task input. The session is given a shell plus an API-scoped GitHub token, and that token cannot fetch issue attachments: requesting github.com/user-attachments/assets/<uuid> returns HTTP 404 with set-cookie: logged_in=no, because that endpoint is the github.com web app and requires a web session cookie — the Authorization: header is ignored. Issue/PR text via api.github.com works fine (HTTP 200); only attachments fail. A broader-scoped PAT and installing gh fail identically. Codex handles this because its platform resolves the attachment server-side and inlines the image into the model's context.

Proposed Solution

Have the platform/harness resolve issue and PR image attachments server-side — using the connected GitHub identity's session-class credential — and inline the image bytes into the model's context when a session is triggered on (or reads) an issue/PR. The agent should then "see" embedded screenshots the same way it sees the issue text, with no shell fetch required.

Alternative Solutions

  • Passing a user PAT or a broader-scoped PAT: fails — the user-attachments endpoint ignores Authorization: entirely.
  • Installing the gh CLI in the startup script: fails — gh uses the same token auth and carries no web session cookie.
  • Current workaround: the user manually pastes the screenshot into chat, which defeats the point of an autonomous GitHub-triggered workflow.

Priority

High - Significant impact on productivity

Feature Category

API and model interactions

Use Case Example

  1. A teammate files a bug as "tooltips overlap on hover" with only a screenshot.
  2. A Claude Code web session is triggered on that issue.
  3. With this feature, Claude sees the screenshot inline, identifies the overlapping tooltips, locates the rendering code, and proposes a fix.
  4. Today, step 3 is impossible without the user manually pasting the image.

Additional Context

Related to but distinct from #41300 (image/video preview in the remote/desktop/mobile UI). This request is about the agent fetching issue-embedded attachments during a task, not UI preview rendering. An exact-phrase search for "user-attachments" in this repo returned zero existing issues.

Reproduction transcript (token redacted, captured in a live web/cloud session, Claude Code 2.1.146):

$ # 1. Token authenticates the API:
$ curl -s -H "Authorization: Bearer $TOKEN" https://api.github.com/user -w "\nHTTP %{http_code}\n" | head -2
{
  "login": "hagelien",
HTTP 200

$ # 2. Same token fetches issue *text* fine:
$ curl -s -o /dev/null -H "Authorization: Bearer $TOKEN" \
    https://api.github.com/repos/<owner>/<repo>/issues/<n> -w "HTTP %{http_code}\n"
HTTP 200

$ # 3. Same token CANNOT fetch the attachment (web-app endpoint, cookie-gated):
$ curl -s -D - -o /dev/null -H "Authorization: Bearer $TOKEN" \
    https://github.com/user-attachments/assets/<uuid> -w "HTTP %{http_code}\n"
HTTP/2 404
content-type: text/plain; charset=utf-8
set-cookie: logged_in=no; domain=github.com; path=/; secure; HttpOnly; SameSite=Lax
set-cookie: _gh_sess=<redacted>; path=/; secure; HttpOnly; SameSite=Lax
x-content-type-options: nosniff
HTTP 404

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Resolve GitHub issue/PR image attachments into Claude Code's context (web/cloud)