[trace-mcp]

Repomix vs codegraph

TL;DR. Repomix and codegraph are both answers to “my agent does not know my codebase”, and they are opposite answers. Repomix packs: it concatenates the repository into one consolidated file the model reads. codegraph indexes: it parses the repository into a symbol and call graph in SQLite the agent queries. Repomix hands over content. codegraph answers questions about structure.

Pick Repomix when the repository is small enough to hand over whole, or when it is somebody else’s and you want to look at it once. Pick codegraph when the agent will spend many turns in a repository too large to hand over at all.

Everything below was verified against both projects’ public README and docs on September 2, 2026. We build trace-mcp, which is in the same lane as codegraph; the last section says plainly where we differ and where each of these beats us.

Head-to-head

  Repomix codegraph
GitHub stars 28.1K 69.2K
License MIT MIT
Model one-shot pack live index (SQLite)
What the agent receives file content resolved symbols, call paths, blast radius
Parses code ✓ tree-sitter, --compress only (experimental) ✓ tree-sitter, always
Languages not enumerated for --compress; 19 for comment stripping 34
Cross-file dependency edges
Call graph ✓ including dynamic-dispatch hops
Impact analysis ✓ blast radius inline in explore
Framework-aware route edges ✓ 15 route-shape families
Navigation (navigates) edges ✓ 7 routers (Next.js, Expo, React Router, TanStack, Vue/Nuxt, SvelteKit)
Cross-language bridging ✓ Swift ↔ Obj-C, React Native bridge, Expo, Fabric
Search ✓ regex over the pack (grep_repomix_output) ✓ graph query
Remote repositories --remote owner/name ✗ index a local checkout
Freshness --watch, 300 ms debounce, full re-pack, local dirs only auto-sync per file + staleness banner on pending files
MCP server --mcp, 5 tools (+2 in --sandbox) 1 advertised tool, 7 more behind an env allowlist
Refactoring / write path
Security scanning ✓ Secretlint (secrets only)
Published A/B benchmark ✗ token counting, no A/B ✓ 7 repos, model/queries/run count disclosed
Runs local, no API key

Sources: Repomix’s README and CLI reference; codegraph’s README at the main head, and its source at commit b9ca4b79 for the tool-surface row. Star counts read from the GitHub API the same day — they move fast in this space, so treat them as a snapshot rather than a ranking.

When to pick Repomix

When to pick codegraph

Where each of them is honestly weak

Repomix cannot compute anything. Its --compress mode is tree-sitter, and it is genuinely good at what it does — signatures kept, bodies dropped, roughly 70% of the bytes gone — but it is lossy summarisation per file. There is no cross-file edge in a pack, at any compression level, and no amount of grep over one recovers a call graph.

codegraph leaves more context resident, and says so. Its README reports that across the same seven repositories, its responses leave about 80% more retrieval context in the window at the end of a multi-turn session than a file-reading agent’s do — 67K tokens against 18K on VS Code. Fewer tokens processed and a larger persistent footprint are both true at once. Publishing that is a point in its favour, and it is a real cost in a small context window.

Neither one writes code. No rename across files, no move, no signature change, no codemod. Both are read paths.

Neither benchmark is third-party. codegraph’s is self-run — well documented, with the model, the queries, four runs per arm and a disclosed correction to its own earlier harness, but self-run. Repomix publishes token counts, not an A/B at all.

Where trace-mcp fits

We are in codegraph’s lane, not Repomix’s, and it would be dishonest to pretend the comparison flatters us on every axis.

trace-mcp is a precomputed graph like codegraph’s, with two differences that matter and one that costs us. It ships 87 framework integrations that model edges beyond routing — controller → template, model → table, component → component — across 81 languages. And it has a write path: rename, move, signature change, AST codemod, dead-code removal, plus OWASP taint scanning and SARIF for CI, none of which either tool above has.

What it costs: our default preset advertises 28 tools at roughly 11.6K tokens, against codegraph’s one tool at ~1.9K. That gap is the honest reason to pick codegraph if orientation is the whole job. It is real money paid every session, and what it buys is the write path above plus everything outside the preset one load_tools call away.

On measurement we can offer one thing neither of them does: the PR review context benchmark is a median 90.6% input-token reduction over 60 merged pull requests in 6 open-source repositories nobody here maintains, with the base and head SHAs, the losing cases, and the command that re-runs it all shipped in the repository.

Head-to-head, one at a time: trace-mcp vs Repomix · trace-mcp vs codegraph.

FAQ

What is the difference between Repomix and codegraph? Repomix packs a repository into one file a model reads. codegraph parses it into a symbol and call graph an agent queries. Content versus computed structure — that one difference explains almost every other row above.

Is Repomix or codegraph cheaper in tokens? It depends on session length. A pack is a fixed up-front cost, re-paid on every repack; --compress cuts roughly 70% of it. codegraph advertises one tool at ~1.9K tokens and charges per query, and reports 62% fewer tokens and 44% lower cost than a file-reading agent across seven repositories. One question, small repo: Repomix. Long session, large repo: codegraph.

Do they both stay up to date as I edit? Both watch, but refresh different things. Repomix’s --watch re-packs the whole output after a 300 ms debounce and works on local directories only. codegraph syncs the graph per changed file and flags pending files in the response so the agent reads them directly.

Can Repomix answer “who calls this function”? Not as a computed answer. grep_repomix_output runs a JavaScript regex over the packed text, so it finds the string — not the call. It cannot tell a call from a comment, follow a re-export, or resolve dynamic dispatch.

Can I use both? Yes. Repomix for a remote repository you want to look at once; codegraph for the one you work in daily. No overlap, no API key on either side.

Next steps

Last updated: September 2, 2026