A VS Code extension that copies file references — with or without selected code — directly to your clipboard, formatted for use with Claude Code.
Features
Copy File & Lines — copies a @workspace/path/to/file.ts:line reference so Claude Code can jump straight to the location.
Copy File, Lines & Code — copies the same reference plus the selected code wrapped in a fenced code block, ready to paste into a Claude conversation.
Reference link navigation — recognize @workspace/path/to/file.ts:line references in text and click them to open the file with the specified line range selected. Use Ctrl+Click on Windows/Linux or Cmd+Click on macOS to follow the link.
Example output
Reference only:
@my-project/src/utils/auth.ts:42
Reference with code:
@my-project/src/utils/auth.ts:42-58
export function verifyToken(token: string): boolean {
...
}
Usage
| Action | Windows / Linux | macOS |
|---|---|---|
| Copy reference | Ctrl+Shift+C |
Cmd+Shift+C |
| Copy reference + code | Ctrl+Shift+X |
Cmd+Shift+X |
Both commands are also available in the editor right-click context menu under Copy for Claude.
Installation
Install from the VS Code Marketplace, or download the .vsix from the releases page and run:
code --install-extension copy-for-claude-*.vsix