Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Agent CommentsNew to Visual Studio Code? Get it now.
Agent Comments

Agent Comments

Christian Alfoni

|
3 installs
| (0) | Free
Insert a context-aware, single-keyword comment marker (e.g. CLAUDE:) for your coding agent to pick up.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Agent Comments

Insert a single, context-aware comment marker for your coding agent to pick up — press a key, type your intent, and let the agent find it.

function calculateTotal(items: Item[]) {
  // CLAUDE: add a discount parameter and apply it here
  return items.reduce((sum, item) => sum + item.price, 0);
}

What it does

Pressing the keybinding inserts a comment marker on a new line above the cursor (or replaces the current blank line). The marker keyword is configurable and the comment syntax adapts to where you are:

  • // CLAUDE: in JavaScript / TypeScript / JSON
  • # CLAUDE: in Python, YAML, shell, TOML, Ruby
  • {/* CLAUDE: */} when the cursor sits inside JSX children (and // when it doesn't, even in the same .tsx file)
  • <!-- CLAUDE: --> in HTML / XML / Markdown
  • /* CLAUDE: */ in CSS / SCSS / LESS
  • -- CLAUDE: in SQL / Lua / Haskell

The JSX detection scans backwards from the cursor, counts unclosed tags, stops at statement boundaries, and ignores TypeScript generics like Array<string> — so you get {/* */} only when a comment there is actually valid.

Press the keybinding again on a marker line to toggle it off (remove it).

The keyword is highlighted in open editors so your pending markers are easy to spot.

Comments panel

The Agent Comments icon in the activity bar opens a panel that lists every marker in your workspace, grouped by file. Click a comment to jump to its line. Three buttons sit in the panel header:

  • Copy All — copies the comments to the clipboard as a flat path:line — text list (one per block), ready to paste to your agent:

    src/foo.ts:42 — add a discount parameter and apply it here
    
    src/checkout.ts:88 — handle the empty-cart case
    
  • Clear All — removes every marker. Standalone marker lines are deleted whole; markers trailing real code are stripped, leaving the code intact.

  • Refresh — re-scans on demand (the panel also auto-updates as you edit, save, or add/remove files).

Configuration

Setting Default Description
agentComments.keyword CLAUDE The keyword inserted as the marker. Set it to CODEX, TODO, or anything your agent looks for.

Keybinding

Command Mac Windows / Linux
Agent Comments: Toggle comment marker cmd+shift+i ctrl+shift+i

Active only when the editor has text focus. Rebind it via Preferences: Open Keyboard Shortcuts if it clashes with your setup.

Development

npm install
npm run build      # bundle to out/extension.js
npm run watch      # rebuild on change
npm test           # run the comment-style / JSX-context unit tests
npm run package    # produce a .vsix

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

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