Claude Corner
Pasted Claude's Code and Got Broken Lines? Use /copy to Grab Just the Block.
By Steven Sorensen · 19 Oct 2026

At a glance
/copycopies Claude's last reply, and when it holds code blocks, a picker lets you take one block instead of the whole answer./copy 2reaches back one reply, andwin the picker writes your selection to a file when the clipboard cannot reach you over SSH.- Quoted text in the picker needs v2.1.295. At 5:51 AM ET on Monday 19 October,
stablewas still at v2.1.292, so stable users do not have that part yet.
Claude hands you a 30 line config or a migration script, you drag the mouse over it, paste it into your editor, and the lines break where the terminal wrapped them, with prose from above and below caught in the selection. Claude Code has a command for exactly this.
Why it matters
A mouse selection copies what the terminal drew, not what Claude wrote. Claude Code's docs warn that mouse selection captures the hard wrapped terminal rendering rather than the source text. For YAML, Python or a shell heredoc, a wrapped line or a lost indent is a bug you then have to find.
/copy skips the screen and copies from the reply itself. The commands reference says that when code blocks or blockquotes are present, it shows an interactive picker so you can select one block or the full response. You take the one snippet you need with its line breaks intact. Our suggestion: stop selecting replies with the mouse and type /copy instead.
How to copy one block cleanly
- Check your build with
claude --version. The picker arrived in v2.1.59, thewkey in v2.1.72 and/copy Nin v2.1.77, so every current channel has them. - When Claude finishes a reply that contains code, type
/copyat the prompt. With no code blocks or quotes, it copies the whole reply. With them, a picker opens listing each block plus the full response. - Select the block you want the way the picker prompts you to. It goes to the clipboard as Claude wrote it, with no terminal wrapping.
- Need an earlier answer?
/copy 2copies the second to last reply, and/copy 3the one before that, with the same picker. - Working over SSH, or on a box with no clipboard tool? Highlight the block in the picker and press
wto write it to a file instead of the clipboard. - On iTerm2, run
/terminal-setuponce. The terminal docs say it turns on the iTerm2 setting Applications in terminal may access clipboard so/copycan write to your system clipboard, even from inside tmux. Restart iTerm2 afterward. - Our suggestion, not a documented workflow: when Claude drafts a commit message or a PR comment, ask it to put the text in a quote. On v2.1.295 or later, the changelog says the picker lists quoted text and copies it without the quote markers.
# We have not run this script end to end on every platform. It only prints versions.
if command -v claude; then claude --version; else echo "claude not on PATH"; fi
npm view @anthropic-ai/claude-code dist-tags --json
# At the Claude Code prompt:
# /copy last reply; the picker opens if it has code blocks or quotes
# /copy 2 the reply before that
# w in the picker, writes the selection to a file
# /terminal-setup iTerm2 only, lets /copy reach the system clipboard
# Optional, npm installs only. latest and next channel, v2.1.303 at 5:51 AM ET Mon 19 Oct:
# npm install -g @anthropic-ai/claude-code@2.1.303
Gotchas
- Stable lacks quoted text. If your machine follows
stable, which served v2.1.292 at 5:51 AM ET Monday, the picker still lists code blocks but not quoted text. Do not mix npm and native installs on one machine. - The picker can switch itself off. v2.1.63 added an Always copy full response option. Choose it and later
/copycalls skip the picker and copy everything. The settings reference says that choice setscopyFullResponsetotruein~/.claude.jsonand shows in/configas Skip the /copy picker, so turn that off in/configif the picker stops appearing. - Sandbox clipboard failures. Since v2.1.267, if Claude tries
pbcopyinside the sandbox and it fails, Claude suggests/copyinstead. Take the hint. - Fullscreen copy is still a screen selection. In fullscreen mode, a drag selection copies on mouse release, and Copy on select in
/configturns that off. We would still use/copyfor code.
Recommended AI prompt
Copy this paragraph into ChatGPT, Claude, Gemini, Grok, or whatever AI you use. I use Claude Code in a terminal and keep pasting broken code because I copy replies with the mouse. Ask me which terminal I use, whether I work over SSH or inside tmux, which channel I installed from, and what claude --version prints. Then give me a two minute check that /copy, /copy 2 and the picker's w key work in my setup, tell me whether I need /terminal-setup, remind me that quoted text in the picker needs v2.1.295, and link me to the official Claude Code commands and terminal docs instead of guessing key names.