Copy File Path with Line Numbers (AI Prompt)

April 18, 2026 · View on GitHub

Copy deterministic file paths with line numbers from the active VS Code editor in one keypress.

Install

What it does

VSCode

image

Jetbrains IDEs

image

Copy File Path with Line Numbers (AI Prompt) is a focused utility for developers who need a paste-ready path:line or path:start-end reference without cleanup. It fits AI prompting especially well, but it is just as useful for code reviews, tickets, and debugging notes.

It always produces POSIX-style slash paths with normalized path:line or path:start-end output for the active saved local file.

  • Absolute command: /full/path/to/file.ts:42
  • Relative command: src/file.ts:42
  • Multi-line selection: src/file.ts:42-57

Commands

Command IDCommand Palette title
copyFilePathWithLineNumbers.copyAbsoluteReferenceCopy Absolute File Path with Line Numbers
copyFilePathWithLineNumbers.copyRelativeReferenceCopy Relative File Path with Line Numbers

Default shortcuts

PlatformAbsoluteRelative
macOS⌥⇧C⌥C
Windows / LinuxCtrl+Alt+Shift+CCtrl+Alt+C

These defaults match the shipped package.json manifest contributions.

Supported editor state

  • Saved local text files

This extension only supports saved local files. Unsupported states fail clearly with No saved local text file is active instead of copying something ambiguous.

Product scope

  • One-step clipboard copy with no confirmation UI
  • Saved local text files only
  • POSIX-style forward slashes on every platform
  • Deterministic output that is ready for AI prompts and other developer workflows

Contributing

See CONTRIBUTING.md for local development, release workflow, and commit conventions.