[FEATURE] VSCode extension: Copy chat response as markdown source

Status Open
Maintainer reply None cached
Activity 9 comments · opened Apr 29, 2026

Preflight Checklist

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

Problem Statement

In the Claude Code VSCode native extension, selecting text in the chat panel and pressing Cmd+C / Ctrl+C copies only the rendered visible text. All markdown formatting is lost — code fences, bullets, headings, bold/italic, links, file-path hyperlinks, tables, etc. all collapse into plain prose.

Unlike the terminal CLI, the VSCode extension does not expose the /copy slash command (running it returns copy isn't available in this environment), and there's no context-menu item, toolbar button, or setting to copy the raw markdown instead.

This is distinct from existing request #48489, which targets the Windows desktop app and whose workaround is presumably /copy in the CLI. In the VSCode extension there is no equivalent escape hatch — the chat panel is the only surface and it strips formatting unconditionally. #12413 (closed as duplicate) covered the same VSCode-specific concern but never received a targeted resolution.

Proposed Solution

Any one of the following would solve it, in order of preference:

  1. Context-menu action on assistant messages: Right-click an assistant message (or a selection within it) → "Copy as markdown" → raw markdown source goes to the clipboard.
  2. Per-message copy button: A small copy icon on hover over each assistant message that copies the raw markdown of that message.
  3. Setting: claudeCode.copyRawMarkdown: true that makes the existing Cmd+C on a selection return markdown source instead of rendered text.
  4. Keybinding: A distinct shortcut such as Cmd+Shift+C that performs "copy as markdown" alongside the default plain-text copy.

Option 2 matches the pattern used by most LLM chat UIs (ChatGPT, Claude.ai web) and is the most discoverable.

Alternative Solutions

Current workarounds, all unsatisfying:

  • Ask Claude to wrap the response in a fenced code block so the raw markdown is visible — adds turns, wastes tokens, and is forgotten between conversations.
  • Open the VSCode integrated terminal, run claude, and use /copy there — requires switching surfaces and loses the context of the ongoing VSCode-extension session.
  • Manually re-type markdown when pasting into PR descriptions, GitHub issues, or docs.
  • Switch chat mode from 'CLAUDE CODE' to 'CHAT' (VSCode's built-in): This still lists Claude chat sessions in it's session list and provides superior C&P functionality. Both Copy and Copy Final Response include markdown. This is the best workaround I've identified, but it is still a faff.

Priority

High - Significant impact on productivity

Feature Category

Other

Use Case Example

  1. I ask Claude Code (in the VSCode extension) to summarize a bug investigation, and it replies with a nicely-formatted response containing headings, bullet lists, inline code, fenced code blocks, and [filename.ts:42](path#L42) links.
  2. I want to paste that summary into a GitHub PR description, a Linear ticket, or a Slack message with markdown mode enabled.
  3. Today: I select the text, Cmd+C, paste — and get a wall of plain prose. Headings gone, code blocks gone, links gone, file-path hyperlinks gone. I have to either manually reformat or ask Claude to regenerate as a fenced block (wasting context and tokens).
  4. With this feature: I click "Copy as markdown" on the message, paste into the PR — and the formatting is preserved end-to-end.

Additional Context

  • Environment: Claude Code VSCode native extension.
  • The terminal CLI already supports this via /copy <N>; the VSCode extension does not expose that command.
  • Related: #48489 (desktop app, Windows), #12413 (closed as duplicate without resolution), #5512 (CLI /copy — already shipped in the CLI).

View original on GitHub ↗

9 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/12413
  2. https://github.com/anthropics/claude-code/issues/45607
  3. https://github.com/anthropics/claude-code/issues/24993

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Matt-Ebury · 4 months ago

https://github.com/anthropics/claude-code/issues/45607 Captures the core request here, but it would be good to see the C&P features be built out to parity with VSCode's own chat solution.

markheath · 3 months ago

Very disappointing that this doesn't exist, given that multiple other issues have been raised about this and closed. Some mention a /copy command, but that is not recognized in the VS Code extension. A workaround is that the VS Code "CHAT" view does seem to be able to show your "CLAUDE CODE" sessions, so you can find them in there and copy from that

ChrisHannan-zl · 3 months ago

WHen I use Claude Code in VSCode, I have no ability to select a response and copy it. I am using an array of AI's to do advanced development on my platforms. I've added yesterday Claude Code as the Audit layer. When I need to copy his results into my other AI that is the CTO role or other AI personas in my array I simply do not have this option. I have to scroll highlight and drag down to the end. THis is very inefficient. To the level that I am considering it a true bug. Perhaps because it really bugs me that such a beautiful and elegant chat / coding interface in VSCode is lacking this clearly very important and I would say standard UI component. The old copy and paste ability to quickly move info around. Perhaps even a download icon so it can drop a txt file or .md file on my desktop - or enable this automatically after every response. Yes that would be great .

Ok. That's all. In general I am liking Claude. Takes more time that GPT but I like the level of quality responses.

bravo to the teams

ChrisHannan-zl · 3 months ago

It's kind of retarded that it does not exist. Copy Paste. Such an advanced concept. Must be over the heads of the Claude Developers.

theosib · 2 months ago

I agree. This should be easy to implement. Claude produces markdown, and the vscode plugin renders it as formatted text. It shouldn't be that hard to provide an option to copy the original markdown.

comenglish · 1 month ago

+1. Same issue in the JetBrains (IntelliJ IDEA) plugin — copying from the chat panel also strips all Markdown formatting. Would love to see this feature extended to the JetBrains plugin as well.

tredondo · 1 month ago

The lack of this basic feature makes copy/pasting to interop with other systems (issue trackers etc.) a royal pain in the ass - you have to manually reproduce the Markdown formatting, or resort to silly contorted solutions like screenshotting then asking another AI to generate the Markdown formatting.

phase3dev · 1 month ago

+1

This is an essential, everyday feature, and the frustrating part is that everything needed to ship it already exists in the product; it's just not switched on in the VS Code webview.

Specifically:

In VS Code, the assistant text arrives as Markdown. The webview's entire render path is Markdown to HTML. The raw Markdown source is the input to what you're looking at; the styled headings, fences, and bullets you see are just its rendered output. The client already has the Markdown in hand.

  • It's persisted verbatim on disk. Every turn is written to the session JSONL as the exact Markdown text (message.content[].text), byte-for-byte, no re-conversion. The source of truth is already Markdown.
  • Clipboard write is already wired up. Every code block ships a working copy button. The plumbing to write to the clipboard exists and works; it's just scoped to code fences instead of whole messages.

What throws it away instead. There's no message-level "copy as Markdown" affordance at all (no context-menu item, no per-message button, no setting, no keybinding, and /copy isn't exposed), so default Cmd/Ctrl+C falls through to the browser's selection-copy, which serializes the rendered DOM to text/plain. That plain-text serialization is what strips the fences, headings, bullets, links, file-path hyperlinks, and tables. The formatting isn't lost because the data is missing; the Markdown was right there and gets discarded at copy time by taking the lossy path.

This would be trivial to implement natively. It's not a new pipeline: the Markdown exists client-side and on disk, the clipboard write already works, and the feature already exists in the CLI. All that's missing is a button (or a setting) that copies message.content instead of the DOM's text/plain. A claudeCode.copyRawMarkdown: true setting, a per-message copy icon, or just wiring /copy into the webview would each be a small change against machinery that's already present.

I had Claude create a small custom webview patch which already does exactly this.

  • Adds a one-click copy-as-Markdown icon to every user and assistant message, flipping to a checkmark only when the copy actually lands, plus a copy-whole-conversation control.
  • Reconstructs Markdown by walking the rendered DOM: headings, bold/italic/strikethrough, inline and fenced code (with fence lengths chosen longer than any backtick run in the body), links including file-path hyperlinks, nested ordered/unordered lists, blockquotes, and tables. A sanitize pass strips chrome (tool blocks, buttons, the rating widget) so only message content is copied; visible thinking summaries stay copyable.
  • Writes to the clipboard with a synchronous document.execCommand("copy") first, which is gesture-safe and works without a secure context (i.e. over Remote-SSH / code-server, where the async Clipboard API is absent), falling back to navigator.clipboard.writeText.
  • It fails safe: if a selector moves, the control just doesn't appear, never wrong output, never a false "copied."

If a small external patch can do all this against the existing bundle, doing it natively obviously would be easy. I don't understand why Anthropic doesn't just listen to its users when it comes to issues like this? Why is there so much resistance to just turning on an ALREADY EXISTING feature (or at minimum providing a setting/option for it)??