A self-contained, in-process code analysis engine for VS Code.
CodeGraph Local brings symbol-level code intelligence, a blast-radius-weighted health score, and a deterministic 7-agent remediation swarm directly into your editor sidebar. It is fully standalone. No external server, no network calls, no SQLite database, no LLM API keys. Install it, and it analyzes whatever TypeScript/JavaScript workspace you have open.
| Overview | Network Graph | Agent Swarm |
|---|---|---|
![]() |
![]() |
![]() |
From the Marketplace: search "CodeGraph Local" in the Extensions view (Ctrl+Shift+X / Cmd+Shift+X), or:
code --install-extension codegraph-local.codegraph-localFrom a .vsix (GitHub Releases): download the latest .vsix from Releases, then:
code --install-extension codegraph-local-<version>.vsixOpen the CodeGraph Local icon in the Activity Bar, run CodeGraph Local: Scan Workspace, done.
| Feature | Command / UI |
|---|---|
| Health score (0–100) | Auto-scans on open → Status bar (bottom-left) + Dashboard sidebar |
| Agent swarm (Security, Perf, Refactor, Dead code, Deps, Architecture, Test) | CodeGraph Local: Run Agent Swarm → Problems panel + Dashboard sidebar |
| Interactive network graph | Dashboard sidebar → Network tab (zoom, pan, search-to-focus, hover-to-highlight) |
| Symbol search (ranked by fan-in / connectivity) | CodeGraph Local: Search Symbols |
| Callers / Callees / Impact at cursor | CodeGraph Local: Show Callers/Callees/Impact |
| Graph-RAG context generation | CodeGraph Local: Generate Context for Task |
| Find circular dependencies | CodeGraph Local: Find Circular Dependencies |
| Find dead code (0 callers) | CodeGraph Local: Find Dead Code |
| Generate a verified fix | CodeGraph Local: Generate Verified Fix |
This extension contains its own custom-built analysis engine (src/engine/):
- File Scanner: fast filesystem walker that strictly honors glob excludes (and the workspace's
.gitignore) to skipnode_modulesand build directories. - Symbol Extractor: uses the TypeScript Compiler API to walk the AST, extracting functions, methods, classes, and types, along with all call expressions and import bindings.
- Graph Builder: resolves raw calls across files using a TypeScript NodeNext-compatible module resolver, building a
SymbolGraphwithfanIn/fanOutmetrics. - Health Score: penalizes structural and textual smells (eval, hardcoded secrets, empty catch blocks, missing lockfiles, god files) weighted by their blast radius in the graph.
- Query Engine: deterministic graph traversals (Tarjan SCC for cycles, BFS for impact analysis).
- Agent Orchestrator: runs 7 deterministic specialists over the graph, dedupes findings via a Critic, scores them via a Judge, and assigns P0–P3 priorities.
- Fix Executor: clones the workspace to an OS temp directory sandbox, applies regex-safe line deletions, re-scans the sandbox to verify the health score didn't regress, and generates a unified diff.
npm install
npm run build # tsc typecheck
npm run bundle # esbuild bundle -> bundle/extension.js
npm test # vitest over the engine logic
npm run lintPress F5 in VS Code to launch the Extension Development Host.
- TS/JS only: The engine is tightly bound to the TypeScript compiler API for accurate call extraction.
- Single-root workspaces: The extension operates against
workspaceFolders[0]. - Heuristic resolution: Call resolution does not run a full TypeScript typechecker program (which would be too slow for large workspaces). It relies on name-based matching through import bindings — a deliberate speed/precision tradeoff.
- Symbol at cursor is a heuristic: The AST extractor records line numbers but not column spans; "Show Callers at Cursor" picks the smallest symbol range enclosing the cursor line.
Apache License 2.0 — see LICENSE.


