CodeGraph — VS Code Extension
Anti-hallucination context engine for AI coding agents.
CodeGraph indexes your codebase locally using embeddings and AST parsing, then exposes it as an MCP server so AI tools (Copilot, Claude, etc.) get accurate, grounded context rather than hallucinated code.
Features
Semantic Search (Ctrl+Shift+H)
Type a natural-language query and get ranked code results from your entire codebase — powered by local embeddings (no data leaves your machine).
CodeLens (GitLens-style)
See Search references and Find related code actions above every function, class, and method.
TODO / FIXME Tree
Sidebar panel scans for TODO, FIXME, HACK, BUG, NOTE, XXX comments and shows them in a priority-sorted tree.
Hover Context
Hover over any symbol to see related code snippets from other files with similarity scores.
Index Status
Live status bar showing indexing progress, chunk count, cache hit rate, and embedding metrics.
Integrations
- Jira — query issues by JQL, assignee, or status
- Slack — search messages across channels
- GitHub — query issues, PRs, and repo info
- Git log — commit history with optional file filter
Quick Start
- Install the extension
- Open a workspace — indexing starts automatically
- Press
Ctrl+Shift+H to search your codebase semantically
- Click the CodeGraph icon in the activity bar to see index status and TODOs
Commands
| Command |
Keybinding |
Description |
CodeGraph: Semantic Search |
Ctrl+Shift+H |
Open semantic search picker |
CodeGraph: Re-index Workspace |
— |
Clear index and rebuild |
CodeGraph: Show Status |
— |
Show detailed status in output |
CodeGraph: Toggle CodeLens |
— |
Enable/disable CodeLens annotations |
CodeGraph: Refresh Explorer |
— |
Refresh the sidebar tree view |
CodeGraph: Configure Jira |
— |
Open Jira settings |
CodeGraph: Configure Slack |
— |
Open Slack settings |
CodeGraph: Configure GitHub |
— |
Open GitHub settings |
Settings
| Setting |
Default |
Description |
codegraph.codeLens.enabled |
true |
Show CodeLens above functions/classes |
codegraph.hover.enabled |
true |
Show related code on hover |
codegraph.todos.tags |
["TODO","FIXME","HACK","BUG","NOTE","XXX"] |
Tags to scan |
codegraph.indexing.maxFileSize |
1048576 |
Max file size (bytes) |
codegraph.indexing.excludePatterns |
[] |
Glob patterns to exclude |
codegraph.jira.baseUrl |
— |
Jira instance URL |
codegraph.slack.botToken |
— |
Slack Bot OAuth Token |
codegraph.github.token |
— |
GitHub PAT |
Requirements
- VS Code 1.99+
- Node.js 18+
codegraph-mcp server (npm install codegraph-mcp)
How It Works
- On activation, the extension spawns the
codegraph-mcp server as a child process
- The server indexes all files using AST chunking (Tree-sitter) and generates 384-dim embeddings locally
- Searches use hybrid Reciprocal Rank Fusion merging semantic (cosine similarity) + keyword (SQL LIKE) results
- All data stays local — no API calls for indexing or search
License
MIT — see LICENSE