Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>code-referenceNew to Visual Studio Code? Get it now.
code-reference

code-reference

tangshun

|
1 install
| (0) | Free
Copy selected code references with line or line/column ranges, and optionally paste them into Codex.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

code-reference

Small VS Code extension for copying selected code locations in a Codex-friendly format.

Commands

  • Copy Code Reference: Line Range
    • packages/foo/bar.ts#L16-16
  • Copy Code Reference: Line + Column Range
    • packages/foo/bar.ts#L16C34-16C49
  • Send Code Reference to Codex: Line Range
  • Send Code Reference to Codex: Line + Column Range
  • Send Relative Path to Codex from the Explorer file tree or editor tab context menu

Default Shortcuts

  • Cmd+Alt+L: copy line range
  • Cmd+Alt+C: copy line + column range
  • Cmd+Alt+Shift+L: send line range to Codex
  • Cmd+Alt+Shift+C: send line + column range to Codex

On Windows/Linux, use Ctrl instead of Cmd.

Codex Sync

VS Code extensions cannot reliably write directly into another app's input box through an official Codex API. This extension therefore provides two practical paths:

  1. macos-osascript (default): copies the reference, activates the Codex macOS app, waits only until it becomes frontmost, and pastes into the focused field. macOS may ask VS Code for Accessibility/Automation permission.
  2. custom-command: runs a shell command that you control. The command can use placeholders such as ${reference}, ${file}, ${lineStart}, and ${kind}.

If sync is not available, the reference is still copied to the clipboard.

Settings

{
  "codexCodeReference.pathStyle": "workspace-relative",
  "codexCodeReference.codexSync.strategy": "macos-osascript",
  "codexCodeReference.codexSync.appName": "Codex",
  "codexCodeReference.codexSync.submitAfterPaste": false,
  "codexCodeReference.codexSync.pasteDelayMs": 80,
  "codexCodeReference.codexSync.frontmostTimeoutMs": 1500,
  "codexCodeReference.codexSync.customCommand": ""
}

Development

npm install
npm run compile

Press F5 in VS Code to launch an Extension Development Host.

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