Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy Path for Claude CodeNew to Visual Studio Code? Get it now.
Copy Path for Claude Code

Copy Path for Claude Code

arx8

|
1 install
| (0) | Free
Copy the active file path in Claude Code @path format to the clipboard, with optional line numbers.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Path for Claude Code

Copy Path for Claude Code

VS Code extension that copies the active file path in Claude Code's @path format to the clipboard.

Install from VS Code Marketplace

Demo

Demo

Why?

Claude Code for VS Code has a built-in command Claude Code: Insert @-Mention Reference — which would make this extension completely unnecessary. Unfortunately, it still doesn't work in some environments

The issues below are closed, but the command still doesn't work in my environment for months. e.g.

  • [[BUG] VSCode Extension: "Insert @-Mention Reference" and "Insert At-Mentioned" keyboard shortcuts not working on Windows (v2.1.7) · Issue #18083 · anthropics/claude-code](https://github.com/anthropics/claude-code/issues/18083)
  • [[BUG] Insert At-Mentioned doesn't work anymore in VSCode Version: 1.108.0 · Issue #18126 · anthropics/claude-code](https://github.com/anthropics/claude-code/issues/18126)

So here we are. 🫠

If you're in the same boat, this extension has your back until the official command is fixed. 🫰

Features

  • Copy Relative Path — Copies @relative/path/to/file.ts to clipboard
  • Copy Absolute Path — Copies @/absolute/path/to/file.ts to clipboard
  • Line number support — When text is selected, appends line numbers automatically
    • Single line: @path#5
    • Range: @path#5-10

Usage

  1. Open a file in the editor
  2. Open the Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
  3. Run one of:
    • Copy Relative Path for Claude Code
    • Copy Absolute Path for Claude Code
  4. Paste the result into Claude Code

Optionally, select text before copying to include line numbers.

Keyboard Shortcuts

This extension does not register default keybindings. To set your own:

  1. Open the Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
  2. Run Preferences: Open Keyboard Shortcuts
  3. Search for Copy Path for Claude Code
  4. Click the pencil icon next to the command and assign your preferred shortcut
Command Command ID
Copy Relative Path for Claude Code copy-path-for-claude-code.copyRelativePath
Copy Absolute Path for Claude Code copy-path-for-claude-code.copyAbsolutePath

You can also edit keybindings.json directly. For example:

[
  {
    "key": "ctrl+shift+c",
    "command": "copy-path-for-claude-code.copyRelativePath",
    "when": "editorTextFocus"
  }
]

Requirements

  • VS Code 1.109.0 or later

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft