Inline comments for rendered Markdown in VS Code. Select text, add comments, and send feedback to your AI agentβwithout touching the source file.
πΉ Watch Demo Video (downloads when clicked)
Stay in flow while reviewing your Markdown. Commentary brings Google Docs-style commenting to rendered previews in VS Code. Review documentation as readers will see it, annotate without editing source files, and send feedback directly to your AI agent.
Perfect for:
- π Documentation writers reviewing drafts
- βοΈ Technical writers collecting feedback
- π₯ Content reviewers annotating without commits
- π€ AI-assisted workflows with Claude Code, Cursor Agent, Codex, or Gemini
- Text selection β Highlight any text to comment
- Document-level β Comment on entire files
- Floating bubble UI β Google Docs-style comment interface
- Keyboard shortcuts β
βEnter/Ctrl+Enterto save,Escto cancel - Visual highlights β See exactly what's commented
CLI Tools (Send) β Recommended
- Claude Code β Terminal integration, stays open for continued interaction
- Cursor Agent β Terminal integration, stays open for continued interaction
- Codex CLI β Terminal integration with automation mode
- Gemini CLI β Terminal integration with Google's AI
Manual (Copy)
- Claude IDE β Clipboard copy, paste into Claude chat
- Cursor IDE β Clipboard copy, paste into Cursor chat
- VS Code Chat β Clipboard copy, paste into built-in chat
π‘ CLI methods pipe comments to agentic tools that automatically apply edits and stay open for follow-up. Manual methods copy to clipboard for you to pasteβuseful when CLI isn't available.
Render diagrams directly in your Markdown preview:
- Flowcharts β Process flows and decision trees
- Sequence diagrams β API interactions and workflows
- Class diagrams β Architecture documentation
- State diagrams β State machines and transitions
- Pie charts β Data visualization
- And more β Entity relationships, Git graphs, timelines
Diagrams automatically adapt to your VS Code theme (light/dark).
Choose from 20 professional themes:
- Water.css β Modern, clean (light/dark)
- Sakura β Elegant (5 variants)
- Pico CSS β Professional with accents (8 colors, auto light/dark)
- Simple.css β Minimalist (auto light/dark)
- Matcha β Code-focused with syntax highlighting
- LaTeX.css β Academic paper styling
- Tufte CSS β Edward Tufte design principles
- New.css β Modern minimal (4k+ GitHub stars)
Quick switcher: ββ§P β Commentary: Select Theme
- Workspace mode (default) β Comments in VS Code state (git-ignored)
- Sidecar mode β Comments in
.comments/folder (git-tracked, shareable)
Comments survive document edits with 3-layer fallback:
- Exact quote + context (100 chars before/after)
- Character offset for fast recovery
- Nearest heading + fuzzy search
- Install from VS Code Marketplace
- Open any Markdown (
.md) file - Right-click the file in Explorer β "Open with Commentary"
- Select text in the rendered preview β floating comment bubble appears
- Type comment β Press
βEnter(Mac) /Ctrl+Enter(Windows/Linux) to save - View all comments in the Commentary sidebar β
ββ§C/Ctrl+Shift+C
Pro tip: After adding comments, send them to your AI agent! Automatic methods apply edits directly; manual methods copy to clipboard.
ββ§P β Commentary: Configure AI Agent
CLI Tools (Recommended):
- Claude Code β Enter command:
claude(default, installs automatically) - Cursor Agent β Enter path:
cursor-agent(requires installation) - Codex CLI β Enter path:
codex(requires installation) - Gemini CLI β Enter path:
gemini(requires installation)
For Manual Copy-Paste:
- Claude IDE β Choose "Claude" provider (uses clipboard when CLI unavailable)
- Cursor IDE β Choose "Cursor" provider (uses clipboard when CLI unavailable)
- VS Code Chat β Built-in chat (uses clipboard)
Advanced:
- Custom β Your own API endpoint
Install directly from the VS Code Marketplace:
- Open VS Code
- Go to Extensions view (
ββ§X/Ctrl+Shift+X) - Search for "Commentary"
- Click Install
Or install via command line:
code --install-extension jaredhughes.commentarygit clone https://github.com/jaredhughes/commentary
cd commentary
npm install
npm run compilePress F5 in VS Code to launch Extension Development Host.
Text Selection Comments:
- Select any text in the rendered Markdown preview
- A floating comment bubble appears
- Type your comment
- Press
βEnter(Mac) orCtrl+Enter(Windows/Linux) to save - Press
Escto cancel
Document-Level Comments: You can comment on an entire document without selecting text:
- In the preview: Click the note icon button in the top-left corner of the preview
- In the sidebar: Click the note icon in the Commentary sidebar toolbar
- Command Palette: Press
ββ§P(Mac) orCtrl+Shift+P(Windows/Linux), then type "Add Document-Level Comment"
View All Comments:
- Open the Commentary sidebar:
ββ§C/Ctrl+Shift+C - Comments are organized by file
- Click a comment to navigate to its location in the document
Edit a Comment:
- In the sidebar, click the edit icon next to the comment
- Or click the comment text to navigate and edit in the preview
Delete Comments:
- Single comment: Click the trash icon next to the comment in the sidebar
- All comments: Click the trash icon in the sidebar toolbar (with confirmation)
Export/Import:
- Use the export/import commands to backup or share comments as JSON
Commentary supports two types of agent integration: CLI tools (Send) and manual (Copy).
These methods pipe comments to agentic tools via terminal, automatically apply edits to your files, and stay open for follow-up interaction:
- Claude Code β Opens terminal with
claudecommand, session stays open after processing - Cursor Agent β Opens terminal with
cursor-agentcommand, session stays open after processing - Codex CLI β Opens terminal with
codex execcommand for automation mode - Gemini CLI β Opens terminal with
gemini -pcommand for non-interactive prompts
Behavior:
- Comments are piped to the CLI tool via stdin
- Agent reviews the full document context and applies edits automatically
- Sessions stay open for continued conversation and refinement
- Comments are deleted from the sidebar after successful delivery (they've been processed)
These methods copy comments to your clipboard for you to paste manually:
- Claude IDE β Copies to clipboard, paste into Claude chat (fallback when CLI unavailable)
- Cursor IDE β Copies to clipboard, paste into Cursor Composer/Chat (fallback when CLI unavailable)
- VS Code Chat β Copies to clipboard, paste into built-in VS Code Chat
Behavior:
- Comments are formatted and copied to clipboard
- You paste them into your agent's chat interface
- Comments remain in the sidebar for tracking (you manually apply edits)
Send a Single Comment:
- In the sidebar, click the send/copy icon next to any comment
- Icon varies by method: send (CLI providers), copy (clipboard mode)
Send All Comments:
- Click the send/copy icon in the sidebar toolbar
- All comments are sent together with full document context
Which Method is Used?
- Commentary automatically chooses the best available method based on your configuration
- CLI/API methods are preferred (automatic editing)
- Clipboard methods are used as fallback (manual paste required)
{
"commentary.theme.name": "water-dark"
}{
"commentary.storage.mode": "workspace" // or "sidecar"
}{
"commentary.agent.enabled": true,
"commentary.agent.provider": "claude",
"commentary.agent.claudeCliPath": "claude",
"commentary.agent.cursorCliPath": "cursor-agent",
"commentary.agent.cursorInteractive": true,
"commentary.agent.codexCliPath": "codex",
"commentary.agent.geminiCliPath": "gemini",
"commentary.agent.contextLines": 6
}Settings scope: All settings default to global/user but can be overridden per-workspace.
When you send comments to AI CLI tools, those tools need permission to modify files in your workspace. Each tool handles this differently:
| CLI Tool | Permission Model |
|---|---|
| Claude Code | Uses --permission-mode bypassPermissions flag to skip interactive prompts |
| Cursor Agent | Inherits app-level settings (Auto-run, Auto-apply edits) from Cursor |
| Codex CLI | Uses exec subcommand for automation mode |
| Gemini CLI | Uses -p flag for non-interactive prompts |
Best practices:
- Review all changes in git before committing (
git diff) - Use workspace-level git to track and revert unwanted changes
- Consider running in a separate branch for large refactoring tasks
- Keep your AI CLI tools updated for latest security patches
Why this is necessary: CLI tools require non-interactive mode to process comments programmatically. Interactive permission prompts would cause the terminal to hang waiting for input that never comes.
| Command | Action |
|---|---|
Commentary: Configure AI Agent |
Set up Claude, Cursor, Codex, Gemini, or custom |
Commentary: Select Theme |
Choose from 20 themes |
Commentary: Add Document-Level Comment |
Comment on entire file |
Commentary: Send All to Agent |
Batch send all comments |
Commentary: Delete All |
Clear all (with confirmation) |
Commentary: Export / Import |
Backup or share comments |
src/
βββ extension.ts # Activation & provider detection
βββ preview/ # Webview + overlay integration
βββ sidebar/ # Tree view + commands
βββ agent/ # AI provider abstraction
βββ storage/ # Workspace + sidecar persistence
media/
βββ overlay.js # Selection UI + comment bubbles
βββ overlay.css # Visual styles
βββ themes/ # 20 CSS themes (copied from NPM)
Design principles:
- Pure provider logic (no VS Code APIs in core)
- Testable AI integrations (208 passing tests)
- Pluggable storage backends
- Non-destructive annotations
npm install # Install deps + theme packages
npm run compile # Copy themes + compile TypeScript
npm run watch # Auto-recompile on changes
npm test # Run all tests (208 passing)
npm run validate # Lint + type checkPress F5 to launch Extension Development Host with debugger attached.
- β Automated linting, type checking, tests on every PR
- β Pre-push hooks catch issues before pushing
- β Multi-platform testing (macOS, Linux, Windows)
Contributions welcome! Please open an issue first to discuss changes.
Workflow:
- Fork & create feature branch
- Make changes
- Run
npm run validate && npm test - Submit PR
MIT License β Copyright (c) 2025 Jared Hughes
See LICENSE for details.
Themes powered by:
- Water.css (MIT)
- Sakura (MIT)
- Pico CSS (MIT)
- Simple.css (MIT)
- Matcha (MIT)
- LaTeX.css (MIT)
- Tufte CSS (MIT)
- New.css (MIT)
Diagrams powered by:
- Mermaid (MIT)
Special thanks to the VS Code extension API and markdown-it ecosystem.
Inline comments for rendered Markdown, without touching your files.