claude-code - 💡(How to fix) Fix [FEATURE] VS Code extension: click-to-copy affordance on code blocks in Claude responses [1 participants]

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…
GitHub stats
anthropics/claude-code#48641Fetched 2026-04-16 06:54:55
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

In the Claude Code VS Code extension, code blocks rendered in Claude's responses have no click-to-copy affordance. Copying requires manually selecting the text with the mouse, which is slow and error-prone for multi-line snippets.

Error Message

In the Claude Code VS Code extension, code blocks rendered in Claude's responses have no click-to-copy affordance. Copying requires manually selecting the text with the mouse, which is slow and error-prone for multi-line snippets.

Root Cause

In the Claude Code VS Code extension, code blocks rendered in Claude's responses have no click-to-copy affordance. Copying requires manually selecting the text with the mouse, which is slow and error-prone for multi-line snippets.

RAW_BUFFERClick to expand / collapse

Summary

In the Claude Code VS Code extension, code blocks rendered in Claude's responses have no click-to-copy affordance. Copying requires manually selecting the text with the mouse, which is slow and error-prone for multi-line snippets.

Current behavior

When Claude outputs a fenced code block in the VS Code extension chat panel, the block renders with syntax highlighting but no copy button and no click-to-copy behavior. To copy a snippet I have to click, drag-select the full range, then Cmd+C.

Expected behavior

Either (or both) of:

  1. Copy button on hover — a small copy icon appears in the top-right of the code block when hovered, click to copy the full contents, with a brief "Copied" confirmation.
  2. Click-anywhere-to-copy — clicking anywhere inside the block copies its contents and shows a brief "Copied" confirmation.

This matches the convention in the Claude.ai web app, GitHub, ChatGPT, and essentially every modern chat UI that renders code.

Why it matters

Copy-paste from Claude into the editor is one of the primary workflows in the extension. Missing the copy affordance is currently the biggest ergonomic gap compared to both the web app and competing coding assistants.

Environment

  • Claude Code VS Code extension
  • macOS (Darwin 25.3.0)

extent analysis

TL;DR

Adding a click-to-copy feature or a copy button to code blocks in the Claude Code VS Code extension is likely the most straightforward fix.

Guidance

  • Review the extension's code for rendering code blocks to identify where the copy functionality can be integrated, potentially leveraging existing libraries or VS Code APIs for syntax highlighting and user interaction.
  • Consider implementing the "Copy button on hover" feature as it is a common pattern in similar applications, providing a clear and intuitive way for users to copy code snippets.
  • Investigate if there are any existing VS Code extensions or open-source projects that implement similar functionality, which could serve as a reference or starting point for development.
  • Test any implemented solution across different platforms, including macOS, to ensure consistency and compatibility.

Example

No specific code example can be provided without access to the extension's source code, but the implementation might involve adding an event listener to the code block elements for click events and using the clipboard API to copy the contents.

Notes

The exact implementation details may depend on the technologies and frameworks used by the Claude Code VS Code extension, such as React, Vue, or vanilla JavaScript, and how it interacts with the VS Code API.

Recommendation

Apply a workaround by integrating a click-to-copy feature directly into the extension, as this addresses the primary ergonomic gap identified and aligns with user expectations from similar applications.

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…

FAQ

Expected behavior

Either (or both) of:

  1. Copy button on hover — a small copy icon appears in the top-right of the code block when hovered, click to copy the full contents, with a brief "Copied" confirmation.
  2. Click-anywhere-to-copy — clicking anywhere inside the block copies its contents and shows a brief "Copied" confirmation.

This matches the convention in the Claude.ai web app, GitHub, ChatGPT, and essentially every modern chat UI that renders code.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING