[BUG] Image markdown is silently rewritten in GitHub comments posted from cloud sessions

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 25, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When Claude posts a GitHub issue or PR comment from a Claude Code on the web cloud session, every image embed in the body is rewritten before it reaches GitHub:

| Sent | Stored by GitHub |
| --- | --- |
| ![alt](url) | [alt](url) — leading ! stripped, becomes a plain link |
| [![alt](url)](target) | [[alt](url)](target)! stripped, leaves a broken nested link |
| <img src="url" width="300"> | ` &lt;img src="url" width="300"&gt; ` — HTML-escaped and wrapped in a code span |

This happens silently. The API call returns 201 Created, the tool result reports success, and nothing in the response indicates the body was modified. It is only detectable by reading the comment back and diffing it against what was sent.

Note that this is not about uploading images to github, but rather linking images uploaded to other places (cloudflare R2 in my case) in github comments.

What Should Happen?

Image markdown should be passed through unmodified. If this is intentional behavior then this should be clarified in some way, better to throw an error and let users know that image markdown is not allowed and at the very least document it somewhere.

However I would argue if this sanitation is specifically designed to prevent embedding images in markdown then it is overzealous - having the agent add images to PRs is essential for fast PR reviews and to my knowledge there is no serious threat model where showing images would result in malicious behaviors for visitors or where showing images that were already uploaded somewhere else would expand malicious extraction of information (I.E. the agent already uploaded the images somewhere else, linking to it in github is not going to increase the threat)

Error Messages/Logs

Steps to Reproduce

From a Claude Code on the web cloud session, against any repository you can comment on:

  1. Post a comment containing an image embed:

``sh
gh api repos/OWNER/REPO/issues/1/comments \
-f body='![icon](https://claude.ai/images/claude_app_icon.png)'
``

  1. Read back what GitHub actually stored:

``sh
gh api repos/OWNER/REPO/issues/1/comments --jq '.[-1].body'
``

  1. Compare:

``
Expected: ![icon](https://claude.ai/images/claude_app_icon.png)
Actual: [icon](https://claude.ai/images/claude_app_icon.png)
``

The <img> variant, for completeness:

gh api repos/OWNER/REPO/issues/1/comments \
  -f body='<img src="https://claude.ai/images/claude_app_icon.png" width="200">'
Expected: <img src="https://claude.ai/images/claude_app_icon.png" width="200">
Actual:   `&lt;img src="https://claude.ai/images/claude_app_icon.png" width="200"&gt;`

Both also reproduce via the GitHub MCP server's add_issue_comment tool with the same body, producing byte-identical output.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.243

Platform

Anthropic API

Operating System

Other

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗