Copy Code Path ReferenceEnglish | 中文 Copy AI-friendly file and line references from VS Code-compatible editors:
This is useful when sending exact code locations to Codex, Claude Code, Cursor Chat, or other AI coding tools. Quick UsageSelect code, press the shortcut, then paste the copied reference into your AI coding tool.
Output example:
No selection copies the current line:
Multiple cursors or selections are copied as one reference per line:
Other Ways To RunYou can also run Why For AIAI coding tools work best when you give them precise file and line references. This extension copies only the location reference, not the code content, so it stays compact and avoids accidentally pasting large or sensitive snippets into chat. Customize The ShortcutOpen Keyboard Shortcuts and search for:
Then bind it to any shortcut that does not conflict in your editor. Install LocallyInstall dependencies once:
Package a
Install the generated
For Cursor or Trae, use their extension install UI or CLI if available. 中文从 VS Code 兼容编辑器里复制适合 AI 编程工具使用的文件路径和行号引用:
当你需要把精确的代码位置发给 Codex、Claude Code、Cursor Chat 或其他 AI 编程工具时,这个扩展会很方便。 快速使用选中代码,按快捷键,然后把复制出来的引用粘贴到 AI 编程工具里。
输出示例:
没有选中代码时,会复制当前行:
多个光标或多个选区会复制为多行,每行一个引用:
其他运行方式你也可以在 VS Code、Cursor、Trae 或其他兼容 VS Code 扩展的编辑器里,从命令面板或编辑器右键菜单运行 为什么适合 AIAI 编程工具在拿到精确的文件路径和行号后,更容易定位上下文。这个扩展只复制位置引用,不复制代码内容,所以粘贴结果更紧凑,也能减少误把大段代码或敏感代码贴进聊天窗口的风险。 自定义快捷键打开 Keyboard Shortcuts,搜索:
然后绑定成你喜欢、且不和其他功能冲突的快捷键。 本地安装首次安装依赖:
打包
在兼容 VS Code 扩展的编辑器里安装生成的
Cursor 或 Trae 可以使用它们的扩展安装界面,或者使用对应 CLI 安装。 |