Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy AI ReferenceNew to Visual Studio Code? Get it now.
Copy AI Reference

Copy AI Reference

Wraithy

|
5 installs
| (0) | Free
Copy the active file as an @path:lines reference for pasting into AI chats (Claude, Copilot, Cursor, etc.).
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy AI Reference

Copy the active file as an @path:lines reference, ready to paste into AI chats (Claude, Copilot Chat, Cursor, etc.).

VS Code's built-in Copy Relative Path does not add the @ prefix or selection line numbers, and keybindings/tasks can't build the string (no variable for the selection end). This tiny extension does it.

Usage

  • Run Copy AI Reference (@path:lines) from the Command Palette, the editor context menu, or the keybinding.
  • Default keybinding: Cmd+Alt+R (macOS) / Ctrl+Alt+R (Windows/Linux).

Output

Situation Result
No selection @src/neco.txt
Multi-line selection @src/neco.txt:8-15
Single-line selection @src/neco.txt:8

Paths always use forward slashes (Windows-safe). A selection that overflows onto the start of the next line is not counted as an extra line.

Install locally (no build)

Copy this folder to ~/.vscode/extensions/copy-ai-ref/ and run Developer: Reload Window. VS Code loads it on startup — no vsce or compilation needed.

Publish to the Marketplace

  1. Set a real publisher in package.json (create one at https://marketplace.visualstudio.com/manage).

  2. Add an icon.png (128x128).

  3. Package and publish:

    npx @vscode/vsce package    # builds copy-ai-ref-0.0.1.vsix
    npx @vscode/vsce publish    # needs a Personal Access Token
    

License

MIT

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