Feature Request: Add /copy command to copy messages to clipboard
Feature Request: /copy [N=1] slash command
Summary
Add a /copy slash command that copies the last N Claude Code messages as Markdown to the OS clipboard.
Proposed Usage
/copy # Copies the last message (Claude's response)
/copy 3 # Copies the last 3 messages (alternating user/Claude)
/copy 5 # Copies the last 5 messages
Expected Behavior
- Default N=1 (copies just Claude's last response)
- Messages should be copied as properly formatted Markdown
- Should include both user messages and Claude responses when N > 1
- Should integrate with OS clipboard (works with Cmd+V/Ctrl+V)
- Should preserve code blocks, formatting, and structure
Use Cases
- Quickly share Claude's responses in documentation
- Copy code snippets and explanations for use elsewhere
- Archive conversation snippets for later reference
- Share troubleshooting responses with team members
Implementation Notes
- Should work across platforms (macOS, Linux, Windows)
- Consider using a clipboard library like
pyperclipor similar - Messages should maintain original formatting and structure
- Could potentially support additional formats (plain text, HTML) as options
This would significantly improve the workflow when working with Claude Code responses that need to be shared or documented elsewhere.
Found 1 possible duplicate issue:
- https://github.com/anthropics/claude-code/issues/859
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
need this
Need this too, would be nice if it was native but found this https://github.com/Twizzes/copy-claude-response
need this
Please add this because a lot of times I want to copy the claude message to a colleague on slack.
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.
This would be extremely helpful!
Fwiw a hack I use: if the message has some uniquely identifiable piece, you can grep for that in ~/.claude. Here's a one-liner to copy the markdown to clipboard:
rg -FIN 'some unique substring from the message' ~/.claude | jq -r '.message.content[].text' | pbcopy