Skip to content

Markdown images and file links written as Git Bash paths (/c/...) don't load on Windows #38088

Closed

Description

@KamilDev

What happens

On a Windows host, agents often copy paths the way Git Bash prints them. Claude Code's Bash tool runs Git Bash, so a file it lists comes back as /c/Projects/my-app/screenshot.png. When the agent embeds that in a reply (![screenshot](/c/Projects/my-app/screenshot.png)), the image shows as unavailable, and a file link to the same path opens nothing. The same file written as C:/Projects/my-app/screenshot.png loads.

Why

The client passes any path starting with / to the host as a media file. On Windows, Node reads /c/Projects/... as \c\Projects\... on the current drive, which doesn't exist. The server already translates the other way for WSL (toWslDrivePath), but nothing maps Git Bash's /x/... drive form. The runtime instructions also don't say which form to use on Windows, and their example (/abs/path/http.ts:42) is POSIX-shaped.

Repro

  1. Windows host (T3 Code 0.1.9 desktop, Windows 11), Claude provider.
  2. Have the agent embed an existing image by its Git Bash path, e.g. ![x](/c/Users/<you>/Pictures/x.png).
  3. The image is unavailable; C:/Users/<you>/Pictures/x.png renders.

Suggested fix

Next to toWslDrivePath: when the server runs on Windows, read /x/... as X:\... unless the path exists as written. Call sites: AssetAccess (media and draft files) and WorkspaceFileSystem's toHostPath (chips and file reads). A Mac or Linux host leaves /c/... alone, since it can be a real folder there. Optionally, the runtime instructions could tell agents to write C:/ paths on Windows. I have this working with a test and can open a PR.

Related: #20897, #14839, #26685.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions