brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: /copy 2 copies Claude's second-to-last answer, not just the last

Claude
~/tips/tip-claude-copy-nth-response

/copy 2

Copies an earlier Claude Code answer, or a single code block from it, to the clipboard.

Selecting text in a terminal with the mouse and hoping it stops at the right line is a small daily misery.

/copy puts Claude's last response on the clipboard. Give it a number and you get an older one: /copy 2 is the second-to-last.

/copy 2

When the answer has code blocks, an interactive picker lets you take one block or the whole response. Press w in the picker and the selection goes to a file instead of the clipboard.

That w is the useful part over SSH, where the clipboard in your terminal often is not the clipboard on your laptop. I would write to a file and fetch it.

Plain selection fails on long code blocks, wrapped lines and indentation that comes out slightly wrong. The picker knows where the blocks start and end, so you get the text as Claude wrote it.

The caveat is only that the number counts responses, not code blocks. Block choice happens in the picker.

Further reading: Commands – Claude Code docs, On this site: /context shows what is eating your Claude Code context window, On this site: /statusline builds you a status bar with context usage in it

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link