CodeGraph is where TokenSave came from — TokenSave began life as a ground-up Rust rewrite of it. Since then CodeGraph has itself moved to a Rust kernel and bundles its own runtime, which retires the single biggest claim TokenSave used to make against it. They have converged on architecture and diverged hard on philosophy.
TokenSave v7.12.1 · CodeGraph v1.6.0 (npm, Sep 2026)node_modules and
WASM. That is no longer true. CodeGraph now ships a Rust kernel for parsing and extraction and
bundles its own runtime — "nothing to compile, no native build, works the same everywhere." On the
zero-dependency axis the two tools are now equals, and any page here claiming otherwise is out of date.
Credit where it is owed: CodeGraph pioneered this approach and TokenSave exists because of it. What follows is a comparison between two tools that now agree on how to ship and disagree on what to expose.
| Dimension | TokenSave | CodeGraph |
|---|---|---|
| Origin | Rust rewrite of CodeGraph, diverged since | The original |
| Implementation | Rust, single static binary | Rust kernel + TS tooling, bundled runtime |
| Runtime deps | None | None — bundles its own |
| License | MIT | MIT |
| MCP tools | 87 | 1 primary (codegraph_explore), others unlisted |
| Languages | 60 across 3 build tiers | 30+ |
| Tool philosophy | Many specialised tools, agent composes them | One tool that answers everything |
| Semantic search | Keyword expansion over FTS5, zero-cost | Local embeddings (ONNX) |
| Freshness | On demand — staleness check per call, work follows queries | Native OS file watcher — work follows saves |
| Multi-branch | Per-branch graphs, cross-branch diff | No |
| Edit primitives | 4 atomic writers, re-index in place | No |
| Health analytics | Composite score, Gini, DSM, test-risk | No |
| Agent integrations | 12+, native config per agent | Claude Code |
| Visualizer | Removed in v4.0.1 | Yes |
CodeGraph embeds a native OS watcher — FSEvents, inotify, ReadDirectoryChangesW — debounced to a short quiet window, so the index tracks the filesystem continuously. That sounds strictly better than TokenSave's on-demand staleness check. It is not, and the reason is worth stating plainly.
A watcher does work proportional to edits. An on-demand check does work proportional to
queries. Those are very different quantities. An agent mid-refactor writes files in bursts —
and so does cargo build, npm install, a branch switch, a rebase, a code
formatter. A watcher wakes up and re-indexes for every one of them. Why keep the graph fresh for a
save that nothing is ever going to query? Most of that work is speculative, and most speculation is
wasted.
The on-demand model inverts it: the index is brought up to date at the top of a tool call, when something is actually about to read it, with a short cooldown so a burst of calls does not re-check repeatedly. The sync itself is incremental — hash and mtime pre-filter, only changed files re-parsed — so the check is cheap precisely because the work was never deferred into a pile. You pay for freshness at the moment freshness has a consumer.
This is not a theoretical preference. TokenSave shipped a watcher in 6.0.0 and removed it in
6.1.1. On large monorepos it registered OS-level watches on nested node_modules,
target and dist trees that the top-level ignore filter missed, producing event
storms and unbounded memory growth — one report reached 19 GB. Removing it also dropped a dependency
and a long-lived background thread from the process. The feature was tried, measured, and deleted.
codegraph_explore as its single listed tool: ask a structural question, get source, call paths and blast radius in one call. TokenSave's 87 definitions cost tokens on every request and give the model more ways to choose wrong. This is the strongest argument against TokenSave's whole design, and it comes from the project TokenSave forked from.you want the minimal surface: one tool, one call, an answer — and you value embedding-based recall over breadth. If you only use Claude Code and want the smallest thing that works, this is a very defensible choice.
you want the graph to answer specific structural questions rather than one general one, you work across branches or worktrees, you want the agent to edit as well as read, or you need code-health metrics and broad agent support.
Every TokenSave figure on this page was verified against the source at origin/master
(v7.12.1), not taken from its own README:
test_tool_definitions_complete in src/mcp/tools/handlers/mod.rs; 86 when the optional ast-grep binary is absent from PATH.[features] tiers in Cargo.toml: 11 lite, 9 medium, 40 full. The README's "50+" is conservative.real time for a complete tokensave status invocation, best of repeated runs on an Apple Silicon Mac. Your hardware and repo size will differ.otool -L on the released binary; system frameworks only.@colbymchenry/codegraph v1.6.0 metadata and the project README, September 2026. The Rust-kernel and bundled-runtime claims are CodeGraph's own and were not independently benchmarked here.