claude-code - 💡(How to fix) Fix [FEATURE] CLI: Support clipboard image paste in VS Code devcontainer via IPC

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

The extension works because its chat UI is a webview running in VS Code's Electron renderer process on the host machine. It intercepts the DOM paste event (event.clipboardData) in the browser context, then sends the image bytes into the container via VS Code's protocol:

Fix Action

Fix / Workaround

Workaround today:

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

Description:

When running Claude Code inside a VS Code devcontainer, pasting images (Ctrl+V) works in the VS Code extension but fails silently in the CLI.

Analysis:

The extension works because its chat UI is a webview running in VS Code's Electron renderer process on the host machine. It intercepts the DOM paste event (event.clipboardData) in the browser context, then sends the image bytes into the container via VS Code's protocol:

[Host clipboard] → [VS Code Electron renderer] → [VS Code protocol] → [Container] The CLI runs inside the container and has no access to the host clipboard. Standard clipboard tools (xclip, wl-clipboard) require a display server (DISPLAY/WAYLAND_DISPLAY) which devcontainers don't have. The host may also be Mac or Windows, making X11/Wayland tools irrelevant.

Proposed Solution

When the CLI detects it is running inside a VS Code devcontainer (detectable via VSCODE_IPC_HOOK_CLI env var being set), it could request clipboard image data from the VS Code host process over the existing IPC socket — the same channel used by the code CLI for commands like opening files.

This would give the CLI the same clipboard image access path the extension already uses, without any host-side setup or security concerns (paste remains an explicit, user-initiated action).

Alternative Solutions

No response

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

  • copy an image in the host
  • Open devcontainer
  • Launch claude code cli in terminal
  • Paste the imge -> not workoing

Additional Context

Environment:

Claude Code CLI version: 2.1.109 VS Code devcontainer (Docker, Linux container, Mac or Windows host) VSCODE_IPC_HOOK_CLI is present in terminal env inside devcontainer CLAUDE_CODE_ENTRYPOINT=claude-vscode is set

Workaround today:

Use the VS Code extension instead of the CLI terminal for image paste. No devcontainer-side fix is possible without host-side tooling.

extent analysis

TL;DR

Implement a feature in the Claude Code CLI to request clipboard image data from the VS Code host process over the existing IPC socket when running inside a VS Code devcontainer.

Guidance

  • Detect if the CLI is running inside a VS Code devcontainer by checking the presence of the VSCODE_IPC_HOOK_CLI environment variable.
  • Use the existing IPC socket to request clipboard image data from the VS Code host process, similar to how the code CLI requests commands like opening files.
  • Handle the case where the host machine is Mac or Windows, and the devcontainer is Linux, to ensure compatibility.
  • Test the feature with different image types and sizes to ensure it works as expected.

Example

No code snippet is provided as the issue does not contain sufficient technical details to generate a specific example.

Notes

The proposed solution relies on the existing IPC socket and does not require any host-side setup or security concerns, making it a viable option. However, the implementation details may vary depending on the specific requirements and constraints of the Claude Code CLI and VS Code devcontainer.

Recommendation

Apply the proposed workaround by implementing the feature in the Claude Code CLI to request clipboard image data from the VS Code host process over the existing IPC socket. This solution has a high priority and significant impact on productivity, making it a worthwhile investment.

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] CLI: Support clipboard image paste in VS Code devcontainer via IPC