VS Code Extensions
Copy AI Reference

Copy AI Reference

by Wraithy

Copy the active file as an @path:lines reference for pasting into AI chats (Claude, Copilot, Cursor, etc.).

Downloads

18

Rating

— (0)

Version

0.0.1

Last updated

Jun 16, 2026

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

Related extensions