Add Clipboard Copy Functionality for Current Prompt

Status Open
Maintainer reply None cached
Activity 10 comments · opened Aug 2, 2025
Update Aug 15 2025: I made the ch TUI app to implement this feature outside of claude code - https://github.com/anthropics/claude-code/issues/5005#issuecomment-3192509380

Use case

In claude code, I often want to copy the text in my prompt to my clipboard. I save these prompts to sublime text, and then often paste it into vscode + copilot, or gemini.

Suggested shortcut

Would you consider adding a keyboard shortcut (eg: <kbd>Ctrl+Shift+c</kbd>) and action to copy the contents of the claude code prompt editor?

vim mode missing this feature too

Even in vim mode, there is no keyboard shortcut to copy the current prompt.

claude code is awesome. Thank you!

View original on GitHub ↗

10 Comments

Wowfunhappy · 1 year ago

Even better would be if copy and paste just worked, right? Like OP, I often want to save my prompts elsewhere, or even switch between Claude Code and claude.ai.

The problem of course stems from Claude Code's fancy UI. It's using text characters to draw a box:

╭──────────────────────────────────────────────────────────────────────────╮
│ > Quisque eget odio ac lectus vestibulum faucibus eget in metus.         │
╰──────────────────────────────────────────────────────────────────────────╯
  ? for shortcuts

But, this box _really_ isn't necessary, especially at the cost of breaking copy and paste! It would be just as clear where to type with only the separator lines:

────────────────────────────────────────────────────────────────────────────
> Quisque eget odio ac lectus vestibulum faucibus eget in metus.
────────────────────────────────────────────────────────────────────────────
  ? for shortcuts

And then let the Terminal line wrap the characters itself. No fancy formatting = easy copy and paste.

Here's how it looks with mutliple lines. Note that because Github doesn't wrap text in code blocks, I have to add line breaks (bad for copy and paste) for it to look right on here. However, a Terminal would automatically wrap the text. The idea is that everything from the starting > to the end of your prompt can be plain text, nothing added.

────────────────────────────────────────────────────────────────────────────
> Quisque eget odio ac lectus vestibulum faucibus eget in metus. In
pellentesque faucibus vestibulum. Nulla at nulla justo, eget luctus
tortor. Nulla facilisi. Duis aliquet egestas purus in blandit. Curabitur
vulputate, ligula.
────────────────────────────────────────────────────────────────────────────
  ? for shortcuts

This small change would improve my life. Thanks for considering.

nazmulidris · 1 year ago

Another option could be to add a new /history-copy command which could display a list of prompts (similar in a way to /resume). Then upon selecting one, the contents of this prompt could be copied to the clipboard and ready to paste wherever.

tamasarpad · 1 year ago

Many times I go back to previous prompts, copy them and paste into a new session to start over from there, but I have to tidy up the copied text from the extra characters and spaces
edit:
I just found out that in iterm2 I can use opt+command+mouse for rectangular selection which helps a lot.

nazmulidris · 1 year ago

I have actually create a small TUI app called ch (Claude Code History) to be a workaround for this missing feature.

You can see a video of it in action here:
<!-- https://github.com/user-attachments/assets/94799739-ff7b-48b3-8bf5-b0e210ee1b30 -->

<video src="https://github.com/user-attachments/assets/94799739-ff7b-48b3-8bf5-b0e210ee1b30" controls></video>

To install it, you have to use rustup. Here is more information on it.

Here are the basic steps on Linux:

# Install rustup (if you don't have this installed already)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install r3bl-cmdr (which has `ch` in it)
cargo install r3bl-cmdr

# Run `ch`
ch --help
jackstine · 12 months ago

I use tmux and the prompt comes out like weird, would like a fix. this should be one line of text, and not include the pipes |.

│ > let's create the plan and pseudocode changes needed.   1. ok let's use create methods 2. what does adding in the ledger accounts look like    │
│   to the model? 3. let's link the contacts 4. if members need a party, can we ensure that the party comes from the chain835, if not, then link  │
│   it to the party in the persistent layer. let's go with creating the party first as well.  I think the member id changes as well, and it       │
│   needs to be reset of something.   I could be wrong though...  5. invoices should contain the bills all the way in the factory classes that    │
│   are generated, we should make the update there 6. testing config is good 7. ok adding payment preference is good.  8. ok, add account         │
│   activation, I assume this is the E6 accounts?  not sure... 9. the config should not have optional configuraitons,  this is going to be        │
│   supplied by the scenario chain835s.  10. TestingData is a global variable in @internal/testing/utils/dynamic_test_data_v2.go just use that    │
│   please                                                                                                                                        │
edswangren · 9 months ago

Why does copy paste not work? This is modern tech? Can't copy and paste text? What? My experience so far has been abysmal.

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

nvie · 7 months ago

+1 to having a special shortcut like ⌘+Shift+C to copy the current prompt to the clipboard. Sometimes I have multiple Claude code instances open and I realize I wrote a long prompt in the wrong window and I'd like to copy the prompt more easily than to select all those wrapped lines with a mouse and strip out all the ascii box characters like a caveman.

radres · 7 months ago

It is really unexpected to not have a good workaround to copy current prompt to clipboard.

Also in vim mode yy does nothing. Cannot use p afterwards either.

joelev · 7 months ago

Different use case than the prompt editor shortcut requested here, but related: I made a small skill that adds /yank for general clipboard access.

https://github.com/joelev/yank

Install:

mkdir -p ~/.claude/skills/yank
curl -o ~/.claude/skills/yank/SKILL.md \
  https://raw.githubusercontent.com/joelev/yank/main/SKILL.md

Cross-platform (macOS, Linux, Windows via WSL), ~40 lines. Claude will also offer to yank when generating prompts or snippets you might want to paste elsewhere.

Doesn't solve the keyboard shortcut request, but helps with the general "get stuff onto my clipboard" problem.