Skip to main content

Claude Code's /copy Command

·1 min

A coworker dropped /copy in our work Slack yesterday and I had to try it immediately. It’s a Claude Code slash command that copies Claude’s last response straight to your clipboard as markdown.

Before finding this, my workflow for grabbing a generated code snippet or shell command was embarrassingly manual — select text in the terminal, hope I got the boundaries right, paste it somewhere. Now I just type:

/copy

And the whole response lands in my clipboard, formatting intact — including code blocks. This is especially useful when Claude generates something multi-part, like a function plus its tests or a sequence of shell commands, where careful selection across scroll boundaries used to be the only option.

Python code is where this really pays off. Terminal selection is sloppy about whitespace, and in Python, indentation is the syntax — a misaligned block is broken code. /copy pulls the raw markdown, so the indentation arrives exactly as Claude wrote it.

The markdown formatting means code blocks stay as code blocks when you paste into a GitHub issue. (Slack’s markdown behavior from clipboard is inconsistent, so results may vary there.)

You can see all available slash commands by running /help. I suspect there are others I’ve been missing.

Tested on macOS with Claude Code 2.1.50.

Related

Announcing MetaCPAN LaunchBar Action

At one of the Toronto Perl Mongers meetings Olaf was demonstrating something or other and during the demonstration he used Alfred to search metacpan. I’ve been a LaunchBar user for a long time, but the Alfred plugin offered auto completion, something my LaunchBar search didn’t have. He proceeded to show a couple of the other plugins (which I don’t recall at this point) and I decided I needed to try it out too.