agentleFS
nikolai-vysotskyinikolai-vysotskyi/trace-mcp/docs/llms-full.txt

trace-mcp

llms.txt185 starsChanged 3 months agoMITView on GitHub

{%- comment -%} GENERATED by scripts/gen-llms-full.mjs — do not edit by hand. Edit the docs page. {%- endcomment -%} # trace-mcp — Full documentation Concatenated full text of all trace-mcp docs pages, for AI systems that ingest one file instead of following links. See /llms.txt for the linked index. Source: https://trace-mcp.com/code-graph-mcp.html A code graph MCP server indexes a codebase into a structured knowledge graph — symbols, definitions, call hierarchies, imports, and framework routes — and serves targeted slices to AI…

  • Reads credentials
  • Installs packages

The file

We split this llms-full.txt into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every turn in an agentic coding session pays for the entire preceding conversation history.

    line 32
  2. Very specific:

    Every session is attached to one project, but these two tools reach across to any OTHER project already registered with trace-mcp …

    line 213
  3. Distinctive:

    Not an MCP tool — a CLI command for CI pipelines:

    line 262
  4. Very specific:

    Every tool the server registers, alphabetically, with the first line of the description a client receives in tools/list.

    line 433
  5. Very specific:

    Every session pays for its startup block before you type anything — the harness system prompt, tool schemas, every MCP server's …

    line 688
  6. Distinctive:

    Every recommendation rests on evidence of non-use over a stated window, never on size.

    line 709
  7. Very specific:

    When trace-mcp is not reachable, the guard stops routing: No heartbeat, a stale one, a stalled channel: every navigation-cost branch — …

    line 739

≈ “Common” is an estimate: at least 1 in 5 of the 1,484 llms.txt files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
llms-full.txt
---
# Front matter only so Jekyll renders the {{ site.data.counts.* }} tags below
# (TRA-263). Stripped from the served file.
layout: null
---
{%- comment -%}
GENERATED by scripts/gen-llms-full.mjs — do not edit by hand. Edit the docs page.
{%- endcomment -%}
# trace-mcp — Full documentation

> Concatenated full text of all trace-mcp docs pages, for AI systems that ingest one file instead of following links. See /llms.txt for the linked index.

---

# Code graph MCP server for AI coding agents

Source: https://trace-mcp.com/code-graph-mcp.html



A **code graph MCP server** indexes a codebase into a structured knowledge graph — symbols, definitions, call hierarchies, imports, and framework routes — and serves targeted slices to AI coding agents over the [Model Context Protocol](https://modelcontextprotocol.io/).

Without a code graph, an AI agent running in Claude Code, Cursor, Codex, or Windsurf relies on `grep`, `find`, and repeated file reads. Every turn pulls thousands of lines of source code into the prompt window. A code graph server changes that relationship: the repository is indexed once locally, and the agent queries precise relationships instead of re-reading raw files.

```
Without code graph:  Prompt -> grep / read_file -> 10,000+ raw tokens loaded per turn
With code graph:     Prompt -> graph query     -> exact subgraphs (definitions, callers, routes)
```

## Why AI agents need persistent graph context

Every turn in an agentic coding session pays for the entire preceding conversation history. When an agent opens files to locate a function or trace an import, those lines remain in the prompt context until the session ends.

A persistent code graph replaces file scans with graph queries:

1. **Cost scales with the answer, not the repository.** Reading files scales with the size of the repository. Graph queries (`find_symbol`, `find_usages`, `get_change_impact`) scale with the size of the returned subgraph.
2. **Measured context reduction.** In real benchmarks, graph-assembled context reduces input token usage by a median **{{ site.data.pr_context_bench.median_savings_pct }}%** to assemble pull-request review context across {{ site.data.pr_context_bench.pr_count }} open-source pull requests in {{ site.data.pr_context_bench.repo_count }} repositories ([read the PR context benchmark](/pr-context-benchmark.html), or explore [7 tactics to cut Claude Code token usage](/reduce-claude-code-token-usage.html)). Blind evaluation confirms comprehension at parity: {{ site.data.pr_context_quality.trace_understood }} understood rate against naive file loading's {{ site.data.pr_context_quality.baseline_understood }} (at {{ site.data.pr_context_quality.trace_false_positives }} vs {{ site.data.pr_context_quality.baseline_false_positives }} false positives per PR; see [quality preregistration](/perf/prereg-pr-quality/)).
3. **Freshness without rebuilds.** File watchers detect edits with a 300 ms debounce, re-parsing only changed files and updating edge tables in an embedded SQLite database.

## How trace-mcp implements the code graph

trace-mcp is a local-first code graph MCP server built around four architectural choices:

* **Polyglot tree-sitter parsing:** Parsers for {{ site.data.counts.languages }} programming languages compile into the binary, resolving symbols, classes, functions, and import chains without requiring language servers or build toolchains ([view language matrix](/language-matrix.html)).
* **Framework-aware semantic edges:** Web applications do not live in isolated ASTs. trace-mcp resolves route-to-controller, controller-to-template, and model-to-table relationships across {{ site.data.counts.frameworks }} frameworks, including Laravel, Next.js, Django, Rails, Spring, and FastAPI ([supported frameworks](/supported-frameworks.html)).
* **Zero-overhead local storage:** All graph nodes, edges, and FTS5 search indices live in an embedded SQLite database on your machine. For how resident memory and caches are capped, see [daemon memory](/daemon-memory.html). No hosted services, no background daemons requiring cloud accounts, and your source code never leaves your machine ([local privacy guarantee](/privacy.html)).
* **Controlled schema footprint:** An MCP server that advertises dozens of tools consumes thousands of tokens before the agent asks its first question. trace-mcp uses role presets to expose roughly 2K tokens of tool schemas on session start, while keeping extended tools accessible dynamically via `load_tools` ([tools reference](/tools-reference.html), [tool index](/tools-index.html)).

## The code graph MCP ecosystem

Different tools approach codebase context from distinct angles:

| Approach | Representative project | Mechanism | Trade-off |
|---|---|---|---|
| **Prompt packing** | [Repomix](https://github.com/yamadashy/repomix) | Concatenates repository source into a single compressed prompt artifact. | Fast setup, but computes no edges and repays full file costs on every turn. [trace-mcp vs Repomix](/vs/repomix.html) |
| **LSP proxy** | [Serena](https://github.com/oraios/serena) | Bridges IDE language servers directly into MCP tool calls. | Compiler-grade type precision, but requires active language toolchains and maintains no persistent graph. [trace-mcp vs Serena](/vs/serena.html) |
| **Single-tool graph** | [codegraph](https://github.com/colbymchenry/codegraph) | Exposes a single `explore` tool by default to minimize advertised schema tokens. | Low schema token cost, but navigation only — no write path or framework edges. [trace-mcp vs codegraph](/vs/codegraph.html) |
| **Broad grammar graph** | [codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) | Compiles 162 vendored grammars into an incremental graph. | Broad syntax support, but no framework routing or refactoring operations. [trace-mcp vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) |
| **SCIP-driven graph** | [CodeGraphContext](https://github.com/CodeGraphContext/CodeGraphContext) | Orchestrates eleven external Sourcegraph SCIP indexers into graph snapshots. | External indexer pipelines, but requires external binaries and complex backend choices. [trace-mcp vs CodeGraphContext](/vs/codegraphcontext.html) |
| **Review graph** | [code-review-graph](https://github.com/code-review-graph/code-review-graph) | Tracks incremental changes with empty-result uncertainty explanations. | Specialised for review navigation, but advertises 29 tools without preset filtering. [trace-mcp vs code-review-graph](/vs/code-review-graph.html) |
| **Hybrid vector-AST graph** | [SocratiCode](https://github.com/giancarloerra/SocratiCode) | Combines Qdrant vector embeddings with ast-grep in Docker. | Semantic vector search, but requires Docker runtime and lacks framework routing. [trace-mcp vs SocratiCode](/vs/socraticode.html) |
| **Meta-dispatch graph** | [jCodeMunch](https://github.com/johann-petrak/jCodeMunch) | Fronts 90+ Python tools through "The Counter" meta-dispatch (`order`, `menu`, `route`). | Dual-Use license (non-commercial only) and regex route detection. [trace-mcp vs jCodeMunch](/vs/jcodemunch.html) |
| **Native Rust libSQL graph** | [TokenSave](https://github.com/aovestdipaperino/tokensave) | Native Rust binary with libSQL storage, multi-branch indexing, and subprocess isolation. | Advertises 85+ tools by default (~12-15K schema tokens) with no framework routing. [trace-mcp vs TokenSave](/vs/tokensave.html) |
| **Runtime buffer truncation** | [Context Mode](https://github.com/pashpashpash/context-mode) | Intercepts and truncates CLI execution buffers before prompt injection. | Focuses on runtime stdout/stderr pruning; maintains no persistent semantic code graph. [trace-mcp vs Context Mode](/vs/context-mode.html) |
| **Knowledge graph Cypher** | [GitNexus](https://github.com/abhigyanpatwari/GitNexus) | Constructs code knowledge graph in embedded Kuzu graph DB querying via raw Cypher strings. | Non-commercial PolyForm license, requires local C++ toolchain build, and exposes unvalidated Cypher queries. [trace-mcp vs GitNexus](/vs/gitnexus.html) |
| **LLM concept summaries** | [Graft](https://github.com/trailhq/Graft) | Generates plain-language subsystem and concept explanations in markdown files via LLM. | Requires external LLM API keys and model calls for all node generation; no relational graph traversal. |
| **RDF multi-layer CCG** | [Narsil-MCP](https://github.com/postrv/narsil-mcp) | Emits 4-layer progressive disclosure Code Context Graph (CCG) datasets in RDF/N-Quads. | Advertises ~90 tools without role presets; complex semantic web RDF formats rather than lightweight JSON. |
| **Packing vs indexing** | [Repomix vs codegraph](/vs/repomix-vs-codegraph.html) | Side-by-side comparison of full-file prompt packing against single-tool graph exploration. | Evaluates static context serialization against interactive graph queries. [Repomix vs codegraph](/vs/repomix-vs-codegraph.html) |

For a comprehensive feature-by-feature breakdown across 20+ tools, see the [code graph comparisons hub](/comparisons.html).

## Getting started

Install trace-mcp in your project root:

```bash
npx trace-mcp init
```

The init command inspects your repository, detects your frameworks and languages, sets up client configurations for Claude Code, Cursor, or Windsurf, and indexes your codebase into a local `.trace/` database. See [what trace init installs](/what-trace-init-installs.html) for a complete breakdown of guard hooks, routing blocks, and client configurations written to your project.

* Explore all available tools: [Tools Reference](/tools-reference.html) and the alphabetical [Tool Index](/tools-index.html)
* Review configuration and preset options: [Configuration Guide](/configuration.html)
* Inspect architecture and storage contracts: [Architecture Documentation](/architecture.html)

---

# Tools reference

Source: https://trace-mcp.com/tools-reference.html


trace-mcp exposes {{ site.data.counts.tools }} MCP tools and {{ site.data.counts.resources }} resources.

This page groups the ones you reach for by hand. For how a persistent
[code graph MCP server](/code-graph-mcp.html) powers these operations to cut
agent token costs, see the category overview. For the complete list —
every registered tool with its one-line description, generated from the
registrations themselves — see the [tool index](tools-index.md). For measured
wire costs and baseline token comparisons across each tool, see the
[tool response token cost](/perf/response-tokens/) benchmark.

Tools are registered dynamically based on detected frameworks — you only see tools relevant to your project.

---

## Project

| Tool | What it does |
|---|---|
| `get_project_map` | Project overview — detected frameworks, directory structure, entry points |
| `get_index_health` | Index stats — file count, symbol count, edge count, errors |
| `reindex` | Trigger full or incremental re-indexing |
| `get_env_vars` | List environment variable keys from `.env` files with inferred value types |
| `get_plugin_registry` | List registered indexer plugins and edge types (opt-in full edge-type catalog via include_edge_types) |

> [!NOTE]
> **Migration note (TRA-1159): `get_plugin_registry`**
> `get_plugin_registry` previously emitted all 193 static edge types unconditionally on every call (~10k tokens). Starting in v3.23.3, individual `edge_types` are omitted by default and replaced with `edge_type_categories` (counts per category) and `edge_types_total`. Clients requiring the full list of edge types (array of objects with `name`, `category`, and `description`) should pass `include_edge_types: true`.

## Navigation

| Tool | What it does |
|---|---|
| `search` | Full-text search (FTS5 + BM25) with kind / language / file pattern filters |
| `get_symbol` | Look up a symbol by ID or FQN — returns source code |
| `get_outline` | All symbols in a file — signatures only, no bodies |
| `find_usages` | Find all places that reference a symbol or file (imports, calls, renders, dispatches) |

## Framework intelligence

| Tool | What it does | When available |
|---|---|---|
| `get_component_tree` | Build component render tree from a root file | Vue, Nuxt, Inertia |
| `get_change_impact` | Reverse dependency graph — what depends on this file or symbol. Each dependent symbol includes `hasTestReach` (whether any test that covers the file also references that specific symbol) | Always |
| `get_task_context` | **Graph-aware context engine** — describe a dev task, get the optimal code subgraph (execution paths, tests, types) adapted to task type (bugfix/feature/refactor) | Always |
| `get_feature_context` | NLP-driven context assembly — describe a feature, get relevant code within a token budget | Always |
| `get_request_flow` | Trace request flow for a URL+method: route → middleware → controller → service | Express, NestJS, Laravel, FastAPI, Flask, DRF, Spring, Rails, Fastify, Hono, tRPC |
| `get_middleware_chain` | Trace middleware chain for a route URL | Express, NestJS, FastAPI, Flask |
| `get_event_graph` | Event/signal/task dispatch graph | Laravel, NestJS, Django, Celery, Socket.io |
| `get_model_context` | Full model context: relationships, schema, metadata | Eloquent, Prisma, TypeORM, Drizzle, Mongoose, Sequelize, SQLAlchemy |
| `get_schema` | Database schema reconstructed from migrations or ORM definitions | Eloquent, Prisma, TypeORM, Drizzle, Mongoose, Sequelize, SQLAlchemy |
| `get_livewire_context` | Full Livewire component context: properties, actions, events, view, children | Laravel |
| `get_nova_resource` | Full Laravel Nova resource context: model, fields, actions, filters, lenses, metrics | Laravel |
| `get_state_stores` | List stores/slices with state, actions, and dispatch sites | Zustand, Redux |

## NestJS

| Tool | What it does |
|---|---|
| `get_module_graph` | Build module dependency graph (modules → imports → controllers → providers → exports) |
| `get_di_tree` | Trace dependency injection tree (what a service injects + who injects it) |

## React Native

| Tool | What it does |
|---|---|
| `get_navigation_graph` | Build navigation tree from screens, navigators, and deep links |
| `get_screen_context` | Full screen context: navigator, navigation edges, deep link, platform variants, native modules |

## Code analysis

| Tool | What it does |
|---|---|
| `get_import_graph` | File-level dependency graph: what a file imports and what imports it |
| `get_call_graph` | Bidirectional call graph centered on a symbol (who it calls + who calls it) |
| `get_tests_for` | Find test files and test functions that cover a given symbol or file |
| `get_implementations` | Find all classes that implement or extend a given interface/base class |
| `get_type_hierarchy` | Walk TypeScript class/interface hierarchy: ancestors and descendants |
| `get_api_surface` | List all exported symbols (public API) of a file or matching files |
| `get_untested_symbols` | Find ALL symbols (not just exports) lacking test coverage. Returns the "unreached" tier (no test imports the source) by default; `level: "imported_not_called"` / `"all"` opt into the weaker tier, where transitively-exercised symbols also land. Pass `scope: "exports_only"` for the fast exports-only scan |
| `self_audit` | One-shot project health: dead exports, untested code, dependency hotspots, heritage metrics |

## Quality & security

| Tool | What it does |
|---|---|
| `scan_security` | OWASP Top-10 vulnerability scan: SQL injection, XSS, command injection, path traversal, hardcoded secrets, insecure crypto, open redirects, SSRF |
| `taint_analysis` | Track untrusted data from sources (HTTP params, env vars, file reads) to dangerous sinks (SQL, exec, innerHTML). Framework-aware, cross-file |
| `scan_code_smells` | Find TODO/FIXME/HACK comments, empty functions, hardcoded values, magic numbers |
| `detect_antipatterns` | Performance antipattern detection |
| `check_quality_gates` | Quality gate validation against configurable thresholds |
| `export_security_context` | Export security context for MCP server analysis — enrichment JSON for [skill-scan](https://github.com/kkdub/skill-scan): tool registrations with annotations, transitive call graphs classified by security category, sensitive data flows, capability maps |

## Topology & subprojects

Enabled by default (`topology.enabled: true`). See [Configuration](configuration.md#topology--subprojects).

### Service topology

| Tool | What it does |
|---|---|
| `get_service_map` | Map of all services, their APIs, and inter-service dependencies (auto-detects from Docker Compose) |
| `get_cross_service_impact` | Impact of changing an endpoint or event — which services are affected |
| `get_api_contract` | API contract (OpenAPI/gRPC/GraphQL) for a service |
| `get_service_deps` | External service dependencies: outgoing and incoming |
| `get_contract_drift` | Mismatches between API spec and implementation |

### Subprojects

A subproject is any working repository that is part of your project's ecosystem: microservices, frontends, backends, shared libraries, CLI tools, etc. A project auto-detects its subprojects on indexing, or you can add external ones manually.

| Tool | What it does |
|---|---|
| `get_subproject_graph` | All subprojects, cross-subproject connections, and stats |
| `get_subproject_impact` | Cross-subproject impact: find all client code that would break if an endpoint changes. Resolves to symbol level when per-subproject indexes exist |
| `get_subproject_clients` | Find all client calls across subprojects that call a specific endpoint |
| `subproject_add_repo` | Add a subproject, bound to the current project (or specify `project` param for external subprojects) |
| `subproject_sync` | Re-scan all subprojects: contracts, client calls, and re-link |

### Cross-project

Every session is attached to one project, but these two tools reach across to any OTHER project already registered with trace-mcp (`~/.trace/registry.json`) — see [Configuration](configuration.md#cross-project-tools).

| Tool | What it does |
|---|---|
| `list_projects` | List registered project roots (name, type, last-indexed), plus known subprojects |
| `call_project_tool` | Run any other trace-mcp tool against a DIFFERENT registered project's already-indexed data; returns that tool's response verbatim |

## Decision memory

See [Decision memory](decision-memory.md) for full documentation.

| Tool | What it does |
|---|---|
| `mine_sessions` | Extract decisions from Claude Code / Claw Code session logs (pattern-based, 0 LLM calls) |
| `add_decision` | Manually record a decision with code linkage + service scoping |
| `query_decisions` | Query by type/service/symbol/file/tag + FTS5 search + temporal filtering |
| `invalidate_decision` | Mark a decision as superseded (preserved for historical queries) |
| `get_decision_timeline` | Chronological history of decisions for a project/symbol/file |
| `get_decision_stats` | Knowledge graph overview: counts by type, source, sessions mined/indexed |
| `index_sessions` | Index conversation content for cross-session search |
| `search_sessions` | FTS5 search across all past session conversations |
| `get_wake_up` | Compact orientation (~300 tokens): project + active decisions + stats. Auto-mines on first call |

Decisions auto-enrich code intelligence: `get_change_impact` shows `linked_decisions`, `plan_turn` shows `related_decisions`, `get_wake_up` shows `active_decisions`.

## Session Analytics

See [Analytics](analytics.md) for full documentation. Those tools read session
logs after the fact; for a live span per tool call exported to your own Jaeger
or Langfuse, see [MCP tracing](telemetry.md).

| Tool | What it does |
|---|---|
| `get_session_analytics` | Token usage, cost breakdown by tool/server, top files, models used |
| `get_optimization_report` | Detect token waste patterns (8 rules) with savings estimates |
| `get_real_savings` | Analyze actual sessions: how much trace-mcp saves vs raw file reads |
| `benchmark_project` | Synthetic benchmark: raw reads vs trace-mcp compact responses (5 scenarios) |
| `get_coverage_report` | Technology profile: deps from manifests, coverage by trace-mcp plugins, gaps |
| `get_startup_context_audit` | What every session pays for before the first message, by source, what it costs, what the logs prove went unused, and where it says the same thing twice |
| `apply_startup_recommendations` | Apply (or preview) a `get_startup_context_audit` recommendation, backed up first |
| `rollback_startup_recommendations` | Undo one `apply_startup_recommendations` call, byte-for-byte, in one action |
| `get_usage_trends` | Daily token usage trends over time |
| `get_session_stats` | Real-time token savings for the current session |
| `audit_config` | Audit AI agent config files for stale refs, dead paths, bloat, scope leaks |

Supports **Claude Code** and **Claw Code** session logs (auto-detected).

## CI/PR reports (CLI)

Not an MCP tool — a CLI command for CI pipelines:

```bash
trace-mcp ci-report --base main --head HEAD --format markdown --output report.md
trace-mcp ci-report --base main --head HEAD --fail-on high
```

Generates a change impact report with blast radius, risk scores, test coverage gaps, architecture violations, and dead code. See [README](https://github.com/nikolai-vysotskyi/trace-mcp/blob/master/README.md#cipr-change-impact-reports) for GitHub Action setup.

## Security context export (CLI)

Export security context for MCP server analysis — generates enrichment JSON for [skill-scan](https://github.com/kkdub/skill-scan):

```bash
# Export to file
trace-mcp export-security-context -o enrichment.json

# Limit scope and call graph depth
trace-mcp export-security-context --scope src/tools --depth 4

# Re-index before export
trace-mcp export-security-context --index -o enrichment.json

# Use with skill-scan
trace-mcp export-security-context -o ctx.json && skill-scan scan . --enrich ctx.json
```

Output contains: MCP tool registrations with annotations, transitive call graphs classified by security category (`file_read`, `file_write`, `network_outbound`, `env_read`, `shell_exec`, `crypto`, `serialization`), sensitive data flows, and per-file capability maps.

## AI-powered (optional)

Requires `ai.enabled: true` in config. See [Configuration](configuration.md#ai-configuration).

| Tool | What it does |
|---|---|
| `explain_symbol` | AI-generated explanation of a symbol's purpose and behavior |
| `suggest_tests` | AI-generated test case suggestions for a symbol |
| `review_change` | AI-powered review of a file change |
| `find_similar` | Find semantically similar symbols using vector search + AI reranking |
| `explain_architecture` | AI-powered architecture analysis of a module or feature area |

---

## Resources

| Resource | URI | Description |
|---|---|---|
| Project map | `project://map` | JSON project overview |
| Index health | `project://health` | Index status |

---

## Usage examples

| Scenario | Tool to use |
|---|---|
| "Add a new field to the User model" | `get_change_impact` — shows all dependents: model, migration, request validation, Vue props |
| "What components does this page use?" | `get_component_tree` — full render tree with props/slots |
| "Refactor the auth flow" | `get_task_context("refactor the auth flow")` — intent-aware context with full execution paths |
| "Quick keyword context" | `get_feature_context("authentication")` — assembles relevant code in one call |
| "Does the Vue page match the controller response?" | Prop mismatch detection flags drift automatically at index time |
| "What's the DB schema?" | `get_schema` — reconstructed from migrations, no DB needed |
| "Trace a request end-to-end" | `get_request_flow("/api/users", "GET")` — full chain |
| "What NestJS modules does this depend on?" | `get_module_graph` — full dependency tree |
| "Find untested code" | `get_untested_symbols` — deep analysis with "unreached"/"imported_not_called" classification. Or lighter: `get_untested_symbols { scope: "exports_only" }` + `self_audit` |
| "Explain this complex service" | `explain_symbol` — AI-generated explanation with context |
| "What repos call this endpoint?" | `get_subproject_clients("/api/users")` — all client calls across repos |
| "Will this API change break anything?" | `get_subproject_impact` — cross-repo impact with symbol resolution |
| "Show me all service connections" | `get_subproject_graph` — repos, edges, stats |
| "Starting work on a task" | `get_task_context("fix the login bug")` — full execution context adapted to bugfix/feature/refactor |
| "PR impact report" | `trace-mcp ci-report --base main --head HEAD` — blast radius, risk score, test gaps |
| "How much am I spending on tokens?" | `get_session_analytics` — full breakdown by tool, file, model |
| "Where am I wasting tokens?" | `get_optimization_report` — detects repeated reads, bash-grep, large files |
| "How much would trace-mcp save?" | `get_real_savings` — compares actual reads vs compact alternatives |
| "Quick efficiency benchmark" | `benchmark_project` — synthetic per-category estimate of the structured-task ceiling, not measured savings (use `get_real_savings` for those) |
| "What am I paying before I even type?" | `get_startup_context_audit` — the startup block by source, its share of the bill, what rebuilds it, and a delete-only diff for the text it repeats |
| "What tech isn't covered?" | `get_coverage_report` — gaps in plugin coverage for your deps |

---

## Migrating from 1.x — retired tools

Seven tools were retired in 2.0. Each had been a deprecated alias for a
superset tool that already covered it; every call is expressible in the
replacement without loss of behaviour or response shape.

| Retired tool (1.x) | Replacement (2.0) |
|---|---|
| `pin_symbol { symbol_id }` | `pin { symbol_id }` |
| `pin_file { file_path }` | `pin { file_path }` |
| `search_with_mode { query, mode }` | `search { query, retriever: mode }` |
| `get_dead_exports { file_pattern }` | `get_dead_code { file_pattern, mode: "exports_only" }` |
| `get_untested_exports { file_pattern }` | `get_untested_symbols { file_pattern, scope: "exports_only" }` |
| `get_session_resume { max_sessions }` | `get_wake_up { scope: "resume", max_sessions }` |
| `get_project_memo { include_history, limit }` | `get_wake_up { scope: "project", include_history, history_limit }` |

`pin` accepts `symbol_id` and `file_path` together, pinning both at the same
weight in one call.

One deliberate difference: both retired export-scanning aliases were
TOON-enabled, but only `get_untested_symbols` inherited `output_format`.
Re-measuring the payloads through their replacements put
`get_untested_symbols { scope: "exports_only" }` at **+21.1%** (table mode —
it keeps TOON), while `get_dead_code { mode: "exports_only" }` came in at
**-17.3%** (list mode, because its rows are not uniform). That is well under
the +15% cutoff the TOON allowlist is built on, so wiring it would have cost
tokens rather than saved them. See [TOON savings](toon-savings.md).

Two rarely-used `search` tuning parameters were also removed. Per-channel
fusion weights now come from `~/.trace/tuning.jsonc` (written by
`tune_weights`) instead of `fusion_weights` on every call, and `fusion_debug`
is gone. The nested `fusion_weights` object was the single most expensive
structure in the whole tool schema, paid by every client on every session.

Together these changes cut the always-on tool surface from 148 to 141
registrations and the serialized schema every MCP client without lazy tool
loading pays at session start from 90,579 to 86,217 characters.

Calling a retired name no longer fails with a bare "not found": the server
answers with the replacement call, so a stale `CLAUDE.md` is a one-line fix
rather than a dead end.

### Policy: consolidations retire the old name, they don't alias it forever

This is settled, so future consolidations don't re-litigate it (TRA-205,
folding in the cancelled TRA-212).

**A tool that is consolidated into a superset tool is removed at the next
major, not kept as a permanent alias.** The alias layer TRA-193 shipped
additively was measured (TRA-239: 171 → 172 tools, schema tax up) and retired
outright in 2.0 (TRA-240). Trimming an alias's prose is not enough — the
registration itself is what every client without deferred tool loading pays
for on connect, and token cost is the product.

**The old name gets a call-time hint instead of a registration.** MCP has no
per-tool deprecation signal — a tool is either in `tools/list` or it is a hard
error — so a removed name would otherwise surface as a bare "not found".
`src/server/retired-tools.ts` rewrites that one message to name the
replacement call. It costs nothing on `tools/list`, which is the whole point:
the migration hint lives on the error path, not in the schema payload.

**Renaming purely for clarity is not worth a registration.** Two similarly
named tools that do different things (`tune_decision_weights` vs
`tune_weights`) are disambiguated in their descriptions, not split into new
names with the old ones aliased — a sentence of prose is free, a second
registration is not.

Reopening this needs evidence a retired name is still costing users more than
its removal saved. `src/tools/register/__tests__/tool-schema-budget.test.ts`
is the gate on any change that grows the always-on surface.

### Migrating to 3.0 — Node 22

3.0 raised the Node floor: Node 20 and 21 are no longer supported, and
`node >= 22` is required. No tool signature or response shape changed. If
`npx -y trace-mcp@latest serve` started failing at startup rather than at a
tool call, check `node --version` first.

Both majors landed within a day of each other (2.0.0 on 2026-08-28, 3.0.0 on
2026-08-29), so an install floating on `latest` may have taken both at once.
Pin a major in your MCP client config (`trace-mcp@3`) if you would rather
adopt them deliberately.

---

# Tool index

Source: https://trace-mcp.com/tools-index.html



Every tool the server registers, alphabetically, with the first line of the
description a client receives in `tools/list`. It is generated from the
registrations themselves, so a tool cannot ship without appearing here.

For the tools grouped by what you are trying to do — plus resources, usage
examples and the migration notes — see the [tools reference](tools-reference.md).
For configuration keys, flags, and environment variables that control these tools, see the [config index](config-index.md).
The AI-backed tools (`explain_symbol`, `suggest_tests`, `review_change`,
`find_similar`, `explain_architecture`) register from a different module and
need `ai.enabled: true`; they are described
[there](tools-reference.md#ai-powered-optional).

The rows below are registrations, not a count of what you are served. The
{{ site.data.counts.tools }} figure quoted elsewhere counts what any repo gets,
which excludes the framework-specific rows.

| Availability | Meaning |
| --- | --- |
| `always` | Registered on every repo. |
| `framework` | Only when its framework is detected — see [supported frameworks](supported-frameworks.md). |
| `opt-in` | Behind a config flag (`topology.enabled`, `runtime.enabled`) — see [configuration](configuration.md). |

| Tool | What it does | Availability |
| --- | --- | --- |
| `add_decision` | Manually record an architectural decision, tech choice, preference, or convention. | always |
| `analyze_perf` | Per-tool latency telemetry: p50/p95/max, count, error_rate. | always |
| `apply_codemod` | Structural (AST-aware) or regex find-and-replace across files. | always |
| `apply_move` | Move a symbol to a different file or rename/move a file, updating all import paths across the codebase. | always |
| `apply_rename` | Rename a symbol across all usages (definition + all importing files). | always |
| `apply_startup_recommendations` | Apply or preview a get_startup_context_audit recommendation: disable an unused MCP server, move an unused skill aside, or delete duplicated instruction lines. | always |
| `approve_decision` | Approve a decision currently in the memoir-style review queue (review_status="pending"). | always |
| `assess_change_risk` | Before modifying a file or symbol, predict risk level (low/medium/high/critical) with contributing factors and recommended mitigations. | always |
| `audit_config` | Scan AI agent config files (CLAUDE.md, AGENTS.md, .cursorrules, etc.) for stale references, dead paths, token bloat, and (when include_drift is set) drift be… | always |
| `batch` | Execute multiple trace-mcp tools in a single MCP request. | always |
| `benchmark_project` | Synthetic token efficiency benchmark: compare raw file reads vs trace-mcp compact responses across symbol lookup, file exploration, search, and impact analys… | always |
| `build_corpus` | Pack a slice of project context into a persistent corpus on disk so future query_corpus calls can prime an LLM with the same snapshot without re-running the… | always |
| `build_decision_clusters` | Recompute the L2 thematic cluster overlay over the decision store using the configured LLM. | always |
| `call_project_tool` | Relay a trace-mcp tool call to a DIFFERENT registered project than this session's own (cross-project dispatch). | always |
| `change_signature` | Change a function/method signature (add/remove/rename/reorder parameters) and update all call sites. | always |
| `check_architecture` | Check architectural layer rules: detect forbidden imports between layers (e.g. | always |
| `check_claudemd_drift` | Detect drift between AI agent config files (CLAUDE.md, AGENTS.md, .cursorrules) and the live tool/skill/command surface: dead path references, references to… | always |
| `check_duplication` | Check if a function/class name already exists before creating it. | always |
| `check_edit_safe` | Edit-safety preflight: before modifying a symbol or file, get one verdict for "is this safe to edit and what must I preserve". | always |
| `check_embedding_drift` | Pin and re-check a 16-string canary against the active embedding provider. | always |
| `check_quality_gates` | Run configurable quality gate checks (complexity, coupling, circular imports, dead exports, tech debt, security, antipatterns, code smells). | always |
| `check_rename` | Pre-rename collision detection: checks the symbol's own file and all importing files for existing symbols with the target name. | always |
| `compare_branches` | Compare two branches at symbol level: what was added, modified, removed. | always |
| `consolidate_decisions` | LLM-driven semantic dedup of the decision store. | always |
| `delete_corpus` | Remove a saved corpus (manifest + packed body). | always |
| `detect_antipatterns` | Detect performance & design antipatterns: N+1 queries, missing eager loading, unbounded queries, event listener leaks, circular ORM association cycles, missi… | always |
| `detect_ast_clones` | Find Type-2 AST clones: functions/methods with identical structure after normalizing identifiers and literals (tree-sitter parse + AST subtree hash). | always |
| `detect_communities` | Run Leiden community detection on the file dependency graph. | always |
| `detect_drift` | Detect architectural drift: cross-module co-change anomalies (files in different modules that always change together) and shotgun surgery patterns (commits t… | always |
| `detect_topic_tunnels` | Cross-project topic tunnels: links between registered subprojects sharing canonical entities — manifest package names, top-level declared dependencies, and g… | opt-in |
| `diff_graph_snapshots` | Compare two named graph snapshots and report deltas in counts, communities, and top in-degree files. | always |
| `discover_claude_sessions` | Scan ~/.claude/projects for projects Claude Code has touched on this machine, decode each directory name back to its absolute path, and report which ones sti… | opt-in |
| `discover_hermes_sessions` | List Hermes Agent (NousResearch) sessions visible on this machine. | always |
| `embed_repo` | Precompute and cache symbol embeddings for semantic / hybrid search. | always |
| `export_decisions` | Export decisions to JSONL or Markdown. | always |
| `export_graph` | Export the dependency graph in formats external tools understand. | always |
| `export_security_context` | Export security context for MCP server analysis. | always |
| `extract_function` | Extract a line range out of an enclosing function into a new named helper (AST-aware, TypeScript/JavaScript). | always |
| `find_usages` | Find all references to a symbol or file (imports, calls, renders, dispatches). | always |
| `generate_docs` | Generate project documentation from the code graph — architecture, API surface, data models, components, dependencies. | always |
| `generate_insights_report` | Single-call narrative health snapshot: god files (PageRank), architectural bridges (edge bottlenecks), risk hotspots (complexity × churn), edge resolution-ti… | always |
| `generate_sbom` | Generate a Software Bill of Materials (SBOM) from package manifests and lockfiles. | always |
| `get_api_contract` | Get API contract (OpenAPI/gRPC/GraphQL) for a service. | opt-in |
| `get_api_surface` | List all exported symbols (public API) of a file or matching files. | always |
| `get_artifacts` | Surface non-code knowledge from the index: DB schemas (migrations, ORM models), API specs (routes, OpenAPI endpoints), infrastructure (docker-compose service… | always |
| `get_call_graph` | Build a bidirectional call graph centered on a symbol (who calls it + what it calls). | always |
| `get_change_impact` | Full change impact report: risk score + mitigations, breaking change detection, enriched dependents (complexity, coverage, exports), module groups, affected… | always |
| `get_changed_symbols` | Map a git diff to affected symbols (functions, classes, methods), for PR review. | always |
| `get_circular_imports` | Find circular dependency chains in the import graph (Kosaraju SCC algorithm). | always |
| `get_cluster_decisions` | Return the member decisions of a cluster, plus the cluster header. | always |
| `get_co_changes` | Find files that frequently change together in git history (temporal coupling). | always |
| `get_code_owners` | Git-based code ownership: who contributed most to specific files (git shortlog). | always |
| `get_communities` | Get previously detected communities (file clusters). | always |
| `get_community` | Get details for a specific community: files, inter-community dependencies. | always |
| `get_complexity_report` | Get complexity metrics (cyclomatic, max nesting, param count) for symbols in a file or across the project. | always |
| `get_complexity_trend` | File complexity over git history: cyclomatic complexity at past commits. | always |
| `get_component_tree` | Build a component render tree starting from a given .vue file. | framework |
| `get_context_bundle` | Get a symbol's source code + its import dependencies + optional callers, packed within a token budget. | always |
| `get_contract_drift` | Detect mismatches between API spec and implementation: endpoints in spec but not in code, or in code but not in spec. | opt-in |
| `get_contract_versions` | Show version history for a service API contract with breaking change detection between versions. | opt-in |
| `get_control_flow` | Build a Control Flow Graph (CFG) for a function/method: if/else branches, loops, try/catch, returns, throws. | always |
| `get_coupling` | Coupling analysis: afferent (Ca), efferent (Ce), instability index per file. | always |
| `get_coupling_trend` | File coupling over git history: Ca/Ce/instability at past commits. | always |
| `get_coverage_report` | Technology profile of the project: detected frameworks/ORMs/UI libs from manifests (package.json, composer.json, etc.), which are covered by trace-mcp plugin… | always |
| `get_cross_domain_deps` | Show which business domains depend on which. | always |
| `get_cross_service_impact` | Analyze cross-service impact of changing an endpoint or event. | opt-in |
| `get_cross_workspace_impact` | Show which workspaces are affected by changes in a given workspace. | always |
| `get_dataflow` | Intra-function dataflow analysis: track how each parameter flows through the function body — into which calls, where it gets mutated, and what is returned. | always |
| `get_dead_code` | Dead code detection. | always |
| `get_decision` | Fetch a single decision by id, including its full `content`. | always |
| `get_decision_clusters` | List decision clusters with optional full-text filter. | always |
| `get_decision_stats` | Overview of the decision knowledge graph: total decisions, active/invalidated counts, breakdown by type and source. | always |
| `get_decision_timeline` | Chronological timeline of decisions for a project, symbol, or file. | always |
| `get_dependency_diagram` | Render dependency diagram for a file/directory path as Mermaid or DOT. | always |
| `get_di_tree` | Trace NestJS dependency injection tree (what a service injects + who injects it). | framework |
| `get_diagnostics` | Execute type-checker (tsc, mypy, pyright) and map errors to enclosing AST symbols. | always |
| `get_domain_context` | Get all code related to a specific business domain. | always |
| `get_domain_map` | Get hierarchical map of business domains with key symbols per domain. | always |
| `get_edge_bottlenecks` | Find architectural bottleneck edges in the import graph: edges on many shortest paths (betweenness), edges whose removal would disconnect the graph (bridges)… | always |
| `get_endpoint_analytics` | Per-route analytics: request count, error rate, latency, caller services. | opt-in |
| `get_env_vars` | List environment variable keys from .env files with inferred value types/formats. | always |
| `get_event_graph` | Get event/signal/task dispatch graph (Laravel events, Django signals, NestJS events, Celery tasks, Socket.io events). | framework |
| `get_feature_context` | Search code by keyword/topic → returns ranked source snippets within a token budget. | always |
| `get_federation_impact` | Aggregates cross-repo impact into ONE call: if you change an endpoint, service, or symbol, this combines subproject client-call impact (which repos/files cal… | opt-in |
| `get_file_health_timeline` | Aggregates get_complexity_trend, get_coupling_trend, and get_git_churn into one per-file time series: complexity, coupling, and a lightweight risk_score per… | always |
| `get_git_churn` | Per-file git churn: commits, unique authors, frequency, volatility assessment. | always |
| `get_graph_timeline` | Graph-evolution timeline: samples evenly-spaced historical commits (via git log) and reports file-count + commit churn per period, with a short narrative dif… | always |
| `get_health_trends` | Time-series health metrics for a file or module: bug score, complexity, coupling, churn over time. | always |
| `get_implementations` | Find all classes that implement or extend a given interface or base class. | always |
| `get_import_graph` | Show file-level dependency graph: what a file imports and what imports it (requires reindex for ESM edge resolution). | always |
| `get_index_health` | Get index status, statistics, health, and pipeline progress (indexing, summarization, embedding). | always |
| `get_livewire_context` | Get full context for a Livewire component: properties, actions, events, view, child components. | framework |
| `get_middleware_chain` | Trace middleware chain for a route URL (Express/NestJS/FastAPI/Flask). | framework |
| `get_minimal_context` | Single-call orientation context (~150 tokens). | always |
| `get_model_context` | Get full model context: relationships, schema, and metadata (Eloquent/Mongoose/Sequelize/SQLAlchemy/Prisma/TypeORM/Drizzle). | framework |
| `get_module_graph` | Build NestJS module dependency graph (module -> imports -> controllers -> providers -> exports). | framework |
| `get_navigation_graph` | Build React Native navigation tree from screens, navigators, and deep links. | framework |
| `get_nova_resource` | Get full context for a Laravel Nova resource: model, fields, actions, filters, lenses, metrics. | framework |
| `get_optimization_report` | Detect token waste patterns in AI agent sessions: repeated file reads, Bash grep instead of search, large file reads, unused trace-mcp tools. | always |
| `get_outline` | Get all symbols for a file (signatures only, no bodies) — cheaper than Read for understanding a file before editing. | always |
| `get_package_deps` | Cross-repo package dependency analysis: find which registered projects depend on a package, or what packages a project publishes. | always |
| `get_pagerank` | File importance ranking via PageRank on the import graph. | always |
| `get_plugin_registry` | List registered indexer plugins and edge types. | always |
| `get_preset_info` | Show active tool preset, available presets, which tools are registered in this session, and which are deferred (loadable via load_tools). | always |
| `get_project_health` | Structural health: coupling instability, dependency cycles, PageRank rankings, refactor candidates. | always |
| `get_project_map` | Get project overview: detected frameworks, languages, file counts, structure. | always |
| `get_real_savings` | A/B comparison: how many tokens could be saved by using trace-mcp instead of raw Read/Bash file reads. | always |
| `get_refactor_candidates` | Find functions with high complexity called from many files — candidates for extraction to shared modules. | always |
| `get_related_symbols` | Find symbols related via co-location (same file), shared importers, and name similarity. | always |
| `get_request_flow` | Trace request flow for a URL+method: route → middleware → controller → service (Laravel/Express/NestJS/Fastify/Hono/tRPC/FastAPI/Flask/DRF). | framework |
| `get_risk_hotspots` | Code hotspots: files with both high complexity AND high git churn (Adam Tornhill methodology). | always |
| `get_runtime_call_graph` | Actual call graph from runtime traces (vs static analysis). | opt-in |
| `get_runtime_deps` | Which external services (databases, caches, APIs, queues) does this code actually call at runtime. | opt-in |
| `get_runtime_profile` | Runtime profile for a symbol or route: call count, latency percentiles (p50/p95/p99), error rate, calls per hour. | opt-in |
| `get_schema` | Get database schema reconstructed from migrations or ORM model definitions. | framework |
| `get_screen_context` | Get full context for a React Native screen: navigator, navigation edges, deep link, platform variants, native modules. | framework |
| `get_service_deps` | Get external service dependencies: which services this one calls (outgoing) and which call it (incoming). | opt-in |
| `get_service_map` | Get map of all services, their APIs, and inter-service dependencies. | opt-in |
| `get_session_analytics` | Analyze AI agent session logs: token usage, cost breakdown by tool/server, top files, models used. | always |
| `get_session_journal` | Session history: all tool calls made, files read, zero-result searches, and duplicate queries. | always |
| `get_session_snapshot` | Compact session snapshot (~200 tokens) for context recovery after compaction. | always |
| `get_session_stats` | Token savings stats for this session: per-tool call counts, estimated token savings, reduction percentage, dedup savings, and per-tool latency (p50/p95/max/e… | always |
| `get_startup_context_audit` | What every session pays before your first message, what it costs, and what went unused: source decomposition, cache-rebuild prices, and removals proven unuse… | always |
| `get_state_stores` | List all Zustand stores and Redux Toolkit slices with their state fields, actions/reducers, and dispatch sites. | framework |
| `get_subproject_clients` | Find all client calls across subprojects that call a specific endpoint. | opt-in |
| `get_subproject_graph` | Show all subprojects and their cross-repo connections. | opt-in |
| `get_subproject_impact` | Cross-repo impact analysis: find all client code across subprojects that would break if an endpoint changes. | opt-in |
| `get_suggested_questions` | Auto-generated, prioritized review questions derived from the analyses we already cache (untested framework entry points, circular imports, ast-clone cluster… | always |
| `get_surprises` | Rank cross-module file edges by how unexpected they look (deep folder distance + popular target + few edges = high surprise). | always |
| `get_symbol` | Look up a symbol by symbol_id or FQN and return its source code. | always |
| `get_symbol_complexity_trend` | Single symbol complexity over git history: cyclomatic, nesting, params, lines at past commits. | always |
| `get_symbol_owners` | Git blame-based symbol ownership: who wrote which lines of a specific symbol. | always |
| `get_task_context` | All-in-one context for starting a dev task: execution paths, tests, entry points, adapted by task type. | always |
| `get_tech_debt` | Per-module tech debt score (A–F grade) combining: complexity, coupling instability, test coverage gaps, and git churn. | always |
| `get_tests_for` | Find test files/functions covering a given symbol or file. | always |
| `get_type_hierarchy` | Walk TypeScript class/interface hierarchy: ancestors (what it extends/implements) and descendants (what extends/implements it). | always |
| `get_untested_symbols` | Find symbols lacking test coverage. | always |
| `get_usage_trends` | Daily token usage time-series: sessions, tokens, estimated cost, tool calls per day. | always |
| `get_wake_up` | Compact orientation context (~300 tokens) for session start. | always |
| `get_workspace_map` | List all detected monorepo workspaces with file counts, symbol counts, and languages. | always |
| `graph_query` | Trace how named symbols relate in the dependency graph → returns subgraph + Mermaid diagram. | always |
| `index_sessions` | Index conversation content from Claude Code / Claw Code sessions for cross-session search. | always |
| `invalidate_decision` | Mark a decision as no longer valid. | always |
| `list_bundles` | List installed pre-indexed bundles for dependency libraries. | always |
| `list_corpora` | List every corpus saved on disk with its manifest (scope, project_root, sizes, timestamps). | always |
| `list_graph_snapshots` | List previously captured graph snapshots, most recent first. | always |
| `list_pins` | List all active ranking pins with weight, scope, target, expiry, and creator. | always |
| `list_projects` | List projects registered with trace-mcp (~/.trace/registry.json) — the roots call_project_tool accepts. | always |
| `load_tools` | Load tools this session's preset deferred, by preset name and/or explicit tool names. | always |
| `mine_sessions` | Mine Claude Code / Claw Code session logs for architectural decisions, tech choices, bug root causes, and preferences. | always |
| `pack_context` | Pack project context into a single document for external LLMs. | always |
| `pin` | Boost (or demote) a symbol and/or file in PageRank-driven ranking by setting a multiplicative weight. | always |
| `plan_batch_change` | Analyze the impact of updating a package/dependency. | always |
| `plan_refactoring` | Preview any refactoring (rename, move, extract, signature) without applying. | always |
| `plan_turn` | Opening-move router for new tasks. | always |
| `predict_bugs` | Heuristic bug-risk triage: ranks files by git churn, fix-commit ratio, complexity, coupling, PageRank, and author count — a prioritization heuristic, NOT a v… | always |
| `query_by_intent` | Map a business question to domain taxonomy → returns domain ownership and relevance scores (no source code). | always |
| `query_corpus` | Answer a natural-language question against a saved corpus. | always |
| `query_decisions` | Query the decision knowledge graph. | always |
| `refresh_co_changes` | Rebuild co-change index from git history. | always |
| `regenerate_project_memo` | Synthesise (or refresh) the project memo — a 250-400 word LLM-written orientation digest over the decision store. | always |
| `register_edit` | Notify trace-mcp that a file was edited. | always |
| `reindex` | Trigger (re)indexing of the project or a subdirectory. | always |
| `reject_decision` | Reject a decision currently in the memoir-style review queue (review_status="pending"). | always |
| `remember_decision` | Live agent write into the decision knowledge graph. | always |
| `remove_dead_code` | Safely remove a dead symbol from its file. | always |
| `repair_index` | Apply a targeted repair to the local SQLite index. | always |
| `rollback_startup_recommendations` | Undo one apply_startup_recommendations(dry_run:false) call byte-for-byte: restores files and moved skills. | always |
| `scan_code_smells` | Find deferred work and shortcuts: TODO/FIXME/HACK/XXX comments, empty functions & stubs, hardcoded values (IPs, URLs, credentials, magic numbers), and per-la… | always |
| `scan_security` | Scan project files for OWASP Top-10 vulnerabilities (SQLi, XSS, command injection, path traversal, hardcoded secrets, insecure crypto, open redirects, SSRF —… | always |
| `search` | Search symbols by name, kind, or text. | always |
| `search_bundles` | Search pre-indexed bundles for symbols from popular libraries (React, Express, etc.). | always |
| `search_sessions` | Search across all past session conversations. | always |
| `search_text` | Full-text search across all indexed files. | always |
| `self_audit` | Dead code & coverage audit: dead exports, untested public symbols, heritage debt. | always |
| `snapshot_graph` | Capture the current graph shape (file/symbol counts, edges by type, top in-degree files, communities, exported symbols) under a named label. | always |
| `subproject_add_repo` | Add a repository as a subproject of the current project. | opt-in |
| `subproject_sync` | Re-scan all subprojects: re-discover services, re-parse contracts, re-scan client calls, and re-link everything. | opt-in |
| `suggest_queries` | Onboarding helper: shows top imported files, most connected symbols (PageRank), language stats, and example tool calls. | always |
| `taint_analysis` | Track flow of untrusted data from sources (HTTP params, env vars, file reads) to dangerous sinks (SQL queries, exec, innerHTML, redirects). | always |
| `trace_state_add_dead_end` | Shortcut to record a failed approach or dead end into task state without a full patch. | always |
| `trace_state_checkpoint` | Save a named state checkpoint snapshot for safe rollback if a future exploration path fails. | always |
| `trace_state_get` | Retrieve current execution state for a task in compact markdown (~150 tokens) or full JSON. | always |
| `trace_state_init` | Initialize structured execution state for a task (arXiv:2608.26263). | always |
| `trace_state_list` | List recent agent execution task states and their status in storage. | always |
| `trace_state_patch` | Apply an RFC 7396 JSON Merge Patch to update state atomically. | always |
| `trace_state_rollback` | Rollback task execution state to a previously saved checkpoint snapshot by label or ID. | always |
| `traverse_graph` | Walk the dependency graph from a starting symbol or file using BFS/DFS, with a hard token budget on the response. | always |
| `tune_decision_weights` | Decision memory, not retrieval ranking (that is `tune_weights`): re-fit decision confidence weights from accumulated review feedback (approve/reject events). | always |
| `tune_weights` | Retrieval fusion ranking for `search`, not decision memory (that is `tune_decision_weights`): read the persistent ranking ledger and learn per-repo signal-fu… | always |
| `unpin` | Remove a ranking pin by target. | always |
| `verify_docs` | Verify a markdown document against the code graph — the reverse of generate_docs, for catching doc drift after a rename. | always |
| `verify_index` | Read-only structural check of the local SQLite index: SQLite integrity_check, foreign-key violations, required-table presence, FTS5 integrity-check, embeddin… | always |
| `visualize_graph` | Open interactive HTML graph in browser showing file/symbol dependencies. | always |
| `visualize_subproject_topology` | Open interactive HTML visualization of the subproject topology: services as nodes, API calls as edges, health/risk indicators per service. | opt-in |

---

# What `trace init` installs

Source: https://trace-mcp.com/what-trace-init-installs.html



trace-mcp arrives through two doors, and which door a thing comes through is
decided by **how it is installed**, not by what it does.

Door one is the tool surface: the code graph, decision memory, the state
tools, the startup audit. You install it by adding an MCP server, and a
preset governs how much of it your client sees — [tools
reference](tools-reference.md).

Door two is this page. `trace init` writes files to your machine: hooks your
agent harness runs, a routing block in your instruction file, and an MCP entry
per detected client. None of that is reachable through `tools/list`, so a reader
who installed us as "an MCP server" never finds out it is there. The startup
audit below is a door-one tool — it is here because it is where to start, not
because `init` installs it.

**The rule the whole door runs on:** we change configuration you could change
yourself, and we tell you what we changed. We do not patch your client's binary,
intercept its traffic, or rewrite files we do not own. The one thing that goes
past that line is the Max tier's `tweakcc` pairing, which patches Claude Code's
system prompts through a third-party tool that `init` invokes for you — it has
[its own section](#the-tweakcc-pairing-and-the-line-it-sits-next-to) rather than
a footnote, and you can decline it.

---

## Start here: audit the block you already pay for

Every session pays for its startup block before you type anything — the
harness system prompt, tool schemas, every MCP server's instructions, the skill
and agent listings, `CLAUDE.md`, and whatever your `SessionStart` hooks print.
You are billed for it on the first turn and again on every cache rebuild.

`get_startup_context_audit` measures **yours**. Not a decomposition we took on
our machine and asked you to generalise from — your own logs, read locally from
`~/.claude/projects/*.jsonl`, nothing leaving the machine.

It answers four things:

- **What the block is made of**, by source, with hooks named individually.
- **What it costs** — its share of the input-side bill, plus the mid-session
  cache rebuilds that make you pay for it twice.
- **What went unused** — an MCP server whose instructions loaded into every
  start and whose tools were never called; a skill listed at every start and
  never invoked.
- **Where it says the same thing twice** — `textCompression` compares your
  `CLAUDE.md` / `AGENTS.md` / `MEMORY.md` against the instruction text other
  sources actually sent, and proposes deletions with a diff.

Every recommendation rests on **evidence of non-use over a stated window**,
never on size. A tool missing from the startup block is a tool the agent will
not call, so a suggestion made because something is big can cost its reader far
more than it saves.

`apply_startup_recommendations` applies one, backed up first — the desktop app
puts a button on it — and `rollback_startup_recommendations` restores the exact
prior bytes in one action. Backups live under `~/.trace/startup-backups/` and
are never deleted automatically.

Full parameters and payload shape: [analytics and token
tracking](analytics.md#get_startup_context_audit).

---

## The guard: routing that survives a long session

The failure mode with tool routing is not forgetting, it is skipping. The
`CLAUDE.md` block says "use the graph"; the agent reaches for `Grep` anyway
under load, or after compression drops the block out of context.

`trace-mcp-guard` is a `PreToolUse` hook on `Read|Grep|Glob|Bash|Agent`. It
does not intervene on an isolated call — routing a one-question lookup through
us was measured as a regression, not a saving. It waits for the session to
actually be crawling: navigation-class calls are redirected from the third
attempt inside a five-minute window (`TRACE_MCP_GUARD_NAV_MIN`,
`TRACE_MCP_GUARD_NAV_WINDOW`). Relationship questions — who calls this, what
breaks if I change it, which tests cover it — bypass the gate and route from
the first call.

**When trace-mcp is not reachable, the guard stops routing.** No heartbeat, a
stale one, a stalled channel: every navigation-cost branch — `Read`, `Grep`,
`Glob` and guarded `Bash` exploration — degrades to allow-with-warning rather
than denying a call the tools cannot answer either. Two rules stay outside that
fallback because they are not cost tradeoffs: the `.env` secrets rule, and the
`Agent(Explore)` rule.

---

## The mirrors: cheaper output, and an honest result

`trace-mcp-mirror` is a `PostToolUse` hook on `Read|Bash`. The native tool runs
untouched; the hook compresses its output before the model sees it and spills
the full result to disk, referenced by path — so the agent can pull the whole
thing back when the window is not enough.

The compression is deterministic and model-free: collapse repeated lines, drop
build and install progress noise, keep a head/tail window of what is left. The
same output always produces the same replacement, and the hook only ever
rewrites the message being appended, never one already in the prompt prefix.

**The result, stated plainly: cost down, capability flat.** The 24/12-line
window compresses 52% of the paid band offline, and across 108 live runs it
moved the solve rate by **0 percentage points**. That is a real measurement of
a real saving, and it is not a capability claim — we are not going to dress it
up as one. The wider character cap that takes the band to 62.6% has not been
through a live gate yet, so it stays behind `TRACE_MCP_MIRROR_CAP`.

Because it is the one hook that changes what the model reads, **it is opt-in**:
`trace init --mirror` installs it, and a plain `trace init` never opts you in.
Once you have opted in, later `init` runs refresh the installed hook without the
flag, so a fix to the script reaches you without your having to remember it. It
is a `bash` + `jq` pipeline, so it is not available on Windows yet.

---

## What else `init` writes

| What | Where | Notes |
|---|---|---|
| MCP server entry | each detected client's native config | JSON, TOML or YAML depending on the client — see [supported MCP clients](configuration.md#supported-mcp-clients) |
| Tool routing block | `CLAUDE.md` / `AGENTS.md` | Only the block it generated; your own prose is not rewritten |
| IDE rules file | `.cursor/rules/trace.mdc`, `.windsurfrules` | The Cursor and Windsurf equivalent of the routing block |
| Lifecycle hooks | `SessionStart`, `UserPromptSubmit`, `Stop`, `SessionEnd` | Inject decision memory across the session lifecycle instead of waiting for the agent to ask |
| Reindex hook | `PostToolUse` on `Edit|Write|MultiEdit` | Keeps the graph current as the agent edits |
| Precompact hook | `PreCompact` | Injects the session snapshot into the compacted context, so a compaction does not lose the thread |
| Allowlist and matcher rewrites | `settings.json`, `settings.local.json` | Renaming `trace-mcp` → `trace` also renames the tool prefix a hook matcher or permission entry references |

Three enforcement tiers pick how much of this you get: **Base** is the
instruction block alone, **Standard** adds the guard hooks, **Max** adds the
`tweakcc` pairing below. Each tier adds to the one before it; nothing is
removed.

---

## The `tweakcc` pairing, and the line it sits next to

**`tweakcc` is a third-party tool, and the Max tier runs it for you.** It is not
ours: it is [`tweakcc`](https://github.com/Piebald-AI/tweakcc), and what it does
is patch Claude Code's system prompts. What trace-mcp does is write prompt files
into `~/.tweakcc/system-prompts/` and then shell out to
`npx -y tweakcc@4.3.3 --apply`. The patching is tweakcc's; the decision to
invoke it, at the Max tier, is ours, and saying anything softer than that would
be untrue of the code.

The version is **pinned**, not `latest`: the exact spec lives in
`src/init/tweakcc.ts` (`TWEAKCC_VERSION`), is mirrored into `package.json` so it
appears in the dependency graph, the release SBOM and dependabot, and
`tests/ci/supply-chain-pins.test.ts` fails the build if the two drift apart or if
any `npx` in `src/` loses its version. A bump is therefore a reviewable PR, not
something the registry can decide on your machine after our release.

Deciding whether you already have tweakcc is a **filesystem check** — the config
directory, then the `PATH`. It used to be `npx tweakcc --version`, which is not a
check: npx installs a missing package, and with the output piped it does so
without prompting. Nothing is downloaded and no third-party binary is run before
you answer the tier question.

**Max is the default when `init` runs non-interactively** against Claude Code,
Claw Code or Claude Desktop. Interactively it is the preselected option and the
prompt says so. `--skip-hooks` turns it off, as does picking Base or Standard.
Know which tier you are agreeing to before you agree to it.

That is the one place the rest of this page's boundary is under strain, so it is
stated here rather than smoothed over: everything else `init` touches is
configuration you own and could edit yourself, and system prompts are not that.
`tweakcc` is an optional amplifier on one client, not a foundation. If the
distinction ever stopped being drawable, the honest move would be to drop the
pairing, not to soften the boundary.

What it is for and how to apply it: [system prompt routing via
tweakcc](tweakcc.md).

---

## How much of this reaches your client

Door two is mostly Claude-Code-shaped, and the page would be lying by omission
if it did not say so.

| Client | What door two gives it |
|---|---|
| Claude Code | Everything on this page: hooks, the guard, the mirrors, the routing block, the `tweakcc` pairing |
| Claw Code, Claude Desktop | The same hooks and tiers. `tweakcc` patches Claude Code's own installation, so the Max tier is offered here but the patch lands there |
| Cursor, Windsurf | A rules file and the MCP entry — there is no hook equivalent in these tools |
| Every other supported client | The MCP entry, plus whatever the tool descriptions carry |

The startup audit itself is door one — it is an MCP tool, so any client that
speaks MCP can call it, but it reads Claude Code and Claw Code session logs and
has nothing to read elsewhere.

Nothing on this page has been measured on a client other than Claude Code.

---

## Undoing it

- `rollback_startup_recommendations` — reverses one apply, byte-for-byte.
- `TRACE_MCP_MIRROR_DISABLE` — any non-empty value passes tool output through
  untouched, without uninstalling anything.
- `trace setup-hooks --uninstall --global` — removes the guard hook. The
  lifecycle four are a separate flag:
  `trace setup-hooks --uninstall --lifecycle --global`. Pass `--global` on both:
  `init` writes to `~/.claude/settings.json`, and without the flag these
  commands operate on the project-level file instead.

**Re-running `init` at a lower tier does not remove what a higher tier
installed.** The tier decides what gets written, and there is no inverse branch:
pick Base after a Standard or Max run and the guard, the lifecycle hooks and the
`tweakcc` prompt files stay where they are. Uninstalling is the separate command
above, and the `tweakcc` prompt files come out through `tweakcc` itself.

Nothing here deletes a config key it did not write. An entry you configured
yourself on the MCP server object survives a rename or a re-init. For the
complete reference of configuration settings, paths, environment variables,
and local storage policies, see [configuration](configuration.md), the
[config index](config-index.md), and [privacy](privacy.md).

---

# Serena, Repomix and 20+ code graph MCP servers compared

Source: https://trace-mcp.com/comparisons.html


Most MCP servers in this space do one of three things: pack a repository into a prompt (Repomix), proxy a live language server (Serena), or build a persistent [code graph MCP server](/code-graph-mcp.html) (codegraph, codebase-memory-mcp, trace-mcp). trace-mcp is in the third group, and adds framework-aware edges and code-linked memory on top of the graph. This page is the whole field, tool by tool, with the evidence for each row and the date it was checked.

**Before the tables: a capability table is the cheapest kind of evidence.** Every ✓ below, ours included, is a feature claim. The one claim on this page that was measured rather than asserted is the token cost: [a median {{ site.data.pr_context_bench.median_savings_pct }}% fewer input tokens to assemble code-review context](/pr-context-benchmark.html), over {{ site.data.pr_context_bench.pr_count }} merged pull requests in {{ site.data.pr_context_bench.repo_count }} open-source repositories nobody here maintains. Cheaper context is only worth having if the review written from it holds up, so the same {{ site.data.pr_context_quality.pr_count }} pull requests were reviewed twice — once from each context — and scored blind by a judge against the PR's own diff: trace-mcp's arm understood the change {{ site.data.pr_context_quality.trace_understood }} of the time against naive file loading's {{ site.data.pr_context_quality.baseline_understood }}, at {{ site.data.pr_context_quality.trace_false_positives }} false positives per PR against {{ site.data.pr_context_quality.baseline_false_positives }} — parity on a corpus this size, and inside the [bar preregistered before the calls were made](/perf/prereg-pr-quality/). We publish that half because a saving quoted without it is the asymmetry this page exists to refuse. Two peers below publish token benchmarks of their own — codebase-memory-mcp's arXiv preprint (10× fewer tokens across 31 repos, which we have not reproduced) and codegraph's self-run August 2026 measurement (62% fewer tokens across seven repos, the most transparent self-benchmark in this field). What separates ours is not that it exists: it is that the base and head SHAs, the losing cases, and the single command that re-runs the whole thing all ship inside the repository.

## trace-mcp vs the main alternatives

The tables further down cover the whole field. This section covers the projects people actually evaluate against trace-mcp, in enough depth to decide from. Each major peer has a dedicated head-to-head page with a focused table, an honest "when to pick theirs" section, and an FAQ. Where the tables quote an advertised tool surface, that surface is a config knob as much as an architecture — [tool presets](/configuration.html) decide what a session pays up front.

_Every star count, licence and tool-surface figure in this section was re-read from the GitHub API and from each project's own source on **September 3, 2026** (CodeGraphContext on **September 4, 2026**), not carried over from the head-to-head pages. These summaries are written for the hub and rewritten on each pass — never pasted from a spoke, so the hub and its deep-dive pages stay distinct documents rather than drifting into near-duplicates._

### trace-mcp vs Repomix — packing a repository vs indexing it

[Repomix](https://github.com/yamadashy/repomix) (yamadashy/repomix, {{ site.data.competitors.repomix.stars }} stars, TypeScript, MIT, v1.18.0) turns a repository into one prompt-shaped file. It ships an official MCP server (`--mcp`) and a tree-sitter `--compress` mode that keeps imports, classes, functions and signatures and drops the implementation bodies. It is the shortest path from "here is a repository" to "the model has read it": no index build, no daemon, no config, and `repomix --remote owner/name` does the same for a codebase you do not own in seconds. For a small repo, a one-shot question, or pasting context into a web chat with no MCP client at all, that is the right shape of tool, and it is roughly 275× more popular than trace-mcp, which means far more third-party recipes when you need an answer at 2am.

What a pack cannot contain is an edge. `--compress` is lossy summarisation *per file*, so no compression level yields "who calls this" or "what breaks if I change this signature" — a pack holds the bytes that would answer those questions but computes nothing. A pack is also a fixed cost re-paid on every regeneration, and stale from the first edit after it is written (`--watch` re-packs the entire output after a 300 ms debounce, local directories only). trace-mcp pays the indexing cost once and amortises it across every query in the session, reindexes incrementally per changed file, resolves framework edges — route → handler, controller → template, model → table — through {{ site.data.counts.frameworks }} integrations, and has a write path Repomix does not: rename across files, symbol moves, signature changes, AST codemods, verified dead-code removal. Pick Repomix when the repo fits in context; pick a graph when it does not, or when the question is structural. → [trace-mcp vs Repomix](/vs/repomix.html)

### trace-mcp vs Serena — a live LSP proxy vs a precomputed graph

[Serena](https://github.com/oraios/serena) (oraios/serena, {{ site.data.competitors.serena.stars }} stars, Python, MIT) drives real language servers rather than parsing code itself: its README claims support for over 40 programming languages through LSP, plus an optional bridge into a running JetBrains IDE. That is a genuine precision lead in the cases AST heuristics get wrong — overloads, re-exports, generics, dynamic dispatch through interfaces — and it is on by default for Serena where it is opt-in for us. It is also the only peer that shapes its tool surface along two axes at once: fifteen client-specific contexts (Claude Code, Codex, Cursor-style IDE, ChatGPT, JetBrains and more) crossed with nine modes (`planning`, `editing`, `one-shot`, `no-memories`, …). Counted from source today, 50 tool classes are defined, 22 of them optional, leaving **28 enabled by default** — exactly level with trace-mcp's 28-tool `minimal` preset, so the honest comparison there is "the same size", not "half".

The structural difference is edges and durability. Serena is not stateless — `SolidLanguageServer` persists two pickled per-file document-symbol caches under `.serena/cache/`, so warm symbol lookups survive a restart — but it keeps no graph: no import graph, no call graph, no impact traversal. `callHierarchy/incomingCalls` exists in its LSP client layer and no tool class exposes it, so an agent cannot ask Serena for a call graph at all. Its memories are markdown files under `.serena/memories` with topic namespacing and cross-reference integrity checking, which is more than "notes" — but nothing ties a memory to a symbol and nothing rechecks it against the code at recall time, where trace-mcp's decisions bind to symbol IDs, are verified as non-stale before they are served, and surface inside `get_change_impact`. Pick Serena for one mainstream language with a first-class language server, or if you need agent-driven debugging in JetBrains (something we deliberately do not chase — a static graph is the wrong tool for a running process). Pick trace-mcp for polyglot repositories, framework edges no language server models, transitive impact analysis, and the work that comes after navigation. → [trace-mcp vs Serena](/vs/serena.html)

### trace-mcp vs codebase-memory-mcp — the closest peer, opposite bet

[codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) (DeusData/codebase-memory-mcp, {{ site.data.competitors.codebase_memory_mcp.stars }} stars, C, MIT) is the peer with the same premise as ours — a persistent tree-sitter knowledge graph of functions, classes, call chains, HTTP routes and cross-service links, served over MCP, fully local, no API key — and the opposite bet on how to spend the effort. It goes wide: **162 vendored grammars** compiled into a single binary (against trace-mcp's {{ site.data.counts.languages }}), with Hybrid LSP semantic type resolution layered on about a dozen of them, and **15 MCP tools at roughly 7K tokens of schema** against our ~11.6K — trimmed further by positive allowlists, `--tool-profile scout` exposing seven tools and `analysis` eleven. That ~1.7× advertised-surface gap is the clearest place any competitor beats us, and this page is not going to pretend otherwise. Its supply-chain posture — SLSA Level 3 provenance, VirusTotal-scanned reproducible release candidates, OpenSSF Scorecard — is stronger than ours and can be the whole decision in a regulated shop. Its authors also published a benchmark preprint (arXiv 2603.27277: 83% answer quality, ~10× fewer tokens, 2.1× fewer tool calls across 31 repositories) that we have not reproduced.

Where it stops is depth and writes. A language-agnostic parser produces no framework edges: it knows `UserController` exists, not that it renders `Users/Show.vue` through Inertia. It is read-only — no rename with import rewriting, no symbol moves, no signature changes, no AST codemods, no dead-code removal. Its memory primitive, `manage_adr`, writes flat markdown documents rather than code-linked decisions, so nothing stops a decision about a deleted function from being replayed as if it still held. And it has no code-security analysis — no taint analysis, no SARIF output, no CI quality gates. trace-mcp's OWASP taint analysis with type-aware pruning, configurable quality gates and SARIF 2.1.0 output make its graph a participant in CI rather than a chat aid. (Their supply-chain posture, above, is a different axis and a stronger one than ours.) One thing it has that we do not: `ingest_traces` folds observed runtime caller/callee counts into the graph — dynamic edges static analysis cannot see. → [trace-mcp vs codebase-memory-mcp](/vs/codebase-memory-mcp.html)

### trace-mcp vs codegraph — one advertised tool, tuned for orientation

[codegraph](https://github.com/colbymchenry/codegraph) (colbymchenry/codegraph, {{ site.data.competitors.codegraph.stars }} stars, MIT, v1.6.0 — TypeScript over a native Rust extraction kernel with vendored C grammars) is the largest peer by stars and the sharpest single idea in this field. It defines eight MCP tools — search, callers, callees, impact, node, explore, status, files — and by default **advertises exactly one**. Re-verified in its source at the current commit: `DEFAULT_MCP_TOOLS` is the single-element set `{explore}`, the other seven stay fully implemented and re-enablable through a `CODEGRAPH_MCP_TOOLS` allowlist, and the stated reason in their own comment is that every other tool is a narrower slice of `explore` and *presence itself steers mis-picks*. The whole advertised surface costs roughly **1,900 tokens** against our ~11.6K — about 6× cheaper, real money paid on every session. Its self-run August 2026 benchmark reports 88% fewer tool calls, 62% fewer tokens, 44% lower cost and 53% faster across seven repositories, disclosing the model, the queries, four runs per arm, and a correction to an earlier version of its own harness. It is not third-party reproduced, and it is still the most transparent self-benchmark here.

Two things it is honest about, which we repeat rather than quietly exploit: its README reports that its answers leave roughly 80% *more* retrieval context resident 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. And its scope stops at navigation by its own README's account: no rename, no move, no codemod, no taint analysis, no SARIF, no dead-code removal, and no session memory of any kind. Its framework work links URL patterns to handlers across 17 frameworks and does it well, but does not model controller → template or model → table; it parses 34 languages against our {{ site.data.counts.languages }}. Pick codegraph when orientation in an unfamiliar codebase is the whole job and the advertised-surface budget is tight. Pick trace-mcp when the job continues past reading. → [trace-mcp vs codegraph](/vs/codegraph.html)

### trace-mcp vs Context Mode — the adjacent lane, not a rival

[Context Mode](https://github.com/mksglu/context-mode) (mksglu/context-mode, {{ site.data.competitors.context_mode.stars }} stars, TypeScript, v1.0.169) is the one entry here that is regularly mistaken for a competitor and is not one. Read at its source: its eleven advertised tools (`ctx_execute`, `ctx_execute_file`, `ctx_index`, `ctx_search`, `ctx_fetch_and_index`, `ctx_batch_execute`, `ctx_stats`, `ctx_doctor`, `ctx_upgrade`, `ctx_purge`, `ctx_insight`) sit on eight runtime dependencies that contain **no code parser at all** — no tree-sitter, and nothing that resolves a symbol, an import edge or a call edge. Its "12 languages" are subprocess runtimes for *executing* scripts the agent writes, not grammars for parsing your code; reading that number as comparable to our {{ site.data.counts.languages }} is the single easiest mistake to make about these two tools. Its headline 98% figure measures tool-output bytes across committed fixtures — Context7 docs, Playwright snapshots, vitest and tsc output, an nginx log, a 500-row CSV — not task success, and its `BENCHMARK.md` ships those fixtures, which is more than most claims in this field do.

So the two products solve different halves of the same budget. Context Mode compresses what tools *return* — browser automation, logs, big API responses — and routes the agent toward computing over data instead of reading it; trace-mcp makes questions about *code* cheap to ask. Neither substitutes for the other, and running both is a reasonable setup, with the honest caveat that you then pay both advertised surfaces at session start (its eleven tools are always fully loaded; there is no preset system and no deferred loading). Two practical notes before you adopt it: it ships under the **Elastic License 2.0**, not an OSI licence, which is a policy question at many companies before anyone reads a feature table; and its session-continuity coverage is uneven across hosts — full on Claude Code, OpenCode and KiloCode, partial on Cursor, Codex CLI and Kiro, absent on Antigravity IDE and Zed. → [trace-mcp vs Context Mode](/vs/context-mode.html)

### trace-mcp vs CodeGraphContext — the peer that drives the most SCIP indexers
{: #vs-codegraphcontext}

[CodeGraphContext](https://github.com/CodeGraphContext/CodeGraphContext) (CodeGraphContext/CodeGraphContext, started by Shashankss1205, {{ site.data.competitors.codegraphcontext.stars }} stars, Python, MIT, v0.6.13 — self-classified `Development Status :: 3 - Alpha`, last pushed September 2, 2026) goes further on compiler-grade references than anyone else here, ourselves included. Read at source today: tree-sitter parsers for the 23 languages its README lists, plus an opt-in SCIP path (`SCIP_INDEXER=true` in `~/.codegraphcontext/.env`) that shells out to **eleven** Sourcegraph indexer families — scip-python, scip-typescript, scip-go, scip-rust, scip-java, scip-clang, scip-dotnet, scip-php, scip-ruby, scip-swift and scip-ctags, covering more than twenty file extensions (nine at the September 4 reading; scip-rust and scip-swift landed since) — folds their symbol data into the same property graph, and supplements with tree-sitter for the files SCIP did not cover. We ship SCIP too and the table below says so, but our bridge auto-runs **three** (scip-typescript, scip-python, rust-analyzer) and otherwise ingests a `.scip` index you produced yourself, so their coverage of the driven-indexer path is three times ours. Both sides are opt-in and both cost the same thing: every language needs its indexer binary installed first, and C/C++ additionally need a `compile_commands.json` compilation database or CodeGraphContext logs a warning and falls back to tree-sitter for that repo. It also ships two things nobody else here has. **Bundles** are portable `.cgc` pre-indexed graph snapshots — exportable, importable, and downloadable from a public registry hosted as a Hugging Face dataset (`cgc bundle load flask`) — so you can skip indexing a dependency by fetching someone else's graph of it; no other peer, ours included, offers that. And its datasource ingesters pull **MySQL, Redis and Cassandra** structure into the graph alongside the code.

Where it differs from us is surface, storage and scope. Its `tool_definitions.py` defines **29 tools and advertises all 29** — about 3.7K tokens of schema against our ~9.8K of schema, ~11.6K once the server-instructions block we also pay at session start is counted — with an `mcp.json` `disabledTools` **denylist** as the only trimming knob, the exact opposite of codegraph's one-tool opt-in allowlist and of our presets. Storage is a decision you have to make rather than a detail you never see: six backend options (FalkorDB Lite, FalkorDB Remote, KuzuDB, LadybugDB, Neo4j, Nornic DB), defaulting to FalkorDB Lite on Unix with Python 3.12+ and documented with unusual honesty — their own dependency comments record that Kùzu was archived upstream in October 2025 and that redis-py is pinned to 5.x to keep FalkorDB Lite's Unix-socket path working. trace-mcp ships one embedded SQLite+FTS5 store and no backend question at all. Framework awareness stops at two hardcoded Java Spring tools (`find_java_spring_endpoints`, `find_java_spring_beans`) rather than {{ site.data.counts.frameworks }} integrations resolving route → handler, controller → template and model → table. And it reads and analyses rather than writes: `find_dead_code`, cyclomatic complexity and `simulate_architectural_change` all report — no refactoring, codemods, taint analysis, SARIF output or code-linked decision memory. One thing it has that our fixed tool set does not: `execute_cypher_query`, a raw graph query escape hatch, if you are willing to write Cypher.

Pick CodeGraphContext when compiler-grade references on a mainstream language justify installing an indexer toolchain, or when a pre-built bundle saves you an index you would otherwise build. If you are looking for a CodeGraphContext alternative, pick trace-mcp when you want one embedded store, framework edges and a write path. The full head-to-head, including where their reference resolution beats ours: [trace-mcp vs CodeGraphContext](/vs/codegraphcontext.html).

### trace-mcp vs SocratiCode — hybrid vector search vs zero-setup code intelligence
{: #vs-socraticode}

[SocratiCode](https://github.com/giancarloerra/SocratiCode) (giancarloerra/SocratiCode, {{ site.data.competitors.socraticode.stars }} stars, TypeScript, AGPL-3.0-only / commercial dual license, v1.13.0) pairs Qdrant vector search with ast-grep AST syntax parsing across 19 languages. It delivers hybrid dense-vector plus keyword search via Reciprocal Rank Fusion (RRF), manages cross-agent concurrency locks for multi-agent workflows, and generates an interactive in-browser HTML graph visualization with Vis.js (`codebase_graph_visualize`).

Where it differs is infrastructure and semantics. SocratiCode requires Docker running local Qdrant and Ollama containers (or external API keys), advertises all 25 tools unconditionally without preset filtering, parses syntax without resolving framework connections, and ships under copyleft AGPL-3.0. trace-mcp runs locally with zero external infrastructure (your code and index stay on your machine — see [privacy](/privacy.html))—single `npx trace-mcp` with embedded SQLite+FTS5 and local ONNX embeddings—under permissive MIT, with {{ site.data.counts.languages }} languages, {{ site.data.counts.frameworks }} framework integrations, and active refactoring tools. Full head-to-head: [trace-mcp vs SocratiCode](/vs/socraticode.html).

### trace-mcp vs TokenSave — 86 advertised tools vs framework-aware graph depth
{: #vs-tokensave}

[TokenSave](https://github.com/aovestdipaperino/tokensave) (aovestdipaperino/tokensave, {{ site.data.competitors.tokensave.stars }} stars, Rust, MIT, v7.11.1) builds a code knowledge graph stored in embedded libSQL (a SQLite fork) with tree-sitter AST parsing across 50+ languages. It defines 86 specialized MCP tools, isolates grammar parsing in subprocess worker pools to guard against tree-sitter crashes, supports opt-in multi-branch indexing, and provides string replacement edit primitives (`tokensave_str_replace`, `tokensave_insert_at`).

Where it differs is prompt overhead, framework depth, and refactoring semantics. TokenSave advertises all 85+ tools by default on standard MCP hosts (only 5 carry `anthropic/alwaysLoad`), consuming ~12-15K tokens in schema listing before the agent begins work, and its extractors capture language syntax with zero framework route/controller/model awareness. Its code modification tools operate on text replacement slices rather than semantic AST nodes. trace-mcp ships a lean 28-tool `minimal` default (~11.6K tokens), constructs typed semantic edges across {{ site.data.counts.frameworks }} frameworks, provides verified AST refactoring tools (`refactor_rename`, `refactor_extract`, `refactor_move`), and runs OWASP Top-10 taint analysis. Full head-to-head: [trace-mcp vs TokenSave](/vs/tokensave.html).

### trace-mcp vs Narsil-MCP — 4-layer RDF graph vs framework-aware code intelligence
{: #vs-narsil-mcp}

[Narsil-MCP](https://github.com/postrv/narsil-mcp) (postrv/narsil-mcp, {{ site.data.competitors.narsil_mcp.stars }} stars, Rust, MIT OR Apache-2.0, v1.7.0) models repositories according to the Code Context Graph (CCG) v0.2 specification, storing symbols and dependencies as RDF triples in an `oxigraph` SPARQL triple store with `tantivy` LZ4 search. It exposes 90 MCP tools across four presets (`minimal`, `balanced`, `full`, `security-focused`), an embedded Axum HTTP server with a React visualization SPA, and 147 syntactic security rules.

Where it differs is query ergonomics, framework depth, and code modification. Narsil-MCP exposes raw SPARQL querying over RDF triples, which introduces substantial prompt and URI hallucination overhead for AI models; trace-mcp exposes deterministic typed MCP primitives (`get_callers`, `get_change_impact`, `find_usages`). Narsil-MCP extracts syntax for 32 languages without framework route/controller/model awareness; trace-mcp constructs semantic edges across {{ site.data.counts.frameworks }} frameworks. Crucially, Narsil-MCP is strictly read-only with zero refactoring write tools and zero session memory; trace-mcp executes atomic AST refactorings (`refactor_rename`, `refactor_extract`, `refactor_move`, `refactor_codemod`) and maintains code-linked decision memory with staleness verification. Full head-to-head: [trace-mcp vs Narsil-MCP](/vs/narsil-mcp.html).

### trace-mcp vs GitNexus — permissive graph intelligence vs proprietary PolyForm clustering
{: #vs-gitnexus}

[GitNexus](https://github.com/abhigyanpatwari/GitNexus) (abhigyanpatwari/GitNexus, {{ site.data.competitors.gitnexus.stars }} stars, TypeScript / Node.js, PolyForm-Noncommercial-1.0.0, v1.6.11) is one of the largest code knowledge graph tools by stars. It pairs native C++ Tree-sitter grammars across 10 languages with embedded LadybugDB (a Kùzu fork) and in-memory Leiden community detection (`graphology-communities-leiden`) computing modularity cohesion scores (`calculateCohesion`). It exposes 17 MCP tools, including Program Dependence Graph analysis (`analyze --pdg`) with control dependence (CDG) and reaching definitions (REACHING_DEF), and an escape hatch for raw Cypher queries (`cypher`).

Where it differs is licensing, prompt efficiency, framework semantics, and write capabilities. GitNexus is distributed under PolyForm Noncommercial 1.0.0, which strictly forbids commercial and enterprise usage without a proprietary commercial license, whereas trace-mcp is 100% permissive open-source under MIT. Its raw Cypher querying tool shifts query formulation onto the LLM, inviting prompt overhead and syntax hallucinations, while trace-mcp serves typed, schema-validated MCP tools. GitNexus requires native C++ Tree-sitter builds via `node-gyp-build`, whereas trace-mcp runs anywhere via WASM-sandboxed `web-tree-sitter`. GitNexus extracts syntax without deep framework semantics, whereas trace-mcp maps {{ site.data.counts.frameworks }} frameworks (route-to-handler, controller-to-template, ORM-to-table) and provides atomic AST refactoring write tools (`refactor_rename`, `refactor_extract`, `refactor_move`, `refactor_codemod`) and OWASP Top-10 taint analysis. Full head-to-head: [trace-mcp vs GitNexus](/vs/gitnexus.html).

### trace-mcp vs ast-grep — pattern search vs a persistent graph
{: #vs-ast-grep}

[ast-grep](https://github.com/ast-grep/ast-grep) (ast-grep/ast-grep, {{ site.data.competitors.ast_grep.stars }} stars, Rust, MIT) is structural `grep`: patterns written as ordinary code with `$METAVAR` wildcards, matched against tree-sitter ASTs, rewritten in place, linted from YAML rules — multi-core, zero daemon, packaged on every installer. It is the sharpest tool in this field for shape-based rewrites ("every `x && x()` becomes `x?.()`"), and it wins that job outright against anything graph-shaped. What it has no answer for is the edge: no stored call graph, no transitive impact, no framework relations, no MCP surface — per-invocation scans rather than an index an agent queries across forty turns. Pick ast-grep for codemods and CI lint; pick the graph when the question is structural or the session is long. Full head-to-head: [trace-mcp vs ast-grep](/vs/ast-grep.html).

### trace-mcp vs Continue — the agent vs the index it queries
{: #vs-continue}

[Continue](https://github.com/continuedev/continue) (continuedev/continue, {{ site.data.competitors.continue_dev.stars }} stars, TypeScript, Apache-2.0) is the pioneering open-source coding agent: VS Code extension, JetBrains plugin and CLI with bring-your-own-model configuration. Read its maintenance notice before adopting — the README states the repository is read-only after its final 2.0.0 release. The comparison is barely a rivalry: Continue is the loop you talk to, trace-mcp is the persistent graph ({{ site.data.counts.languages }} languages, {{ site.data.counts.frameworks }} framework integrations, SQLite + FTS5) that any agent queries for scoped structural answers instead of re-reading files. If you run a maintained agent today, the graph composes with that one instead. Full head-to-head: [trace-mcp vs Continue](/vs/continue.html).

### trace-mcp vs Aider — the terminal loop vs the graph beside it
{: #vs-aider}

[Aider](https://github.com/Aider-AI/aider) (Aider-AI/aider, {{ site.data.competitors.aider.stars }} stars, Python, Apache-2.0) is the terminal pair programmer everything else is measured against: repo map into the prompt, edit, lint/test retries, auto-commit with sensible messages, against almost any model including local ones. The map is the best "just give the model context" mechanism here, and on repos that fit in context it is simpler and often cheaper than any graph. Where it stops is edges and persistence: the map is rebuilt per session and the model re-derives structure from text, while the graph stores callers, impact and framework wiring as queryable edges with code-linked memory across sessions. Run the loop for edits; query the graph for the structural question before each one. Full head-to-head: [trace-mcp vs Aider](/vs/aider.html).

### trace-mcp vs Cody — enterprise cloud search vs a local graph
{: #vs-cody}

Cody was Sourcegraph's AI assistant on hosted code search — and the status notice comes first: Free, Pro and Starter ended July 23, 2025, the `sourcegraph/cody` repository is a 404, and only Cody Enterprise for existing customers plus an archived snapshot ({{ site.data.competitors.cody.stars }} stars) remain. What Cody Enterprise still owns is org-wide search over local and remote repos with someone else operating the infrastructure — the one thing a local-first tool cannot offer. What trace-mcp offers instead is the index living with the code: no account, no per-seat meter, no code leaving the machine, with framework edges and cross-session memory the hosted assistant does not keep. Full head-to-head: [trace-mcp vs Cody](/vs/cody.html).

### trace-mcp vs ripwire — the per-call map vs the stored graph
{: #vs-ripwire}

[ripwire](https://github.com/redhat-et/ripwire) (redhat-et/ripwire, {{ site.data.competitors.ripwire.stars }} stars, C++, Apache-2.0) is the ripgrep of AI context: a zero-dependency offline binary rendering a ranked map — signatures, callers, blast radius, tests-to-run, quality deltas — per invocation, with the MCP server deliberately optional because schemas cost context. It is also the best-argued peer here: published evals with the defeats named, per-edge honesty labels, verdict-style outputs for orchestrators. The gap is the narrowest on this site — per-call map versus persistent index, CLI pipe versus MCP core product, syntax-and-calls versus {{ site.data.counts.frameworks }} framework edges with an AST write path. Full head-to-head: [trace-mcp vs ripwire](/vs/ripwire.html).

### trace-mcp vs IDE context — authored guidance vs derived structure
{: #vs-ide-context}

Cursor rules (`.cursor/rules`, team rules, `AGENTS.md`) and Copilot instructions (repo-wide file plus path-specific instruction files) are markdown guidance telling the agent how to work here — versioned, glob-scoped, team-enforceable, nearly free. No instruction file holds an edge: "check callers before editing" still sends the agent searching, while the graph answers in one call. Rules carry team judgement the code cannot contain; the graph carries resolved structure the rules cannot contain. Keep the rules; add the graph underneath. Full head-to-head: [trace-mcp vs IDE context](/vs/ide-context.html).

### If you are comparing two of the alternatives to each other

Not every reader arrives having already picked us. [Repomix vs codegraph](/vs/repomix-vs-codegraph.html) puts those two head-to-head on their own terms — packing versus indexing — with where each is honestly weak (Repomix computes nothing; codegraph leaves a larger context footprint and says so; neither one writes code; neither benchmark is third-party) and where trace-mcp sits between them.

## Verification methodology

How the rows below are checked, and when. Star counts render from
`docs/_data/competitors.yml`, re-read from the live GitHub API rather than
carried forward; a project not in that file keeps the figure from the pass that
last checked it, written with a `~`. Rows not named in a pass were not
re-checked in it.

### Pass of September 26, 2026 — current

- **Three new head-to-head spokes (TRA-1948 batch 2)**: [trace-mcp vs Cody](/vs/cody.html) (`sourcegraph/cody` is a 404; count from archived `sourcegraph/cody-public-snapshot`, {{ site.data.competitors.cody.stars }} stars, TypeScript, Apache-2.0 — Enterprise-only since July 23, 2025), [trace-mcp vs ripwire](/vs/ripwire.html) (redhat-et/ripwire, {{ site.data.competitors.ripwire.stars }} stars, C++, Apache-2.0, v0.6.3 — zero-dependency CLI map + optional MCP server, published evals with losses), [trace-mcp vs IDE context](/vs/ide-context.html) (conceptual — Cursor rules and Copilot instructions per their docs, no repo, no stars). Read via web fetch of each README/docs at `main` plus the GitHub API for stars, license and language on September 26, 2026. Star re-check: ripwire 1.9K → **2.3K** (2,341). Hub subsections above written for the hub, not pasted from the spokes.
- Rows for other projects were not re-checked in this pass and carry the September 11 figures.

### Pass of September 26, 2026 (batch 1)

- **Three new head-to-head spokes (TRA-1948 batch 1)**: [trace-mcp vs ast-grep](/vs/ast-grep.html) (ast-grep/ast-grep, {{ site.data.competitors.ast_grep.stars }} stars, Rust, MIT — structural search/lint/rewrite CLI, no MCP server in README), [trace-mcp vs Continue](/vs/continue.html) (continuedev/continue, {{ site.data.competitors.continue_dev.stars }} stars, TypeScript, Apache-2.0 — open-source coding agent, README states read-only after final 2.0.0), [trace-mcp vs Aider](/vs/aider.html) (Aider-AI/aider, {{ site.data.competitors.aider.stars }} stars, Python, Apache-2.0 — terminal pair programmer with repo map, no MCP server in README). Read via web fetch of each README at `main` plus the GitHub API for stars, license and language on September 26, 2026. Star counts added to `docs/_data/competitors.yml`; hub subsections above written for the hub, not pasted from the spokes.
- Rows for other projects were not re-checked in this pass and carry the September 11 figures.

### Pass of September 11, 2026

- **Dedicated comparison page for GitNexus ({{ site.data.competitors.gitnexus.stars }} stars)**: added [trace-mcp vs GitNexus](/vs/gitnexus.html) comparing trace-mcp's permissive MIT license, {{ site.data.counts.frameworks }} framework semantic integrations, typed MCP tools, and AST refactoring write tools against GitNexus's LadybugDB, Leiden community clustering, and raw Cypher queries under PolyForm Noncommercial 1.0.0.
- **First source read of grafel** (cajasmota/grafel, Go, MIT, v0.x, 15 stars), the top priority from the previous pass's queue. Read through the GitHub API at `main`: `go.mod`, `cmd/grafel/`, `internal/mcp/`, `internal/substrate/`, `internal/responseshapediff/`, `internal/tautology/`, `internal/stubdetector/`, `internal/mmapview.go`. Corrected language: written in **Go** (Go 1.23+ with cgo Tree-sitter), not Rust as assumed prior to source reading. It implements a multi-repo code knowledge graph daemon for AI agents with 22 MCP tools, in-memory/mmap graph substrate (`mmapview.go`), cross-repo HTTP payload drift (`response_shape_diff_tool`, `payload_drift_tool`), and static code quality canaries (`tautology_detector_tool`, `stub_detector_tool`). No AST refactoring, no framework route-to-handler mappings, no session decision memory. Findings and take-or-pass decisions are in the profiling depth tracker at the end of this page.
- **Star re-check against the GitHub API** for all tracked competitors: trace-mcp **175**, codegraph 70.3K → **70.5K** (70,454), codebase-memory-mcp 42.8K → **42.9K** (42,922), code-review-graph 31.3K (31,320), Serena 29.1K → **29.2K** (29,165), Repomix 28.3K (28,288), context_mode 21.7K → **22.1K** (22,064), CodeGraphContext 4.2K (4,180), SocratiCode 3.3K (3,294), jCodeMunch 2.7K (2,680), ripwire 1.8K → **1.9K** (1,885), TokenSave 623 → **624**, AFT 278 → **279**, CodeGraph (codegraph-ai) 83 → **85**, ai-architect-codebase **4**, GitNexus 47.1K → **47.2K** (47,217), Code Pathfinder **140**, grafel **15**.
- Rows for other projects were not re-checked in this pass and carry the September 9 figures.

### Pass of September 9, 2026

- **First source read of GitNexus** (abhigyanpatwari/GitNexus, TypeScript / Node.js, PolyForm-Noncommercial-1.0.0, 47,177 stars), the top priority from the previous pass's queue. Read through the GitHub API at `main`: `package.json`, `gitnexus/package.json`, `gitnexus/src/mcp/tools.ts`, `gitnexus/src/core/ingestion/community-processor.ts`, `gitnexus/src/core/ingestion/pipeline.ts`, `gitnexus/src/core/lbug/`. Monorepo containing CLI, web UI, and MCP server. Native C++ Tree-sitter bindings across 10 languages (TS, JS, Python, Go, Rust, C#, C++, Java, PHP, Ruby). Storage pairs embedded LadybugDB graph database (`@ladybugdb/core` / Kùzu fork) with Cypher query execution, `graphology`, and in-memory Leiden community detection (`graphology-communities-leiden`) computing cohesion scores (`calculateCohesion` = internal calls / total edges). Features Program Dependence Graph (`analyze --pdg`) recording control dependence (CDG) and reaching definitions (REACHING_DEF). Defines 17 MCP tools (`list_repos`, `query`, `cypher`, `context`, `detect_changes`, `check`, `rename`, `impact`, `explain`, `pdg_query`, `route_map`, `tool_map`, `shape_check`, `api_impact`, `group_list`, `group_sync`, `trace`). Commercial use prohibited under PolyForm Noncommercial 1.0.0. Findings and take-or-pass decisions are in the profiling depth tracker at the end of this page.
- **First source read of Code Pathfinder** (shivasurya/code-pathfinder, Go + Python, Apache-2.0, v2.1.1, 140 stars), also from the previous pass's queue. Read through the GitHub API at `main`: `server.json`, `sast-engine/mcp/tools.go`, `sast-engine/graph/initialize.go`, `sast-engine/graph/callgraph/builder/builder.go`, `sast-engine/graph/callgraph/doc.go`. Static code analysis engine with 13 MCP tools (`get_index_info`, `find_symbol`, `find_module`, `list_modules`, `get_callers`, `get_callees`, `get_call_details`, `resolve_import`, `find_dockerfile_instructions`, `find_compose_services`, `get_dockerfile_details`, `status`, `get_docker_dependencies`) for Python, Go, Java, Dockerfiles, and Docker Compose. Uses 5-pass iterative indexing: module registry mapping (Pass 1), return type & variable assignment extraction (Pass 2), class attribute resolution (Pass 3), type-inferred call site resolution (Pass 4), and taint summaries (Pass 5). Dedicated IaC parsers index Dockerfile multi-stage builds and docker-compose services. No AST refactoring, no session memory, and no framework route mapping. Findings and take-or-pass decisions are in the profiling depth tracker at the end of this page.
- **First source read of AFT** (cortexkit/aft, Rust + TypeScript, MIT, 278 stars), the sensorimotor cortex for coding agents (OpenCode + Pi), part of CortexKit. Read through the GitHub API at `main`: `Cargo.toml`, `crates/aft/src/commands/`, `packages/opencode-plugin/src/tools/`, `packages/pi-plugin/src/tools/`. It implements a shared persistent Rust daemon (`BridgePool`) per project root speaking JSON-over-stdio, 30 tree-sitter grammars for symbol outline and zoom, structural `ast_grep_search` / `ast_grep_replace`, trigram-indexed grep, semantic chunk embeddings, and an in-process LSP client. Findings and take-or-pass decisions are in the profiling depth tracker at the end of this page.
- **Star re-check against the GitHub API** for all tracked competitors: trace-mcp **175**, codegraph 70.1K → **70.3K** (70,255), codebase-memory-mcp 42.7K → **42.8K** (42,776), code-review-graph 31.3K (31,287), Serena 29.0K → **29.1K** (29,088), Repomix 28.3K (28,268), context_mode 21.6K → **21.7K** (21,682), CodeGraphContext 4.2K (4,179), SocratiCode 3.3K (3,292), jCodeMunch 2.7K (2,676), ripwire 1.8K (1,823), TokenSave **623**, AFT **278**, CodeGraph (codegraph-ai) 82 → **83**, ai-architect-codebase **4**, GitNexus **47.2K** (47,177), Code Pathfinder **140**.
- Rows for other projects were not re-checked in this pass and carry the September 8 figures.

### Pass of September 8, 2026

- **First source read of Narsil-MCP** (postrv/narsil-mcp, Rust, MIT OR Apache-2.0, v1.7.0, 182 stars), the top priority from the previous pass's queue. Read through the GitHub API at `main`: `Cargo.toml`, `src/tool_metadata.rs`, `src/config/preset.rs`, `src/taint/`, `src/persistence/sparql.rs`, `docs/architecture.md`, and `docs/ccg-spec.md`. It corrected the table: written in **Rust** (edition 2021), **90 MCP tools across 4 presets** (`minimal` 20-30 tools, `balanced` 40-50, `full` 70+, `security-focused` ~30), 32 tree-sitter languages, Code Context Graph (CCG) 4-layer progressive disclosure (Layer 0 manifest ~1-2KB JSON-LD, Layer 1 architecture ~10-50KB, Layer 2 symbol index ~100-500KB N-Quads, Layer 3 full RDF ~1-20MB), WebACL triple-heart access control model, `oxigraph` SPARQL triple store, `tantivy` LZ4 search, and Axum HTTP + embedded React visualization. No AST refactoring, no session memory, no framework edges. Findings and take-or-pass decisions are in the profiling depth tracker at the end of this page.
- **First source read of RTK** (rtk-ai/rtk, Rust, Apache-2.0, 79,509 stars), the viral CLI token-killer proxy. Read through the GitHub API at `master`: `Cargo.toml`, `README.md`, `src/cmds/system/read.rs`, `src/core/filter.rs`, `src/cmds/git/`, `src/cmds/js/vitest_cmd.rs`. It clarifies positioning: RTK is a high-performance shell execution proxy intercepting dev commands (`ls`, `git`, `grep`, `cargo test`, `npm test`, `pytest`, `docker ps`) and compressing stdout by 60–90% before it enters context. It contains no tree-sitter, no AST parsing, no symbol resolution, and no code graph. It sits in the adjacent shell proxy lane alongside Context Mode and Headroom, complementing rather than competing with code-graph tools. Findings and take-or-pass decisions are in the profiling depth tracker at the end of this page.
- **First source read of claude-mem** (thedotmack/claude-mem, TypeScript, Apache-2.0, v13.24.1, 93,476 stars), the leading session memory tool for Claude Code. Read through the GitHub API at `main`: `package.json`, `src/servers/mcp-server.ts`, `src/services/smart-file-read/`, `src/services/sqlite/types.ts`. It tracked its expansion into code exploration via `smart_search`, `smart_outline`, and `smart_unfold` with 24 tree-sitter grammars parsing and folding code on the fly (`walkDir`). It keeps no persistent graph, no cross-file edges, no call graph, no framework awareness, and no AST refactoring. Memory is linked to file paths rather than symbol IDs, with no staleness verification against git or code AST. Findings and take-or-pass decisions are in the profiling depth tracker at the end of this page.
- **First source read of Token Savior** (Mibayy/token-savior, Python, 1,146 stars, v4.0), read through the GitHub API at `main`: `src/token_savior/server.py`, `src/token_savior/diagnostics.py`, `src/token_savior/tool_schemas.py`, `src/token_savior/tool_annotations.py`. It defines 75 tools with an adaptive `auto` and `optimized` profile. Its key innovations are `get_diagnostics` (wraps project's declared typechecker `tsc`/`mypy`/`pyright`, bounds errors, maps error lines to enclosing symbols via AST symbol index), `_thin_input_schema` (strips sub-property descriptions, saving 44% manifest tokens), and standard MCP `ToolAnnotations` (`readOnlyHint`). Findings and take-or-pass decisions are in the profiling depth tracker at the end of this page.
- **First source read of TokenSave** (aovestdipaperino/tokensave, Rust, MIT, v7.11.1, {{ site.data.competitors.tokensave.stars }} stars), from the previous pass's priority queue. Read through the GitHub API at `master`: package metadata, `Cargo.toml`, `server.json`, `src/mcp/tools/definitions.rs`, `src/mcp/server.rs`, `src/tokensave/memory.rs`, `src/tokensave/staleness.rs`, `src/accounting/`, and the extraction worker pool (`src/extraction_worker.rs`). It corrected the table: written in **Rust** (edition 2021), embedded libSQL (SQLite fork) + FTS5 with ONNX Runtime (`ort`) embeddings, **86 MCP tools defined and 85+ advertised on standard MCP hosts** (only 5 carry `anthropic/alwaysLoad: true`), costing ~12-15K tokens in schema overhead per session start; tree-sitter AST parsing across 50+ languages in three feature tiers; subprocess worker crash isolation; bounded catch-up sync ceiling (2,000 files); and string replacement primitives. Head-to-head analysis: [trace-mcp vs TokenSave](/vs/tokensave.html). Findings and the take-or-pass on each mechanism are in the profiling depth tracker at the end of this page.
- **Star re-check against the GitHub API** for all tracked competitors: trace-mcp 170 → **173**, codegraph 69.9K → **70.1K** (70,101), context_mode 20.5K → **21.3K** (21,323), codebase-memory-mcp 42.5K → **42.7K** (42,671), Serena 28.9K → **29.0K** (29,038), Repomix 28.2K → **28.3K** (28,251), code-review-graph 31.2K → **31.3K** (31,262), CodeGraphContext 4.2K (4,176), SocratiCode 3.3K (3,293), jCodeMunch 2.7K (2,673), ripwire 1.7K (1,731), TokenSave 621 → **622**, CodeGraph (codegraph-ai) 80 → **82**.
- Rows for other projects were not re-checked in this pass and carry the September 7 figures.

### Pass of September 7, 2026

- **Category-wide audit of what anyone here measures besides tokens.** Every project on this page with a benchmark tree had that tree read at source — not its headline — to answer one question: does its published measurement grade the *answer*, or only the cost of getting there. Ten projects classified, five benchmark methodologies read in full. The result is the new section [Does anyone here measure quality, or only tokens?](#does-anyone-here-measure-quality-or-only-tokens) — four peers grade retrieval, one grades the agent's own opinion, none runs a baseline-versus-tool comparison of task correctness, and one of them ships a CI gate we do not have.
- **First source read of SocratiCode** (giancarloerra/SocratiCode, TypeScript, AGPL-3.0-only / commercial dual, v1.13.0, {{ site.data.competitors.socraticode.stars }} stars), the highest-star direct code-graph MCP peer remaining unprofiled at source. Read through the GitHub API at `main`: package metadata, `src/constants.ts`, `src/config.ts`, `src/index.ts`, and all tool implementations in `src/tools/`. It corrected the table: **{{ site.data.competitors.socraticode.stars }} stars** (3,287, not ~900), **25 MCP tools advertised by default** (not 21), Docker-managed Qdrant vector DB (`:16333`) + Ollama (`:11435`) storage, AST parsing across 19 languages via `@ast-grep/napi` with zero framework awareness, and an interactive browser HTML visualizer (`codebase_graph_visualize`). Head-to-head analysis: [trace-mcp vs SocratiCode](/vs/socraticode.html). Findings and the take-or-pass on each mechanism are in the profiling depth tracker at the end of this page.
- **First source read of CodeGraph** (codegraph-ai, Rust, Apache-2.0, v0.20.1), from the previous pass's priority queue. Read through the GitHub API at `main`, no clone and nothing executed: root metadata, `Cargo.toml`, `crates/codegraph/`, `crates/codegraph-server/` (the dual LSP/MCP backend and tool registrar), `crates/codegraph-memory/` (storage and vector embeddings), and the individual parser crates. It corrected the table: written in **Rust** (43-crate Cargo workspace, edition 2021), not C as GitHub's linguist tag implied from vendored grammars. Findings and the take-or-pass on each are in the profiling depth tracker at the end of this page.
- **Star re-check against the GitHub API** for all tracked competitors: trace-mcp 158 → 166, Serena 28.8K → 28.9K (28,926), codebase-memory-mcp 42.1K → 42.5K (42,504), codegraph 69.4K → 69.9K (69,891), Context Mode 20.3K → 20.5K (20,508), code-review-graph 31.2K (31,230), CodeGraphContext 4.2K (4,169), CodeGraph (codegraph-ai) 80, SocratiCode 3.3K (3,287).
- Rows for other projects were not re-checked in this pass and carry the September 5 figures.

### Pass of September 5, 2026

- **First source read of LeanKG** (FreePeak, Rust, Apache-2.0), the largest remaining table entry whose architecture had never been read. Read through the GitHub API at `main`, no clone: repository metadata, `src/mcp/tools.rs`, `src/mcp/toon.rs`, `src/mcp/token_budget.rs`, `src/budget.rs`, and the per-client packaging directories. Findings and the take-or-pass on each are in the profiling depth tracker at the end of this page.
- **First source read of Roam-Code** (Cranot/roam-code, Python, Apache-2.0), the largest table entry whose architecture had never been read. Read through the GitHub API at `main` plus the published release artefacts, no clone and nothing executed: repository metadata, `src/roam/mcp_server.py` (the preset tables and the tool registrar), `docs/mcp-tools.md`, `README.md`, and the two benchmark trees under `benchmarks/`. Three table cells moved and the one method gap it exposed was closed the same day; findings and the take-or-pass on each are in the profiling depth tracker at the end of this page.
- **First source read of Repomix**, the largest entry in the table and the last one still standing on a README. Read through the GitHub API at `main`, no clone: the MCP server and its eight tool modules, the token-budget guard, the tree-sitter compression path, and the skill generator. The row understated it — findings and the take-or-pass on each are in the profiling depth tracker at the end of this page.
- **First source read of marm-memory**, and it corrected the row: the project delegates code indexing to another project's MCP server rather than doing it, which changes what it is in this table. Details and the decision are in the profiling depth tracker at the end of this page.
- Rows for other projects were not re-checked in this pass and carry the September 3 figures.

### Pass of September 3, 2026

- **All five head-to-head peers re-read at source** for the per-competitor summaries above; star counts, licences and versions from the GitHub API.
- **codegraph** — its single-advertised-tool default, eight tool names, 34 languages and 17 routing frameworks, from its own source and README.
- **Serena** — tool registry recounted: 50 tool classes, 22 optional, 28 enabled by default, down from the 52 / 23 / 29 read on August 30, plus fifteen client contexts and nine modes.
- **Context Mode** — eleven `ctx_*` tools, eight runtime dependencies with no code parser among them, the Elastic-2.0 licence and the per-host session-support table.
- **codebase-memory-mcp** — 162 languages, 15 tools, and the `--tool-profile scout` / `analysis` allowlists at seven and eleven tools.
- **Repomix** — v1.18.0, the `--watch` 300 ms debounce and its local-only restriction.
- **One figure dropped rather than carried forward.** Repomix's "~70% reduction" is no longer published in its README or its code-compress guide, so this page quotes no percentage for `--compress`.

### Pass of September 2, 2026

- **First source read of the incremental-graph peer.** code-review-graph, cloned at commit `b58668751ab0`. Findings are in the fifth mechanism under "Deep dive"; the profiling depth tracker at the end of this page records what was read.
- **Re-read of the largest peer's tool surface** at its current commit, to confirm a claim this page had been carrying from an older reading. It held.
- **Star figures re-checked against the GitHub API** for both, and both had moved.

### Pass of August 30, 2026

- **Second, deeper source read of Serena**, the largest LSP-native peer. It corrected four rows in Serena's favour — see [trace-mcp vs Serena](/vs/serena.html) for the detail.
- **Star re-check against the API**, each figure re-read rather than carried forward: trace-mcp 100 → 102, Repomix corrected to 28.1K (one table still carried a stale ~26.7K, contradicting the other), codebase-memory-mcp 41.1K → 41.2K, mem0 ~53K → ~64.3K, ConPort 761 → 765, Graphify 110.6K → 112.4K, Headroom 67.6K → 68.1K, codegraph → 68.7K.
- **Deep-dive on the two 60K+-star entrants flagged in a previous revision.** **Graphify** (Python, deterministic AST-to-knowledge-graph skill/MCP server, no vector store): its edge provenance tagging (`EXTRACTED`/`INFERRED`/`AMBIGUOUS`) is a 3-tier scheme trace-mcp's 4-tier `resolution_tier` already exceeds, and its Cypher/GraphML export is a feature trace-mcp already ships (`export_graph`). **Headroom** (Python, reversible tool-output/JSON/log compression layer — library, HTTP proxy or MCP server): compresses arbitrary tool output generically rather than understanding code structure, orthogonal to a code-graph server. Neither closes a real gap; see their rows and footnotes below.
- **"Honest assessment" rewritten** after six of seven identified gaps shipped and went through an adversarial deep-validation pass.

### Standing caveats

- **Star counts are a snapshot, not a ranking.** Counts in this space can jump 3–4× on a trending spike and reverse just as fast.
- **Download counts are not used, ours or theirs.** npm totals are heavily inflated by registry mirrors that re-crawl the whole version history on every publish: for trace-mcp on 2026-08-29, 104 published versions each showed a near-uniform 136–198 weekly downloads while the median version sat at 2 — real users pull `latest`, crawlers enumerate. Stripping publish days leaves an organic baseline of ~20–50/day against a headline of 4,551/28d. The same mechanism applies to every peer here, so a competitor's self-reported download number is not comparable evidence in either direction. Stars and GitHub traffic uniques are the adoption metrics used on this page.
- **Everything else is from public documentation and public repositories.** If you maintain one of these projects and see an inaccuracy, [open an issue](https://github.com/nikolai-vysotskyi/trace-mcp/issues) and we will fix it.

## vs. token-efficient code exploration

Tools that help AI agents read code with fewer tokens — AST parsing, outlines, context packing.

| Capability | trace-mcp | Repomix | Context Mode | code-review-graph | jCodeMunch | codebase-memory-mcp | cymbal |
|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.repomix.stars }} | {{ site.data.competitors.context_mode.stars }} | {{ site.data.competitors.code_review_graph.stars }} | {{ site.data.competitors.jcodemunch.stars }} | {{ site.data.competitors.codebase_memory_mcp.stars }} | 165 |
| Tree-sitter AST parsing | ✓ {{ site.data.counts.languages }} languages | ✓ compress only (~20) | ✗ no code parsing | ✓ 23 langs + Jupyter | ✓ 70+ languages | ✓ 162 languages | ✓ 22 languages |
| Token-efficient symbol lookup | ✓ outlines, symbols, bundles | ✗ packs entire files | ✗ no symbol index — compresses tool *output* instead | ✓ | ✓ core focus (~95% reduction) | ✓ | ✓ outline/show/context |
| Cross-file dependency graph | ✓ directed edge graph | ✗ | ✗ | ✓ incremental knowledge graph | ✓ import graph | ✓ knowledge graph | ✓ refs/importers |
| Framework-aware edges | ✓ {{ site.data.counts.frameworks }} integrations | ✗ | ✗ | ✗ | ✓ 21 frameworks (route/middleware) | partial (REST routes) | ✗ |
| Impact analysis | ✓ reverse dep traversal + decorator filter | ✗ | ✗ | ✓ blast-radius + Leiden communities | ✓ blast radius + decorator filter | ✓ detect_changes | ✓ impact command |
| Call graph | ✓ bidirectional, graph-based | ✗ | ✗ | ✓ graph-based | ✓ AST-based, bidirectional | ✓ trace_call_path | ✓ refs/importers |
| Refactoring tools | ✓ rename, extract, dead code, codemod | ✗ | ✗ | ✗ | ✗ (dead code detect only) | ✗ | ✗ |
| Security scanning | ✓ OWASP Top-10, taint | ✓ Secretlint | ✗ | ✗ | ✗ | ✗ | ✗ |
| Multi-repo subprojects | ✓ cross-repo API linking | ✓ remote repos | ✗ | ✓ multi-repo daemon | ✓ GitHub repos | ✓ cross-service HTTP linking | ✗ |
| IaC as graph nodes | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ K8s/Kustomize/HCL/Docker | ✗ |
| Session memory | ✓ built-in | ✗ | ✓ SQLite FTS5 journal | ✗ | ✓ index persistence | ✓ persistent graph | ✗ |
| Written in | TypeScript | TypeScript | TypeScript | Python | Python | C | Go |

_New entrants since April 2026 (local code-graph / packing lane, worth tracking): **Repomix** ships an official MCP server (`--mcp`) + tree-sitter `--compress` (signatures kept, bodies dropped); **tokensave** ({{ site.data.competitors.tokensave.stars }} stars, 86 tools, 50+ langs, Rust/libSQL; see [vs tokensave](/vs/tokensave.html)); **token-savior** (Mibayy/token-savior, 1.1K stars, 75 tools, Python — AST navigation, git symbol diff, and type-checker diagnostics mapped to enclosing symbols); **RTK** (rtk-ai/rtk, 79.5K stars, Rust — CLI proxy intercepting shell commands to compress stdout by 60–90%, adjacent shell proxy lane complementing code graphs); **codegraph** (colbymchenry — function-level dep graph, tree-sitter→SQLite, auto-sync; went viral this cycle, now {{ site.data.competitors.codegraph.stars }} stars; its August 2026 re-measurement claims 62% fewer tokens / 88% fewer tool calls / 44% lower cost across seven repos, with model, queries, run count and a correction to its own earlier harness disclosed — self-run, not third-party reproduced, and the most transparent self-benchmark in this field; see [vs codegraph](/vs/codegraph.html)); **Headroom** (headroomlabs-ai/headroom, renamed from `chopratejas/headroom`; 69.2K stars — not a code-graph tool, a generic reversible compression layer for tool outputs/JSON/logs/RAG chunks, deployable as library/proxy/MCP server; its `CodeCompressor` is AST-aware for 7 languages but purely for shrinking output bytes, with no graph, no symbol index, no cross-file edges — complements rather than competes with token-efficient *symbol* lookup); **repo-context-mcp** (nduc99911, 103 stars, TypeScript — three tools: `repo_map` directory tree + entrypoint detection, `search_code` substring grep, `pack_context` token-budgeted markdown pack; no AST parsing, no symbol index, no dependency graph — a lighter-weight cousin of Repomix, not a code-graph competitor). `cymbal` could not be re-verified in June 2026 — possibly renamed or inactive. `Context Mode` **is** active and got its source deep-dive on August 30, 2026 (mksglu/context-mode, {{ site.data.competitors.context_mode.stars }} stars): eleven MCP tools, all advertised, and **no code parser at all** — its eight runtime dependencies contain no tree-sitter, and none of its tools resolves a symbol, an import edge or a call edge. Its "12 languages" are subprocess runtimes for *executing* agent-written scripts, not grammars for parsing your code, and its 98% figure measures tool-output bytes on 14 committed fixtures rather than task success. It also ships under the Elastic License 2.0 rather than an OSI licence. It compresses what tools return; we make questions about code cheap to ask — adjacent lanes that compose rather than compete. See [vs Context Mode](/vs/context-mode.html). The June "could not verify" note was wrong and is retracted here._

**codebase-memory-mcp's stars more than doubled over two revisions (18.1K → 41.0K verified via GitHub API) — the fastest single-project jump we've tracked in this doc.** Its authors also published a benchmark preprint (arXiv 2603.27277: "Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCP") reporting 83% answer quality, 10× fewer tokens, and 2.1× fewer tool calls vs. file-by-file exploration across 31 real-world repos — the first published third-party-style benchmark from a direct code-graph peer (vs. the self-reported numbers most others cite). We have not independently reproduced it. This doesn't change our positioning (see "Honest assessment" below) but is worth flagging: a fast-growing peer with a real benchmark paper is a sharper competitive signal than a star count alone.

## vs. AI session memory

Tools that persist context across AI agent sessions — activity logs, knowledge graphs, memory compression.

| Capability | trace-mcp | Kage | MemPalace | claude-mem | mem0 / OpenMemory | engram | ConPort |
|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | new (2026) | ~56.7K | 93.5K | ~64.3K | ~6.4K | 765 |
| Cross-session context carryover | ✓ `get_wake_up { scope: "resume" }` + decisions | ✓ git-committed packets | ✓ wings/rooms | ✓ core focus | ✓ multi-level (User/Session/Agent) | ✓ branch-scoped handoffs | ✓ |
| Cross-session content search | ✓ `search_sessions` FTS5 | partial (JSON packets) | ✓ vector+keyword+temporal (+optional rerank), 96.6% R@5 LongMemEval | ✓ SQLite + Chroma hybrid | ✓ hierarchical, ≤7K tok/retrieval (94.4 LongMemEval) | ✓ local ONNX embeddings | ✓ vector semantic |
| Decision knowledge graph | ✓ temporal, code-linked | ✓ temporal, code-linked | ✓ temporal + "Closets" storage | ✗ | ✓ temporal + state-key supersession | ✗ | ✓ project-level |
| Code-graph-aware memory | ✓ decisions → symbols & files | ✓ **+ citation verification (staleness check)** | ✗ text-only | ✗ text-only | ✗ text-only | ✗ text-only | ✗ text-only |
| Auto-extraction from sessions | ✓ pattern-based (0 LLM calls); hybrid LLM opt-in | ✗ agent-written | ✗ verbatim, zero extraction | ✓ AI-compressed + citations | ✓ single-pass hierarchical LLM | ✗ | ✗ |
| Wake-up context | ✓ ~300 tok (code-linked decisions) | — | ✓ ~170 tok (AAAK) | ✓ progressive disclosure (~10×) + Endless Mode | ✗ | ✗ | ✗ |
| Decision enrichment in tools | ✓ impact/plan_turn/resume | ✗ | ✗ standalone | ✗ | ✗ | ✗ | ✗ |
| Service/subproject scoping | ✓ decisions per service | ✗ | ✓ wings per project | ✗ | ✗ | ✓ per branch | ✓ per workspace |
| Published retrieval benchmark | ✗ | ✗ | ✓ LongMemEval / LoCoMo / MemBench | ✗ | ✓ LoCoMo / LongMemEval / BEAM | ✗ | ✗ |
| Code intelligence included | ✓ {{ site.data.counts.tools }} tools, 180+ edge types | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| Works as standalone memory | ✗ code-focused | ✓ git-native, code-focused | ✓ general-purpose | ✗ Claude-specific | ✓ agent-agnostic | ✓ agent-agnostic | ✓ project-scoped |
| Written in | TypeScript | — | Python | TypeScript | TS + Python | Go / Rust | Python |

> **Key difference:** MemPalace stores "decided to use PostgreSQL" as text in ChromaDB. trace-mcp stores the same decision **linked to `src/db/connection.ts::Pool#class`** — and when you run `get_change_impact` on that symbol, the decision shows up in `linked_decisions`. General-purpose memory tools remember *what you said*. trace-mcp remembers *what you said* AND *which code it's about*.
>
> **Where the field moved (April → June 2026):** (1) Retrieval became a *published number* — mem0 (94.4 LongMemEval, ≤7K tok/retrieval) and MemPalace (96.6% R@5) both ship benchmarks; trace-mcp's decision recall is still FTS5-only with no published figure. (2) **Kage** is the first peer to share trace-mcp's code-linked-memory premise *and* add what trace-mcp lacks: it verifies each memory's cited code at recall and diff time, withholding decisions whose code was renamed/deleted (claimed 0% stale-served). (3) mem0 added search-time temporal decay (1.5× recency / 0.3× stale) and state-key supersession — close analogs to trace-mcp's `order_by:"heat"` and `invalidate_decision`, but automatic.

## vs. documentation generation & RAG

Tools that generate docs from code or provide embedding-based code search for AI retrieval.

| Capability | trace-mcp | Repomix | DeepContext | smart-coding-mcp | mcp-local-rag¹ | knowledge-rag¹ |
|---|:---:|:---:|:---:|:---:|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.repomix.stars }} | ~300 | ~200 | ~200 | ~60 |
| Real-time code understanding | ✓ live graph, always current | ✗ snapshot at pack time | ✗ manual reindex | partial (opt-in watcher) | ✗ | partial (file watcher) |
| Auto-generated project docs | ✓ `generate_docs` from graph | ✗ raw file dump | ✗ | ✗ | ✗ | ✗ |
| Semantic code search | ✓ `search` + `query_by_intent` | ✗ no search | ✓ Jina embeddings | ✓ nomic embeddings | ✓ vector search | ✓ hybrid + reranking |
| Framework-aware context | ✓ routes, models, components | ✗ | ✗ | ✗ | ✗ | ✗ |
| Task-focused context | ✓ `get_task_context` — code subgraph | ✗ packs everything | ✗ | ✗ | ✗ | ✗ |
| No doc maintenance needed | ✓ derived from code | ✓ repacks on demand | ✗ manual reindex | partial (auto on startup) | ✗ manual ingest | partial (auto-reindex) |
| Works offline, no API keys | ✓ graph + FTS5 + bundled ONNX embeddings | ✓ | ✗ requires cloud API | ✗ requires local embeddings | ✗ requires local embeddings | ✗ requires local embeddings |
| Incremental updates | ✓ file watcher, content hash | ✗ full repack | ✓ SHA-256 hashing | ✓ file hash + opt-in watcher | ✗ | ✓ mtime + dedup |
| Written in | TypeScript | TypeScript | TypeScript | JavaScript | TypeScript | Python |

_¹ mcp-local-rag and knowledge-rag are document RAG tools (PDF, DOCX, Markdown) — not code-specific. Included for comparison as they occupy adjacent mindshare._

> **Key difference:** RAG tools answer "find code similar to this query." trace-mcp answers "show me the execution path, the dependencies, and the tests for this feature." Graph traversal finds structurally relevant code that embedding similarity misses — and never returns stale results because the graph updates incrementally with every file save. (Independent evidence: the *CodeCompass* study, arXiv 2602.20048, reports +23.2 pp on hidden-dependency tasks from graph navigation over grep-style retrieval.)

## vs. code graph MCP servers

| Capability | trace-mcp | Serena | code-review-graph | codebase-memory-mcp | SocratiCode | Narsil-MCP | Roam-Code |
|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.serena.stars }} | {{ site.data.competitors.code_review_graph.stars }} | {{ site.data.competitors.codebase_memory_mcp.stars }} | {{ site.data.competitors.socraticode.stars }} | {{ site.data.competitors.narsil_mcp.stars }} | ~510 |
| Languages | {{ site.data.counts.languages }} | 40+ (73 LSP backends) | 23 + Jupyter | 161 | 19 | 32 | 28 |
| Framework integrations | {{ site.data.counts.frameworks }} | ✗ | ✗ (Python entry points only) | ✗ | ✗ | ✗ | ~15 (ORM N+1 / API drift only) |
| Cross-language edges | ✓ | ✗ | ✗ | ✓ cross-service HTTP | ✓ polyglot dep graph | ✗ | ✓ PHP↔TS API drift |
| MCP tools advertised (default) | 29 `minimal` (~11.6K tok², default); 61 `standard` (~20.5k tok); {{ site.data.counts.tools }} `full` (~52K) | 28 default (50 defined) | ~28 | 15 all / 11 `analysis` / 7 `scout` (~7K tok, schema only) | 25 (~5.2K tok) | 90 | 246 defined / 17 default `core` (8 presets) |
| Session memory | ✓ | ✓ (notes, not code-linked) | ✗ | ✓ | partial (context artifacts, not code-linked) | ✗ | ✗ |
| CI/PR reports | ✓ | ✗ | ✓ blast-radius GitHub Action | ✗ | ✗ | ✗ | ✓ SARIF 2.1.0 + GH/GL/Azure |
| Multi-repo subprojects | ✓ | partial (`query_project`, optional, no cross-repo edges) | ✓ multi-repo daemon | ✓ cross-service | ✓ cross-project search | ✗ | ✗ |
| Control-flow / data-flow | ✓ CFG w/ basic blocks + loop back-edges + dataflow | ✗ | ✗ | ✗ | ✓ `codebase_flow` (call flow) | ✓ CFG w/ basic blocks + loop edges; type-aware taint | ✗ |
| Security scanning | ✓ OWASP/taint, type-aware pruning | ✗ | ✗ | ✗ | ✗ | ✓ 147 rules (taint/OWASP/CWE) + SBOM + OSV/supply-chain | ✗ |
| IaC as graph nodes | ✓ K8s/Kustomize/HCL/Docker, cross-file resolved to real nodes | ✗ | ✗ | ✓ K8s/Kustomize/HCL/Docker | ✗ | ✗ | ✗ |
| Compiler-grade precision | ✓ opt-in LSP + offline SCIP ingestion (`scip_resolved` tier) | ✓ live LSP (rename/refs/diagnostics) | ✗ | ✗ | ✗ | ✗ | ✗ |
| SARIF / CI-scanning output | ✓ 2.1.0, OASIS-schema-validated | ✗ | ✓ blast-radius GitHub Action | ✗ | ✗ | ✗ | ✓ SARIF 2.1.0 + GH/GL/Azure |
| Graph visualization | ✓ desktop app (cosmos.gl) | ✗ | ✗ | ✓ 3D web UI | ✓ interactive HTML | ✓ SPA frontend | ✗ |
| Knowledge graph queries | ✓ `graph_query` | ✗ | ✗ | ✓ Cypher-like | ✗ | ✓ SPARQL / RDF | ✗ |
| Refactoring tools | ✓ rename/move/signature/codemod/extract¹ | ✓ rename/safe-delete; move/inline via JetBrains bridge only | ✗ | ✗ | ✗ | ✗ | ✗ |
| Antipatterns / clone detection | ✓ 11 antipatterns + 4 code smells (debug artifacts across 10 langs) + AST Type-2 subtree hashing + name/signature duplication | ✗ | ✗ | ✓ MinHash near-clone + Louvain communities | ✗ | ✗ | ✓ 23 patterns + AST Type-2 subtree hashing |
| Architecture governance | ✓ | ✗ | ✓ Leiden communities | ✓ Louvain communities | ✗ | ✗ | ✓ change-safety gates |
| Token savings tracking | ✓ | ✗ | ✓ (~65× median claimed, whole-corpus baseline) | ✓ | ✓ (~61% claimed) | ✗ | ✓ (−80% input tokens claimed on a 41-cell A/B, labelled measured-at-an-older-kernel) |
| Written in | TypeScript | Python | Python | C | TypeScript | Rust | Python |

_² Our token figures are the **whole session-start cost**: `tools/list` schema plus the server-instructions block, because that is what a client actually pays before asking anything. The schema-only split is in the measurement table under "Deep dive" below (`minimal` is ~9.8K schema + ~1.75K instructions). Peer figures are quoted on whatever basis their own source supports and labelled where it differs._

_¹ `apply_codemod` now rewrites on `@ast-grep/napi` (true AST pattern matching, metavariable substitution, no false matches in strings/comments) with automatic regex fallback for non-AST languages; the native binding loads lazily and degrades to regex instead of crashing if missing. `extract_function` is re-enabled with AST free-variable analysis — it detects genuine multi-return-value slices and rejects them with a structured error rather than silently dropping a binding, and lowers `confidence` on shadowed-variable cases instead of misreporting them as clean (see "where competitors lead" below for what deep validation found)._

_New entrants since April 2026 (direct code-graph MCP peers): **grafel** (Rust, multi-repo daemon, cross-repo + IaC topology, watcher-driven, FlatBuffer in-memory graph); **GitNexus** (MCP-native KG, Leiden communities with cohesion scores); **Code Pathfinder** (5-pass AST indexing, NL queries, dataflow); **CodeGraphContext** (tree-sitter **+ optional SCIP indexers** → property graph — profiled at source on September 4, 2026; see [its summary above](#vs-codegraphcontext)); **Graphify** (Python, 112.4K stars — deterministic tree-sitter AST → knowledge graph over 13 languages plus docs/SQL schemas/configs/PDFs/images, no vector store, `/graphify` Claude Code skill or standalone `--mcp` server, `--neo4j` Cypher export, `--wiki` crawlable markdown output; 3-tier edge provenance (`EXTRACTED`/`INFERRED`/`AMBIGUOUS`) is coarser than trace-mcp's 4-tier `resolution_tier`, and it has no refactoring tools, security scanning, or framework-aware edges). Serena's "debugger tool", noted here in an earlier revision as a native feature, is on a re-read of the source an **optional beta bridge into a running JetBrains IDE** (`JetBrainsDebugTool`, alongside twelve other `JetBrains*` tools that proxy to their plugin) — it is not a debugger Serena implements, and it is off by default._

_**depgraph.ai** (archview-ai, closed source, hosted) is the one peer on this SERP that is not in the table above, because it is not the same product: it indexes **third-party packages, not your repository**. Verified on its own site September 6, 2026 — it publishes one curated remote MCP endpoint per public package (`https://mcp.archcontext.ai/github_<owner>_<repo>_branch_<branch>/mcp`, e.g. `github_shadcn-ui_ui_branch_main`), advertising find / trace / prove over that package's functions, classes and files across 20+ languages. There is nothing to run locally and nothing to point at your own code. Pricing is per user per month with quota measured in MCP-delivered context: Free 20 MB, Pro $15 / 100 MB, Max $75 / 400 MB. Its pricing page links a community repository at `github.com/archview-ai/depgraph-community`; that URL returned 404 on September 6, 2026, and the `archview-ai` account has one unrelated public repo, so there is no source to read and no star count to quote — which is why it is absent from `docs/_data/competitors.yml`, whose every entry must name a checkable repository. **Take:** complementary, not competing. Understanding a dependency you did not write and navigating the code you did write are different questions; a reader comparing the two should know they can hold both._

> **Why framework awareness matters:** A graph that knows `UserController` exists but doesn't know it renders `Users/Show.vue` via Inertia is missing the edges that matter most. Framework integrations turn a syntax graph into a **semantic** graph — the agent sees the same connections a developer sees.

## Deep dive: how the two largest peers shape their tool surface

Both of the biggest projects in this space (by stars) made the same product call, independently, and it is the one place they are clearly ahead of trace-mcp today. Verified by reading their source on August 28, 2026, not their READMEs.

**The {{ site.data.competitors.codegraph.stars }}-star entrant (colbymchenry/codegraph, v1.6.0, TypeScript with a Rust kernel)** defines eight MCP tools — search, callers, callees, impact, node, explore, status, files — and by default **advertises exactly one of them**. `DEFAULT_MCP_TOOLS` is the single-element set `{explore}`; the rest stay fully implemented and re-enablable through a `CODEGRAPH_MCP_TOOLS` allowlist env var, but are not listed to agents. The stated reason, in a source comment: every other tool is a narrower slice of what `explore` already does, and *presence itself steers mis-picks*. Their whole advertised surface costs roughly **1,900 tokens** (~390 tokens of schema plus a ~5.8K-character server-instructions block). Two further mechanisms are worth noting: (1) `explore` carries a per-project **adaptive output budget** — total output cap, default file count, per-file cap and clustering threshold all tier on indexed file count, explicitly kept under the host's ~25K-char inline tool-result cap so the result is never externalised to a file the agent has to read back; (2) their file-reading tool deliberately mirrors the host's native Read contract byte-for-byte (`offset`/`limit`, `<n>\t<line>` output, "safe to Edit from") so it can be substituted for Read rather than competing with it.

**The {{ site.data.competitors.codebase_memory_mcp.stars }}-star entrant (DeusData/codebase-memory-mcp, pure C)** ships 15 MCP tools (~7K tokens of schema) and adds **tool profiles**: `--tool-profile=scout` exposes 7, `--tool-profile=analysis` exposes 11, default exposes all 15. Re-verified September 3, 2026: 162 languages (up from 161), Hybrid LSP semantic type resolution across 12 languages, and two tools we had not catalogued — `manage_adr` (create/replace an Architecture Decision Record document) and `ingest_traces` (ingest runtime caller/callee counts to enrich the graph). Supply-chain posture is a deliberate selling point: SLSA Level 3, VirusTotal scanning of three behaviourally identical release candidates, OpenSSF Scorecard.

**Take:** `manage_adr` is a flat markdown document with get/update/sections modes — not code-linked memory, and no reason to copy it; trace-mcp's decisions already bind to symbol IDs and surface inside `get_change_impact`. `ingest_traces` is a genuinely missing capability (runtime-observed dynamic call edges that static analysis cannot see) but is a three-field payload — a thin veneer, worth revisiting only if users ask. The 161-language race stays out of lane, as before.

**What we took — and where it landed.** The August 2026 pass recorded a *default* tool surface small enough to be honest about as the thing to fix, and named a specific bug: the preset gate was silently bypassed on the default daemon-backed path, pinning every session at the full surface. **That is now shipped and closed.** Re-measured on August 30, 2026 with a real `initialize` + `tools/list` round-trip against the built server, reading the wire payload rather than counting names:

| Configuration | Tools | `tools/list` wire | Server instructions |
|---|---:|---:|---:|
| `preset: "minimal"` (shipped default) | 28 | ~9.8K tok | ~1.75K tok |
| `preset: "standard"` | 55 | ~18.8K tok | ~1.75K tok |
| `preset: "full"` (explicit opt-in) | 166 | ~49.9K tok | ~2.1K tok |
| `standard` + `description_verbosity: "none"` | 55 | ~8.4K tok | 0 |

The tool counts in that table are what *this* repo serves, not the preset's ceiling: registration is gated on detected frameworks, so `minimal` (29 tools) hits its ceiling here while `standard` (61 tools) serves 56 of its 61 and `full` ({{ site.data.counts.tools }} tools) serves 166. Quote the ceilings when comparing on paper and the live numbers when comparing session cost — the comparison table above quotes ceilings, so it stays checkable in CI. Measure the live surface on a cold index and you will read low: framework-gated registration only settles once the first index pass completes (a cold run measured 24 / 54 / 165).

So the honest default is **~11.6K tokens, not the ~51K this page used to quote** — a 2.5× correction in our own favour, caused by four landed changes (preset honoured on the daemon path, seven deprecated aliases retired, `compact_schemas` extended to the whole surface, and the default preset moved to `minimal` once `load_tools` made everything outside it one call away) that this page had not caught up with. The `minimal` row's ~9.8K is derived, not re-measured: the preset grew 25 → 28 tools and 30,540 → 34,041 serialized chars when it absorbed the always-load set, +11.5% on the ~8.8K that was measured live.

**A third mechanism worth reading, from the budget-policy peer (GlitterKill/SDL-MCP, 467 stars, TypeScript; source read August 29, 2026, not its README).** It solves the same problem *losslessly* rather than by dropping tools. `src/gateway/index.ts` registers **four** namespace tools — `sdl.query`, `sdl.code`, `sdl.repo`, `sdl.agent` — each of whose wire schema is a `oneOf` over per-action envelopes (`buildGatewayWireSchema` in `src/gateway/thin-schemas.ts`), with the 29 flat tool names kept only as deprecated aliases behind `emitLegacyTools`. `src/gateway/compact-schema.ts` then flattens the union and deduplicates repeated sub-schemas into `$defs`/`$ref` before the schema ever reaches `tools/list`. Two further pieces sit on top: `src/mcp/response-projection/budgets.ts` quantises every tool *result* into eight fixed budget classes (120 / 200 / 500 / 1K / 2K / 8K tokens) rather than accepting an arbitrary caller number, with `Math.min(class, callerCap, 8K)` as the rule; and a result that overflows its class is returned as an opaque **handle** (`responseMode: "handle"`, recovered in 8 KiB pages) instead of being truncated, so nothing is silently lost. Their stated reason for fixed classes is that a size that varies per call makes responses prompt-cache-unstable — the same reasoning drives an explicit ban on timestamps, durations, session IDs, counters and machine paths in default responses.

**Take, with numbers rather than admiration:**
- **Namespace projection: not now.** It would take our 55-tool `standard` surface toward a handful of advertised entries, but it is a breaking change to every tool name, and it moves tool selection from the model's native tool-picker into a `oneOf` discriminator — a real accuracy risk we would be trading blind. Revisit only if the default surface stops shrinking by other means.
- **`$defs`/`$ref` deduplication: measured and rejected.** MCP gives every tool its own `inputSchema`, so `$ref` cannot be shared across tools — only within one. Measured on our own full surface, *all* duplicated property definitions across 165 tools total ~7.5 KB (~2.1K tokens, 4% of the wire), and the top offenders are already small (`output_format` ×10 = 2.6 KB, `detail_level` ×5 = 1.2 KB). Deduplication only pays after gateway consolidation puts many actions under one schema. Filed nothing; this closes the idea.
- **Handles instead of truncation: worth taking**, and independent of the two above.
- **Fixed budget classes: worth taking**, same reason.

**A fourth mechanism, from the largest LSP-native peer (oraios/serena, {{ site.data.competitors.serena.stars }} stars, Python; source read August 30, 2026 at commit `7fcbca7e`, not its README).** It is the only peer that shapes its tool surface along *two* axes instead of one, and the axes are not the one we use.

Serena has no persistent code *graph*: its `solidlsp` layer drives 73 language-server backends live (the README's "over 40 languages" counts languages, not backends), so there is no incremental index, no impact analysis, no PageRank, no co-change. It is not stateless, though — an earlier revision of this page said "every symbol query is an LSP round-trip", and a second source read (August 30, 2026, commit `43ae021`) found two pickled per-file document-symbol caches under `.serena/cache/<language>/`, versioned and keyed by content hash, loaded at startup. Warm symbol lookups survive a restart; what is never stored is edges. The rest of the comparison is about tool-surface shaping, which is where it is genuinely ahead.

The two axes are **context** (who is calling) and **mode** (what phase the work is in). Sixteen context files under `src/serena/resources/config/contexts/` — `claude-code.yml`, `codex.yml`, `vscode.yml`, `chatgpt.yml`, `desktop-app.yml` and so on — each carry an `excluded_tools` list and a per-client `prompt`. Ten mode files (`planning`, `editing`, `one-shot`, `no-memories`, …) carry a second `excluded_tools` list plus phase-specific instructions. `ToolSet.apply()` in `src/serena/agent.py` composes them as ordered set operations over a default-enabled registry, with `included_optional_tools` re-adding, `fixed_tools` overriding wholesale, and a `LEGACY_TOOL_NAME_MAPPING` so renames don't break configs.

Three details are worth recording precisely, because they are the reasoning and not just the shape:

1. **A host's native tools are treated as capability already present, not as competition.** The `claude-code` context excludes `read_file`, `create_text_file`, `find_file`, `list_dir`, `search_for_pattern` and `execute_shell_command` — six tools, deleted from the wire, on the stated grounds that a CLI agent already has them. The `codex` context excludes a slightly different set (it keeps `search_for_pattern`, drops `replace_content`). The suppression list is a per-host claim, and it is data in a YAML file rather than a branch in code.
2. **The prompt names the agent's rationalizations and pre-refutes them.** The `claude-code` prompt does not stop at a routing table; it carries an explicit "Disallowed reasoning" block listing the three excuses agents use for falling back to a native read — "I already know the path", "one Read call is faster than three Serena calls", "the built-in tool description says to use Read for known paths" — and instructs that catching yourself on one of them *is* the signal to switch. This is the same enforcement goal the budget-policy peer pursues by generating client-side hook files, solved in-band for the cost of a few hundred tokens and no files written to the user's repo.
3. **Per-host wire quirks are configuration too.** `structured_tool_output: false` in the `claude-code` context exists because that host does not unpack structured tool output and re-escapes it; `single_project: true` drops project-switching tools entirely whenever a project is given at startup, rather than advertising a switcher that cannot be used.

**Take, with the boundary drawn:**
- **Client-aware tool suppression: taking it.** We read `clientInfo` at `initialize` and currently discard it. Our preset answers "how much capability", which is the right coarse knob and stays; what it cannot express is "this host already has a file reader". The two compose — profile filters after preset — and unlike every other remaining lever on advertised cost, this one gives up no capability, because a tool the host already provides was never ours to lose. Filed as a scoped issue with a per-profile wire measurement required before merge.
- **Rationalization-refuting instructions: taking it,** and separately, because it is a prompt change that can land on its own. Our block routes but does not persuade; the evidence that routing alone is insufficient is in our own repo, where the development instructions needed a pre-tool hook to stop the fallback the routing table had already forbidden. Budget is the constraint: net-neutral or cheaper against the current ~1.75K, measured on the wire, with the behavioural ratio measured rather than assumed.
- **Modes (phase-scoped tool sets): passing for now.** Contexts are inferable — the host tells us who it is. A mode is not: it needs the user to declare "I am planning" versus "I am editing", and a knob nobody sets is a knob that costs documentation and delivers nothing. Revisit only if a host ever surfaces its own phase.
- **`fixed_tools` / wholesale override: already covered** by `load_tools` plus explicit preset config; adding a third override path would be strictly more surface for the same outcome.

**A fifth mechanism, from the incremental-graph peer (tirth8205/code-review-graph, {{ site.data.competitors.code_review_graph.stars }} stars, Python; source read September 2, 2026 at commit `b58668751ab0`, not its README).** It is not a tool-surface idea at all — on that axis this peer is the furthest behind, registering 29 `@mcp.tool()` handlers in `code_review_graph/main.py` and advertising every one of them by default; its own docstring puts the cost at "~8k description tokens per LLM turn" and offers only a manual opt-in allowlist (`serve --tools ...` / `CRG_TOOLS=`) to trim it. The idea worth taking is somewhere else entirely: `code_review_graph/uncertainty.py` treats **an empty result as a first-class answer that owes the caller a reason**.

The reasoning in that file's own module docstring is the part that generalises. A bare `result_count: 0` is ambiguous between "the code really has no such relationship" and "this graph cannot see that relationship" — the target was never indexed, the graph is behind the working tree, or the language has a known static-analysis blind spot. An agent reads the first meaning, then either draws a wrong conclusion or abandons the graph and scans the whole repository by hand. So a single capped sentence on the empty case is a token *saving*, not a cost: roughly thirty tokens of honesty in place of a multi-thousand-token fallback. The implementation keeps that trade honest — a hard `MAX_CONFIDENCE_CHARS = 140` budget, attached only when the result list is empty, so every response that carries results stays byte-identical.

What makes it more than a nice message is that the blind spots are **data keyed by (language, query pattern)**, not scattered conditionals: a `LanguageGap` table pairs a language set with the exact query patterns the gap can affect, so a container-resolution caveat lands on `callers_of` and `tests_for` and never on a file summary, whose empty result has nothing to do with call resolution.

**Take, with the boundary drawn:**
- **Empty-result confidence markers: taking it.** Zero-result answers on our navigation and impact tools should say whether the zero is real or a known limit, under a hard character cap, and only when the result set is empty.
- **A hand-maintained gap table: passing, and we can do better.** Their table is written by hand and has to be pruned by hand as gaps get fixed (the docstring says exactly that). We already store a `resolution_tier` on every edge (`scip_resolved` > `lsp_resolved` > `ast_resolved` > `ast_inferred` > `text_matched`), so the same note can be *derived* from the actual resolved-edge share for that language in the indexed repository, and it goes stale on its own when the numbers move. Their edge model carries only two values here — `EXTRACTED` and `INFERRED`, with `INFERRED` written by the scoped resolver on rewrite — which is why they cannot derive it and we can.
- **Their headline token figure: passing on the framing.** The current README claims ~65× median per-question reduction across six repositories (36×–376×, re-captured 2026-08-02), against a whole-corpus baseline that the same README concedes "no real agent pays". Our own comparable figure comes from real merged pull requests rather than a synthetic upper bound, and we should keep it that way.

Their storage model is otherwise conventional and holds no surprise for us: a single SQLite file with `nodes` / `edges` / `metadata` tables, qualified-name strings rather than ids as edge endpoints, tree-sitter via `tree-sitter-language-pack`, networkx for traversal, igraph only as an optional extra for communities. → [trace-mcp vs code-review-graph](/vs/code-review-graph.html)

## Does anyone here measure quality, or only tokens?

Every project on this page that publishes a number publishes a *cost* number.
This section asks the other question — whether the tool changes how well the
agent does the job — and answers it by reading each project's own benchmark
tree rather than its headline. Read September 7, 2026 through the GitHub API;
nothing was cloned or executed.

The axis that matters is not "is there a benchmark". It is **what is being
graded, against what ground truth, and next to what baseline.** Retrieval
metrics grade the ranked list. Capability inventories grade whether a tool can
answer at all. Only an answer-level arm grades the thing a user actually cares
about: did the agent get it right.

| Project | What its published benchmark grades | Baseline arm | Ground truth | Published a result against itself |
|---|---|---|---|---|
| **trace-mcp** | Answer level — did the review understand the change | Naive file loading | The PR's own diff, judged blind | Yes |
| jCodeMunch | Tokens; separately nDCG@k / MRR@k / Recall@k | grep-top-3 and read-all | Pinned `(query, expected ids)` fixtures | Yes, repeatedly |
| code-review-graph | Impact precision/recall, search quality | grep-top-3 | Git co-change, plus a circular mode labelled as one | Yes |
| LeanKG | Context precision/recall/F1 and tokens | No-tool arm | Committed `ground_truth.json` | Yes |
| codegraph | Retrieval recall and MRR | Per-benchmark A/B | Expected symbol lists | Per-experiment |
| Serena | Capability delta over built-in tools | Built-in tools, same tasks | None — the agent judges itself | Yes, qualitatively |
| codebase-memory-mcp | Whether each tool answers 12 questions per language | None | Hand-graded PASS/PARTIAL/FAIL | Per-language scores |
| Roam-Code | Tokens and turns | Vanilla agent | Preregistered targets | Yes — publishes MISSED |
| Context Mode | Tool-output bytes | Uncompressed output | Committed fixtures | No |
| CodeGraphContext, SocratiCode, CodeGraph (codegraph-ai) | No quality benchmark — parser micro-benchmarks or one perf script | — | — | — |

What that table means, project by project, in the places where the summary line
is doing too much work:

- **[jCodeMunch alternative](/vs/jcodemunch.html) is the most careful token benchmark in this field, and it says
  so about its own limits first.** `benchmarks/METHODOLOGY.md` states in its
  scope section that the benchmark "does **not** measure answer quality,
  latency, or end-to-end task completion". Every modelling choice in its
  realistic baseline is documented as made *against* itself — grep costed at
  `rg -l` paths only, with a note that costing matched lines instead would move
  its own headline from ~28× to ~49×. It also ships the one retrieval-quality
  **CI gate** anyone in this field runs: a replay harness of pinned query
  fixtures scoring aggregate nDCG/MRR/Recall, wired to a workflow that exits
  non-zero if any metric drops more than 2% relative to a committed golden
  baseline.
- **code-review-graph runs the honest-ground-truth argument in source.** Its
  impact benchmark emits two ground-truth modes side by side and names the first
  one `"graph-derived (circular — upper bound)"` in a string constant, with a
  docstring explaining that recall in that mode is an upper bound by
  construction. The second mode seeds one changed file and grades against the
  *other* files the author touched in the same commit. A second docstring
  records that a thrown analysis used to fall back to `predicted = set(changed)`,
  "guaranteeing a fake recall of 1.0" — a self-inflicted defect published rather
  than quietly fixed.
- **Serena is the only peer measuring anything at the workflow level, and it
  argues explicitly against ground truth.** Its evaluation is one prompt, ~20
  tasks run twice — once with its tools, once with built-ins — across five
  agent/codebase pairs, with the agent acting as both executor and judge. The
  methodology page devotes a section to why fixed-answer benchmarks are a poor
  fit for an augmentation layer. The reports do carry negative deltas honestly
  (small edits ~4.5× cheaper with built-ins). What they cannot carry is a
  correctness rate: there is nothing to be correct against.
- **codebase-memory-mcp's quality benchmark has no baseline arm.** Its published
  `docs/BENCHMARK.md` grades whether its own tools answer 12 questions per
  language, with up to five retry strategies per question — a capability
  inventory, not a delta. The design that *would* be a delta, a blind LLM-judge
  A/B against a Grep/Glob/Read arm with randomized labels and a position-bias
  check, is a careful piece of work and is unexecuted: `docs/EVALUATION_PLAN.md`
  opens by stating it "is a **plan, not a result set**" and "contains no scores".
- **Roam-Code's preregistration is still the best method move anyone here has
  made**, and we adopted it. Its agent-eval matrix (4 agents × 3 modes × 5
  build tasks) would be an answer-quality measurement if it ran; the tree holds
  prompts and scoring scripts with no result set, and its score is computed by
  the product's own health command — the tool under test grading its own effect.

**So the position, stated plainly: measuring the cost of context is normal here,
and measuring what the context does to the answer is not.** Four projects grade
retrieval — which list came back — and one grades the agent's own opinion of the
workflow. None publishes a baseline-versus-tool comparison of whether the agent
got the task right. That is the arm this project runs: the same
{{ site.data.pr_context_quality.pr_count }} merged pull requests reviewed twice,
scored blind against each PR's own diff, at
{{ site.data.pr_context_quality.trace_understood }} understood against naive file
loading's {{ site.data.pr_context_quality.baseline_understood }} and
{{ site.data.pr_context_quality.trace_false_positives }} false positives per PR
against {{ site.data.pr_context_quality.baseline_false_positives }}. It is one
task, one packing strategy and one judge, and it is not offered as proof of
anything wider. Its credential is the run before this one: on September 6, 2026
the same harness published **MISSED** on both preregistered bars — 50%
understood against the naive arm's 65%, a 15-point loss — and that verdict
stayed on [the preregistration page](/perf/prereg-pr-quality/) while the defect
behind it was found and fixed. A bar you can fail is the only kind worth
declaring.

**And the one place this audit puts us behind — which is not where we expected.**
A retrieval-quality regression gate is deterministic and costs no model calls:
frozen query fixtures, aggregate rank and recall metrics, a committed golden
baseline, a build that fails on a relative drop. We already have that harness.
`benchmarks/replay/` holds the fixtures and `scripts/replay-eval.ts` scores
them against `benchmarks/replay/baseline.json`. What we do not have is the wire:
no workflow runs it, no contributor doc mentions it, and the committed baseline
is dated April 30, 2026 at a flat 1.0 on every metric. So between a ranking
change and a release there is nothing — the harness that would object has not
run in four months. That is worse than not having one, because the file in the
tree reads like coverage. Filed internally against the existing context-quality
gate work.

## Honest assessment: where competitors lead

No tool is uniformly ahead. trace-mcp is the only one combining framework-aware code intelligence + a refactoring engine + code-linked session memory in a single local MCP server — but on individual axes, specialists go deeper. As of July 2026, six of the seven gaps identified in the June re-verification have shipped and gone through an adversarial deep-validation pass (not just unit tests — a second pass that tried specifically to break each feature). That pass surfaced real bugs, which is itself worth being transparent about:

**Shipped and adversarially validated:**

- **AST-based rewrite engine.** `apply_codemod` now runs on `@ast-grep/napi` (true AST pattern matching, metavariable substitution, no false matches in strings/comments), auto-falling back to the regex engine for non-AST languages. `extract_function` is re-enabled with AST free-variable analysis. Deep validation found and fixed a real crash risk: the native `.node` binding can be silently dropped by npm's known optional-dependency bug (npm/cli#4828), and the codemod/extract modules did static top-level imports of it — meaning a missing binding **crashed the whole MCP server at startup**. Fixed with lazy loading and graceful degradation (verified via a real fresh `npm install` reproducing the drop). Also found and fixed: a shadowed-variable slice could reference the wrong out-of-scope binding in the generated `return`; a genuine multi-return-value slice silently dropped the second binding instead of being rejected; a zero-match codemod returned a hard tool-call error for the normal "nothing to change" outcome.
- **Compiler-grade reference precision via SCIP.** A new `scip_resolved` edge tier (above `lsp_resolved`) ingests precomputed `.scip` indexes (scip-typescript / scip-python / rust-analyzer→SCIP) offline — no live language-server process needed. Deep validation ran a **real `scip-typescript` indexer** end-to-end (not just synthetic protobuf bytes) and found the subsystem produced **zero `scip_resolved` edges on any real input, ever** — two decoder bugs (a length-field evaluation-order bug that corrupted every subsequent read; range fields decoded as zig-zag instead of plain varint, corrupting every position) had passed the original synthetic tests only because the hand-written test fixture shared the same wrong assumptions as the buggy decoder. Both fixed and locked in with a permanent captured-`.scip` regression fixture.
- **Staleness verification of code-linked memory.** `query_decisions`/`get_wake_up` now verify a decision's linked `symbol_id` still resolves and its source is unchanged since `created_at` before serving it — the Kage-style guarantee. Deep validation found the "fail open" contract (never hide a decision just because verification itself errored) was not actually enforced — an internal Store error propagated uncaught, and the recall-timeout fallback then silently returned an *empty* list, i.e. fail-closed data loss disguised as fail-open. Fixed. Also found and fixed a performance issue: verifying 100 decisions could take ~3.1s (synchronous git subprocess spawns per decision); memoized to ~95ms for the common case of decisions clustered on a handful of files (the fully-scattered worst case is unchanged and remains open, see below).
- **Decision-retrieval quality + a tracked benchmark.** `query_decisions` now fuses FTS5 + embedding similarity (reusing the existing Signal Fusion engine) with FTS5 as the zero-dependency fallback, plus a tracked recall@k/MRR benchmark. Deep validation found the benchmark *script* itself was broken (pointed at a build path that doesn't exist under this repo's bundled output) and had silently drifted from the tracked fixture it was supposed to measure. Fixed to run against the real fixture; corrected numbers: recall@1=0.594, recall@3=recall@5=0.969, MRR=0.823.
- **SARIF 2.1.0 output.** `scan_security` / `detect_antipatterns` / `check_quality_gates` now support `output_format: "sarif"`. Deep validation installed a JSON-schema validator and checked real generated payloads against the actual OASIS SARIF 2.1.0 schema (not just eyeballed the shape) — all required fields validated across all three finding shapes. Also found and fixed: the embedded `$schema` URL pointed at a moved/dead (404) location; corrected to the canonical OASIS URL.
- **Real CFG with loop back-edges.** `get_control_flow` now emits loop back-edges, loop-exit edges, and try/catch/finally merge nodes instead of a branch-only tree. Deep validation found and fixed a real pre-existing bug independent of the back-edge feature: the do-while detector matched *any* identifier starting with "do" (`doOuter()`, `document.write()`, `download(x)`) as a loop, injecting phantom back-edges and corrupting cyclomatic complexity on ordinary code. Verified separately: nested loops get correctly independent back-edges, `break` doesn't create a false back-edge, `continue` is modeled distinctly, switch/case fallthrough is branches not a flattened block.
- **Type-aware SAST.** `taint_analysis` now prunes flows that provably terminate at a non-string value (numeric/boolean coercion). Deep validation focused on the highest-risk failure mode for a security tool — silent false negatives from over-pruning — and found two real ones: a variable narrowed to numeric at one point but reassigned to attacker-controlled string input *before* the sink was still (wrongly) pruned; string concatenation and template-literal taint propagation (`s = '' + id`, `` `p-${id}` ``) wasn't tracked at all, producing zero flows for classic injection shapes. Both fixed; verified the fixes don't regress the pruning itself (`String(x)` casts and non-sanitizing look-alike wrappers still flag correctly).
- **IaC as first-class graph nodes.** K8s manifests, Kustomize overlays, and docker-compose→Dockerfile links are now `Resource`/`Module` graph nodes with `imports` edges, not just `get_artifacts` discoveries. Deep validation found the cross-file resolution was worse than "not wired": Kustomize/compose import edges were persisting as **useless source→source self-loops**, and a second bug meant multiple resource references (`resources: [a.yaml, b.yaml]`) silently collapsed into a single edge because they shared one SQLite `INSERT OR IGNORE` key. Fixed with a real post-pass resolver (modeled on the existing wikilink resolver) that now correctly traverses Kustomize Module → Resource and compose service → Dockerfile. Also found Terraform/HCL module→source edges were fully implemented but silently dropped at persist time for lack of a source symbol — fixed.

**Closed the same day it was found (September 5, 2026).** The September 5 profiling pass found one project in this table doing something none of the rest do, us included: it commits a preregistration *before* it measures — question, metric formula, frozen corpus, a pass bar declared unadjustable after seeing data, a recorded prediction — then publishes a **MISS** against its own bar together with a control showing the bar had been calibrated against a corpus nobody can obtain. Our numbers were measured but neither preregistered nor stamped with the build they came from. Both figures on public surfaces now carry a preregistration ([PR review context](/perf/prereg-pr-context/), [aggregate response tokens](/perf/prereg-response-tokens/)), each labelled retrospective because the bars were written after the results were known, and each carries the version and commit it was measured at. The response-token figure publishes as **MISSED**, twice and on opposite halves of its bar. The first run cleared 25% at 29.3% but covered only 88.4% of recorded call volume against a declared 90%. Measuring the tail took coverage to 97.2% and the figure down to 21.1% — the unmeasured calls held the worst per-call ratios in the product, plus 1,731 calls to mutating tools that had been credited a `Read`/`Grep` baseline they never had. So the second run clears coverage and misses the headline. The bar was declared unadjustable and was not adjusted; the figure stays on the storefront at 21% with the miss stated next to it. `tests/docs/savings-claims.test.ts` fails CI on a published figure without a stamp or a preregistration.

**Still genuinely open (honest, not closed by the validation pass):**

- **Advertised tool-surface cost — narrowed ~4.4×, still behind.** Re-measured August 30, 2026: the shipped default is the `minimal` preset at 28 tools / ~9.8K tokens of `tools/list` plus ~1.75K tokens of server instructions — ~11.6K in total, down from the ~51K this page quoted in August. (`standard`, an explicit opt-in, has a 60-tool ceiling and serves 55 of them here, for ~18.8K.) The preset-bypass bug behind that number is fixed and closed. The remaining gap is real but no longer embarrassing: the two largest peers advertise ~1,900 and ~7K tokens, i.e. ~6× and ~1.7× cheaper than our default. Both buy that with a smaller *capability* surface (one peer advertises a single tool); we buy ours by deferring 141 tools out of the default and keeping them one `load_tools` call away. What is still ours to fix is that ~54% of the wire is *descriptions* — measured on the 55-tool `standard` surface, 37.1 KB of the 67.2 KB payload, of which 22.4 KB is tool descriptions and 14.7 KB parameter descriptions. (The earlier "~57% / 22.5 KB of 67.7 KB" reading on this page mixed the two: the KB figure was tool descriptions alone, the percentage was both.) `description_verbosity: "none"` cuts that same surface to 29.4 KB — roughly halving whichever preset you run — but at a cost to tool-selection accuracy nobody has measured. A middle setting that keeps the first sentence and drops the rest is the obvious unexplored win.



- **Validated code-health metric.** A temporal-holdout calibration script now correlates `predict_bugs`/`get_risk_hotspots` against real future-fix commits on this repo (churn Spearman ≈0.34, precision@20 ≈2.1–2.4× over random) and the tool descriptions were reworded to honest "heuristic triage" language. This is evidence, not CodeScene-grade external validation — the gap to a peer-reviewed, cross-repo-validated metric remains.
- **Worst-case decision-verification latency.** The memoization fix above only helps when decisions cluster on a handful of files; a batch fully scattered across N distinct files is still O(N) git subprocess spawns. An async/batched redesign would be needed to bound the worst case.
- **CFG is line-based, not AST-based**, and taint analysis remains lexical/regex, not a real dataflow engine — both are known architectural ceilings, not just untested edge cases; a full AST/dataflow rewrite of either is out of scope for now.

**Deliberately NOT chasing (out of lane or vanity):** live runtime debugging (Serena reaches it by proxying to a JetBrains IDE — runtime, not static graph, and not something a standalone local server can offer); counterfactual architecture simulation / multi-agent swarm (Roam-Code — unverified, speculative); the 161-language count race (codebase-memory-mcp — trace-mcp's {{ site.data.counts.languages }} already covers the real-world long tail); the tool-count arms race for its own sake (Roam 246, Narsil 90 — quality of edges beats tool count; note this is a claim about which tools to *build*, not about how many to advertise by default, where we are currently behind — see above); verbatim chat storage and 20× "Endless Mode" (MemPalace / claude-mem — trace-mcp's extract-then-store model is deliberate, and Endless Mode adds 60–90s latency per tool).

## FAQ

### What is the best MCP server for giving an AI agent codebase context?

It depends on the shape of the question you want the agent to ask. To hand the agent a whole small repository in one prompt, Repomix packs it into a single file. To resolve a symbol with compiler-grade precision in a language you already run a language server for, Serena proxies that server. To ask cheap structural questions repeatedly across a large codebase — who calls this, what breaks if I change it, which route reaches this handler — a precomputed graph is the fit, which is where codegraph, codebase-memory-mcp and trace-mcp sit. The tables on this page compare them row by row.

### What is the difference between packing a repository and indexing it?

Packing serialises the source into one artifact the agent reads: cost scales with repository size and every question re-reads the same text. Indexing parses the source once into a queryable structure — symbols, imports, call edges — and the agent queries it: cost scales with the answer, not with the repository, and the index has to be kept fresh. [Repomix vs codegraph](/vs/repomix-vs-codegraph.html) is that trade-off head-to-head between two tools that each pick one side.

### Do any of these need a language server or a compiler installed?

Serena does by design — it is a language-server proxy, so its coverage is whatever server you have installed for that stack. trace-mcp parses with tree-sitter across {{ site.data.counts.languages }} languages and needs no toolchain; LSP enrichment is opt-in and only raises the resolution tier of edges it already has. That is the core precision-versus-breadth trade in [trace-mcp vs Serena](/vs/serena.html).

### How many tools does each server advertise, and why does it matter?

Every tool a server advertises costs tokens in `tools/list` before the agent asks anything. On the shipped default preset trace-mcp advertises 28 tools at roughly 11.6K tokens; codegraph advertises one, at roughly 1,900 tokens; codebase-memory-mcp ships 15 at roughly 7K. We are behind the cheapest peers on that axis and say so in the deep dive above rather than leaving it to the tables.

### How current is this comparison?

Each figure carries the date of the pass that checked it. Star counts render from a single data file re-read from the GitHub API rather than copied between tables, and the verification methodology section lists what each pass actually read — source, README, or API only. The profiling depth tracker at the end marks which entries have had a real source read and which are still README-level.

## Profiling depth tracker

Which entries above got a real read of their architecture/code and a concrete take-or-pass decision, vs. which are still table rows filled from README/star-count checks only. Used to pick where the next competitor-intel pass digs deeper instead of re-scanning the same surface facts.

**Profiled deep (architecture/code read, explicit take-or-pass with reasoning):** Graphify, Headroom, Kage, mem0/OpenMemory, MemPalace, codebase-memory-mcp, codegraph, SDL-MCP, Serena, code-review-graph, CodeGraphContext, LeanKG, Roam-Code, Repomix, marm-memory, CodeGraph (codegraph-ai), SocratiCode, jCodeMunch, TokenSave, Graft, Narsil-MCP, RTK, claude-mem, Token Savior, AFT, GitNexus, Code Pathfinder, grafel.

**Tracked, still surface-level only (README + stars, no code/architecture read yet):** cymbal, DeepContext, smart-coding-mcp, mcp-local-rag, knowledge-rag, ConPort, engram, repo-context-mcp.

**SDL-MCP profiled this pass** (August 29, 2026 — repo cloned and read: `src/gateway/`, `src/mcp/response-projection/`, `docs/architecture.md`, `docs/tool-output-contract.md`, `docs/tool-enforcement.md`). Findings and the take-or-pass on each are in the tool-surface deep dive above. Three things beyond the budget layer are worth recording here rather than re-discovering: it runs on an embedded **graph** database (LadybugDB / Kuzu engine) rather than SQLite+FTS5; it ships **client-side enforcement generation** (`sdl-mcp init --client claude-code --enforce-agent-tools` writes `.claude/settings.json` hooks, a subagent, and repo-local instruction files whose job is to stop the agent falling back to native Read/Bash) — a distribution idea, not a code idea, and the one place a peer is doing something we are not; and it treats native-tool substitution as a design goal, mirroring the host's Read contract byte-for-byte, which is the same move the largest peer makes.

**Serena profiled this pass** (August 30, 2026 — repo cloned at commit `7fcbca7e` and read: `src/serena/agent.py`, `src/serena/tools/`, `src/serena/config/`, all sixteen context and ten mode YAMLs, `src/solidlsp/`, `CHANGELOG.md`). Findings and the take-or-pass on each are in the fourth mechanism under "Deep dive" above; it also corrected the debugger claim this page carried. A second, deeper read followed on August 30 at commit `43ae021`, and it corrected this page as much as it corrected theirs — see the [vs Serena](/vs/serena.html) page for the four rows that moved in Serena's favour. Two facts worth recording here rather than re-deriving: it keeps **no persistent graph**, but it does persist per-file document-symbol caches (an earlier revision of this page wrongly said every symbol query is a live LSP round-trip), and its "memory" is markdown files under `.serena/memories` — topic-namespaced and cross-referenced, but neither code-linked nor staleness-verified, which is why our row reads "✓ (notes, not code-linked)".

**Context Mode profiled this pass** (August 30, 2026 — read via the GitHub API at commit `8a35367`, no clone: `package.json`, `src/server.ts`, `src/executor.ts`, `BENCHMARK.md`, `LICENSE`). Findings are on the [vs Context Mode](/vs/context-mode.html) page: eleven MCP tools, no code parser among its eight runtime dependencies, "12 languages" that are subprocess runtimes rather than grammars, a 98% figure that measures tool-output bytes on committed fixtures, and Elastic License 2.0 rather than an OSI licence.

**code-review-graph profiled this pass** (September 2, 2026 — repo cloned at commit `b58668751ab0` and read: `pyproject.toml`, `code_review_graph/graph.py`, `main.py`, `uncertainty.py`, `scoped_resolver.py`, `parser.py`, `README.md`). Findings and the take-or-pass are in the fifth mechanism under "Deep dive" above; see [vs code-review-graph](/vs/code-review-graph.html). Three facts worth recording here rather than re-deriving: its stars have moved from the ~19K this page carried to **31.1K** (GitHub API, this pass), current release v2.3.8 (2026-08-21), MIT, Python; its graph is a plain SQLite `nodes`/`edges` schema keyed on qualified-name strings, with an edge confidence model of only two values (`EXTRACTED` / `INFERRED`) against our five resolution tiers; and its advertised surface is 29 tools with no default trimming at all, the opposite end of the same axis from the largest peer.

**codegraph re-verified this pass** (September 2, 2026 at commit `b9ca4b7981116909900368cc1686a1074cd4d4c1`, source re-read rather than carried forward from the August 28 reading this page had been quoting). The claim holds exactly: `src/mcp/tools.ts` defines eight tools and `DEFAULT_MCP_TOOLS` is literally `new Set(['explore'])`, with the other seven reachable only through `CODEGRAPH_MCP_TOOLS`. One caveat for anyone re-checking: a comment inside `getTools()` says "the default 4-tool surface" and is stale prose — the set it points at contains one entry. Stars 69.2K at that reading, re-checked at 69.4K on September 3, 2026.

**CodeGraphContext profiled this pass** (September 4, 2026 — read through the GitHub API at `main`, no clone: repository metadata, `pyproject.toml`, `README.md`, `src/codegraphcontext/tool_definitions.py`, `server.py`, `tools/scip_indexer.py`, `tools/indexing/scip_pipeline.py`, `core/bundle_registry.py`). It had been a table row since April on README and stars alone; this pass exists because `/comparisons.html` ranks first for `codegraphcontext` in Search Console on two passing mentions, which is a poor reason for a reader to arrive and find nothing (measured by the SEO Agent during review of PR #842). Facts worth recording rather than re-deriving: the repo moved from `Shashankss1205/CodeGraphContext` to its own `CodeGraphContext` org, 4,155 stars at this reading, v0.6.10 and still self-classified alpha; 29 tools defined and all 29 advertised, trimmable only by an `mcp.json` `disabledTools` denylist; the SCIP path is off by default and needs a per-language Sourcegraph indexer binary, with C/C++ additionally requiring `compile_commands.json`; and its `.cgc` bundle registry is a Hugging Face dataset (`codegraphcontext/registry`), the only shareable pre-built graph distribution anyone in this field ships. The September 4 pass deliberately shipped no `/vs/` spoke — not because the format underperforms, but because none of the six existing spokes has been indexed yet (GSC URL Inspection, September 6, 2026: two "Discovered — currently not indexed", four unknown to Google). **Reversed on September 6, 2026**, and only for this peer: TRA-1022 established the same day that Google's copy of the sitemap was five days stale and one spoke had never been in it at all, so "the spokes are not indexed" was partly a submission fact rather than a demand fact, and the sitemap has since been resubmitted and refetched. This is also the one peer with a measured brand query arriving on the hub, which gives the spoke a landing target the other six were built without. [/vs/codegraphcontext.html](/vs/codegraphcontext.html) re-verifies the facts above at repository head on September 6, 2026 — 0.6.13, eleven SCIP families, {{ site.data.competitors.codegraphcontext.stars }} stars. Structure and internal linking of the spoke remain the SEO autopilot's call; the content is this page's.

**All five head-to-head peers re-verified this pass** (September 3, 2026 — read through the GitHub API, no clones: each project's repository metadata, `package.json` or equivalent, README, and the specific source files behind the claims this page makes about tool surfaces). This pass exists because the per-competitor summaries above were written for the hub rather than copied from the head-to-head pages, and every figure in them had to hold at source today. Four numbers moved and are corrected throughout: codegraph 69.4K stars, codebase-memory-mcp 42.1K and 162 languages, Serena 28.8K, Context Mode 20.3K. One claim moved against a previous reading: Serena's registry now defines 50 tool classes with 22 optional, so its default surface is 28 tools rather than the 29 read on August 30 — exactly level with ours. One number was retired rather than re-quoted: Repomix no longer publishes a percentage for `--compress` in its README or its code-compress guide, so this page no longer quotes one.

**LeanKG profiled this pass** (September 5, 2026 — read through the GitHub API at `main`, no clone: repository metadata, `src/mcp/tools.rs`, `src/mcp/toon.rs`, `src/mcp/token_budget.rs`, `src/budget.rs`, and the eight per-client packaging directories). Facts worth recording rather than re-deriving: 216 stars, Rust, Apache-2.0, v0.26.1 (2026-08-22) and pushed to daily; `ToolRegistry::list_tools()` returns **76 tools with no gating of any kind** — the opposite end of the surface axis from the peer that advertises one, and roughly 2.7× our shipped default; it ships install packages for eight separate hosts (Claude Code, Cursor, OpenCode, Kilo, Antigravity, Gemini, CommandCode, plus an `instructions/` rules tree), which is the widest per-client distribution anyone in this field ships.

Four mechanisms were read at source and each got a decision:

- **A tabular encoding for homogeneous object arrays — already ours, and ours is better founded.** Their `toon.rs` hoists the shared key set of an object array into a header row so field names appear once instead of *n* times. That is the same structural win trace-mcp ships as `output_format: "toon"` on 13 tools, against the published TOON spec rather than a homegrown encoder, and losslessly — theirs emits strings unquoted unless they contain a special character, and its own comment claims "~40%" with no measurement behind it. Nothing to take.
- **A fixed per-tool token ceiling with truncation: passing, we already do better.** `TokenBudget::max_tokens_for_tool` is a hardcoded `match` from tool name to a number (800–6000, default 1000), applied by truncating the payload and appending `_token_budget` metadata. trace-mcp's `src/server/budget-defaults.ts` instead caps the *parameters* that generate the payload, at session-budget thresholds, and only when the caller did not set them explicitly — shaping the query rather than cutting the answer in half. A static per-tool ceiling would be a regression on that.
- **A compute budget around heavy graph work: taking it.** `budget.rs` wraps every long-running algorithm in wall-clock, resident-memory and iteration ceilings, checked from inside the hot loops, so a heavy call aborts rather than "running for hours against a 600k-element graph and OOM-killing the host". We have no equivalent: our budgets are all token budgets, and `src/daemon/vitals-log.ts` exists only to leave evidence *after* an OS-level kill, not to prevent one. Filed as TRA-841, tied to the two open daemon-death issues.
- **Enforced cross-tool routing hints: taking the enforcement, not the form.** Their overlapping search tools carry an explicit `Prefer-order (search): …` clause in the description, and a unit test asserts every member of that family still carries one. Our descriptions already carry equivalent pairwise pointers and read better than theirs, but nothing keeps them from drifting as tools are added or descriptions trimmed — and the description is the only routing mechanism that reaches clients where our hook and IDE rules do not. Filed as TRA-842, scoped to a drift test at zero net description cost.

Two things deliberately passed without filing: `report_query_outcome`, a tool the agent calls to report whether a query answered its question (our session mining reconstructs the same signal without asking the agent to spend a call on it), and their unguarded 76-tool surface, which is the problem the preset work already solved for us.

**Roam-Code profiled this pass** (September 5, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `src/roam/mcp_server.py` — the preset tables and the tool registrar — `docs/mcp-tools.md`, `README.md`, and both benchmark trees under `benchmarks/`). Facts worth recording rather than re-deriving: 514 stars (GitHub API, this pass), Python, Apache-2.0, v14.0.2 released the day of this reading and pushed to daily; the surface is **246 tools defined but 17 advertised by default**, not the flat 224 this page carried — `_PRESETS` in `mcp_server.py` names eight selectable sets (`core`, `review`, `refactor`, `debug`, `architecture`, `compliance`, `compile-curated`, `full`) chosen by a `ROAM_MCP_PRESET` env var, with one always-registered meta-tool that reports what the other presets hold. Their headline savings figure is no longer the "~92%" this page quoted; the README now leads with −83% turns / −80% input tokens from a 41-cell A/B and labels the row with the kernel version it was measured at.

Three mechanisms were read at source and each got a decision:

- **Preregistering a benchmark before running it, and publishing the miss: taking it.** `benchmarks/cross-repo-l1/PREREGISTRATION.md` fixes the question, the metric's formula, a frozen 60-prompt corpus, a pass bar declared unadjustable after seeing data, and a recorded prediction — then `RESULTS.md` reports **MISSED** on all three targets, and a home-repo control on the same corpus shows the bar had been calibrated against a corpus that is not in the tree, so no repo could have cleared it. Publishing the negative result *and* the reason the test was mis-calibrated is a stronger credibility move than any number on the page, and it is the one place a peer is clearly ahead of us on method rather than on features. Adopted the same day against our own published figures: both now carry a retrospective preregistration and the build they were measured at, and the aggregate response-token figure publishes as MISSED on its coverage half — see "Closed the same day it was found" above.
- **Default surface chosen from measured tool-firing data, not from curation: taking the method, not the list.** Their `_CORE_TOOLS` set carries per-tool comments recording which tools fired in an A/B and which lost over 25+ runs, and two tools are deleted from the default with the loss recorded in-source next to the deletion. Our `minimal` preset was composed by judgement; `/perf/response-tokens/` now gives us the per-tool measurement that would let it be composed the same way. This belongs with the open preset work rather than in a new issue of its own.
- **A meta-tool as the escape hatch from a small default: passing, ours is already better.** `roam_expand_toolset` is always registered and lists what the other presets contain, but it cannot change the running server — the docs are explicit that acting on it means restarting with a different env var. `load_tools` re-sends the full list in the live session, so the same problem is solved without a restart. Nothing to take.

**Repomix profiled this pass** (September 5, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `src/mcp/mcpServer.ts` and the eight files under `src/mcp/tools/`, `src/cli/cliTokenBudget.ts`, `src/core/treeSitter/` including the parse strategies and the sixteen per-language query files, and the `src/core/skill/` tree). It had been a table row on README and stars alone since this page's first revision, which was wrong for the largest entry we track. 28.2K stars, MIT, TypeScript, v1.18.0 (2026-08-08), pushed daily.

What the row was missing: it is no longer only a packer. It ships an MCP server of **eight tools** — pack local, pack remote, read and grep the packed output, attach an existing pack, generate an Agent Skill, and two raw filesystem tools — and `--compress` is tree-sitter query captures, keeping signature, comment and import lines and dropping bodies, with five per-language strategies over a shared stateless base and a deduplicating chunk set.

Three mechanisms were read at source and each got a decision:

- **A sandbox mode that shrinks the tool set *and* the instructions text together: taking the idea, filing our own half of it.** Under `--sandbox` it registers the raw filesystem tools and does *not* register the ones that reach outside the root (remote fetch, skill writing, arbitrary-path attach) — with a source comment saying the disabled ones must "leave no trace for the agent" — and it swaps in a second instructions string that names only the tools that mode can actually serve. A second comment states plainly that their secret scan is a content heuristic and not an access boundary. Our own instructions block does the opposite: `buildInstructions` takes no preset argument, so on the default surface it routes the agent to 26 tools that are not registered. Filed as an issue with the list and a drift test.
- **A token budget that fails the run: taking it, narrowly.** `validateTokenBudget` throws after the output exists, so a pack over `--token-budget` exits non-zero with a message naming the three ways to get under it. That is a CI gate, not a clamp — it makes "this repository no longer fits the context window" a build failure someone has to answer. Our budgets all shape a response downward instead, which is right for a live agent call and gives nobody a signal in CI.
- **Generating an Agent Skill from a repository: passing on the feature, noting the channel.** `src/core/skill/` writes a Claude Agent Skill — sections, statistics, detected tech stack — as an output format. We already ship skills as a first-class surface, so the feature is not a gap; what is worth recording is that a packer treats the skill format as an output target, which is a distribution surface rather than a code idea.

**marm-memory profiled this pass** (September 5, 2026 — read through the GitHub API at `MARM-main`, no clone and nothing executed: repository metadata, `marm_graph/core/cbm_client.py`, `marm_graph/core/tool_router.py`, `marm_graph/config/settings.py`, `marm_mcp_server/server_stdio.py` and `marm_mcp_server/services/stdio_graph_tools.py`). 350 stars, Apache-2.0, Python, v2.47.0 (2026-09-02). The row this page carried described it as session history, codebase index and a concept graph in one SQLite layer. Two thirds of that is right and the middle third is not: **it does not index code itself.**

`CbmClient` spawns another project's code-graph MCP server as a long-lived stdio child, pins its version in a constant, and re-publishes its answers as five of its own fourteen tools. `tool_router.py` calls exactly six tools on that child by name — `list_projects`, `index_status`, `search_code`, `search_graph`, `get_graph_schema`, `detect_changes` — and reshapes each response for its own surface. The child command is an environment variable, so the binary is swappable; the six names and their response shapes are not.

The decision that matters is not about a feature:

- **The code-graph slot under a memory layer is a real socket with a written contract, and it is the second one we have found.** A memory-first project would rather delegate indexing than build it. That makes "which code-graph server gets plugged in" a distribution question — one this page can record but not answer. Filed internally with the six-tool contract, the two known instances, and a costed recommendation; nothing shipped on the strength of one reading.
- **Their concept graph and compaction are the half they do build**, and they are notes-over-sessions rather than code-linked — the same distinction this page already draws for the largest LSP-native peer's markdown memories. Nothing to take: our decisions bind to symbol IDs and are staleness-verified.

**CodeGraph (codegraph-ai) profiled this pass** (September 7, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `Cargo.toml`, `crates/codegraph/src/storage/`, `crates/codegraph-server/src/mcp/tools.rs`, `crates/codegraph-server/src/backend.rs`, `crates/codegraph-memory/src/storage.rs`). 80 stars (GitHub API, this pass), Apache-2.0, Rust, v0.20.1 (last pushed August 2026). The row this page carried described it as C; reading the source corrects it: it is a **43-crate Cargo workspace in Rust (edition 2021)**, with the C classification arising from vendored tree-sitter grammars. It runs a dual LSP server (`tower_lsp`) + MCP stdio/SSE server (`codegraph-server`), backed by RocksDB with namespaced keys and column families (`rocksdb_backend.rs`) plus an in-memory graph store.

What the row was missing:
- **MCP tool profiles**: `crates/codegraph-server/src/mcp/tools.rs` defines **42 community tools** and exposes a `ToolProfile` selector: `All` (default, all 42 advertised), `Core` (8 tools: symbol search, symbol info, detailed symbol, ai context, edit context, curated context, search by pattern, search by error), `Graph` (17 navigation/impact tools), `Memory` (doc indexing, search, memory nodes, architecture doc generation, verify design, design gaps), and `Security`.
- **Closed-source pro edition boundary**: The `Security` profile filters community tools to empty — its security analysis (taint analysis, vulnerability scanning, coupling analysis, git mining) is gated behind closed-source "pro hooks" (`pro_hooks.rs`, `lsp_pro_hooks.rs`). Whether that pro edition is sold is not something either reading establishes, and it was checked rather than assumed: the repository names no price, its README asks for GitHub sponsorship rather than a subscription, and the `/pro` URL it links does not resolve. In contrast, trace-mcp includes OWASP Top-10 taint analysis with type-aware pruning and OASIS SARIF 2.1.0 output 100% free and open-source (MIT).
- **Memory architecture**: `codegraph-memory` combines RocksDB storage with LZ4 compression and instant-distance HNSW for O(log n) semantic vector search (`MemoryStore`). Like Serena and MemPalace, however, its memory nodes are documentation/note-based rather than bound to symbol IDs and verified for code staleness.
- **Zero framework awareness**: 38 tree-sitter language parsers are modularized into individual crates (`codegraph-python`, `codegraph-rust`, `codegraph-typescript`, etc.), but none resolves framework semantics (no route → handler, controller → template, or model → table edges).
- **PR context generation**: `codegraph_pr_context` computes blast radius, risk summary, and test gaps from `git diff <baseBranch>...HEAD`, outputting JSON or ready-to-post Markdown PR comments.

Three mechanisms were read at source and each got a decision:
- **Dual LSP + MCP server architecture: passing on unifying with LSP.** Running a full Language Server Protocol implementation (`tower_lsp`) alongside MCP allows IDEs with LSP support to query the graph natively. However, trace-mcp focuses on agentic CLI workflows (Claude Code, Codex) where an MCP stdio server is the native integration, and opt-in SCIP ingestion provides compiler-grade precision without maintaining a full LSP server daemon.
- **HNSW indexing over RocksDB for memory: passing, we already do better.** RocksDB introduces C++ compilation and native linking overhead that complicates cross-platform distribution. trace-mcp's embedded SQLite+FTS5 plus bundled ONNX embeddings provide zero-dependency local search with single-file portability.
- **`codegraph_pr_context` markdown generator: already covered, and ours is benchmarked.** trace-mcp's PR context generation is the core of our PR benchmark ({{ site.data.pr_context_bench.median_savings_pct }}% input token reduction across {{ site.data.pr_context_bench.pr_count }} open-source PRs). Nothing to take.

**SocratiCode profiled this pass** (September 7, 2026 — read through the GitHub API at `main`, no clone and nothing executed: `package.json`, `src/constants.ts`, `src/config.ts`, `src/index.ts`, `src/tools/`, `src/services/code-graph.ts`, `src/services/graph-impact.ts`). 3,287 stars (GitHub API, this pass), AGPL-3.0-only / commercial dual license, TypeScript, v1.13.0 (released September 2026). It had been a table row on ~900 stars and 21 tools; reading the source corrects both: **{{ site.data.competitors.socraticode.stars }} stars** (3,287) and **25 MCP tools advertised by default** (all 25 exposed unconditionally: 9 index/manage tools, 7 graph tools, 5 query/symbol tools, 4 context tools). Storage is Docker-managed Qdrant (`qdrant/qdrant:v1.17.0`) on `:16333` + Ollama (`ollama/ollama:latest`) on `:11435` with `nomic-embed-text` (768 dimensions), with optional external/cloud Qdrant URLs. AST parsing uses `@ast-grep/napi` across 19 languages with zero framework awareness. See the full head-to-head: [trace-mcp vs SocratiCode](/vs/socraticode.html).

Three mechanisms were read at source and each got a decision:

- **Interactive in-browser graph visualization (`codebase_graph_visualize`): passing for core CLI, noting for desktop.** It generates a self-contained HTML file using Vis.js and calls `openInBrowser` to spawn a tab in the user's default browser. For automated CLI workflows (Claude Code, Codex), opening browser windows steals focus and interrupts headless execution. trace-mcp already exports standard GraphML/Mermaid/JSON via `export_graph` and provides an optional hardware-accelerated Electron app (`cosmos.gl`) for visual inspection without disrupting the CLI run. Nothing to take.
- **Docker-managed vector database container: passing, we already do better.** Requiring Docker with open network ports (`16333`, `11435`) adds heavy operational dependencies, fails in restricted containerized environments, and consumes substantial idle memory. trace-mcp's embedded SQLite+FTS5 plus bundled ONNX embeddings provide zero-dependency local search with single-file portability and zero network attack surface.
- **Cross-process locking for multi-agent concurrency: passing, already handled.** SocratiCode uses `proper-lockfile` to prevent duplicate index builds when multiple agent processes access the same directory. trace-mcp's background daemon architecture natively serializes index mutations through SQLite WAL mode and a centralized worker pool. Nothing to take.

**Quality-measurement audit, and two registry debts closed with it** (September 7, 2026 — read through the GitHub API at each project's default branch, no clones and nothing executed). Files read in full: `benchmarks/METHODOLOGY.md` and `benchmarks/README.md` (jCodeMunch); `code_review_graph/eval/benchmarks/{impact_accuracy,agent_baseline,search_quality}.py` (code-review-graph); `docs/04-evaluation/010_methodology.md` and `030_results/000_evaluation-results.md` (Serena); `docs/BENCHMARK.md` and `docs/EVALUATION_PLAN.md` (codebase-memory-mcp); `benchmark/README.md` (LeanKG); `__tests__/evaluation/scoring.ts` (codegraph); `benchmarks/agent-eval/README.md` and its tree (Roam-Code). Findings are the section above. Three facts worth recording rather than re-deriving:

- **The gate we are missing is the wire, not the harness — and the audit found that by looking for the harness.** jCodeMunch runs a replay benchmark in CI as its `Replay` workflow: pinned `(query, expected ids)` fixtures, aggregate nDCG@k / MRR@k / Recall@k, and a non-zero exit when any metric falls more than 2% relative to a committed golden JSON. Deterministic, no model calls, cheap per push. Checking whether we had an equivalent turned up `scripts/replay-eval.ts` and `benchmarks/replay/` — eight golden queries, the same three metrics, a `--update-baseline` flag and a `replay:check` script — shipped in April 2026 and referenced by no workflow, no contributor doc and no other pass of this page since. Its baseline is dated April 30, 2026 and reads 1.0 on all three metrics. Filed internally against the existing context-quality gate work rather than as a parallel effort: the ask is a workflow and a fixture set worth failing on, not a new harness.
- **code-review-graph's third-week debt is closed.** Its architecture was read on September 2 and its evaluation harness on September 7; the ~19K star figure this page once carried is two passes stale and now reads {{ site.data.competitors.code_review_graph.stars }}. Nothing further is owed on this entry — it is fully profiled, and the one mechanism worth taking from it (labelling a graph-derived ground truth as a circular upper bound, and grading against git co-change instead) is a discipline our own temporal-holdout calibration already follows.
- **Headroom's two registry entries are one project.** `chopratejas/headroom` redirects to `headroomlabs-ai/headroom`: the repository was renamed, not forked, and the entry profiled on August 30 is the same one a directory listed by hand later. Stars 68.1K → **69.2K** (GitHub API, this pass). No second row is owed.

**pi-shazam added to the registry** (gjczone/pi-shazam, 7 stars, TypeScript, MIT, `pi-shazam@0.31.0`, first release June 2026, last pushed August 16, 2026). Small, and on this page for shape rather than size: four of its seven tools — project overview, symbol lookup, blast radius, and git-diff-by-symbol — map one-to-one onto ours, over the same tree-sitter-plus-LSP substrate. What is worth recording is the packaging, not the features: it ships as a **native extension of its host agent**, with an MCP server offered second, for "everyone else". That is the same overhead argument that got a 15-tool MCP peer dropped from a host's extension set in August 2026, and it is an axis on which a seven-tool native surface wins by construction. Its `/shazam-doctor` health check — LSP status, recent errors, slow calls — was a real gap when this entry was first written and is no longer one: `trace doctor` shipped in September 2026. Nothing else to take at this size; kept in the registry so the next pass does not rediscover it.

**jCodeMunch profiled this pass** (September 7, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `pyproject.toml`, `LICENSE`, `src/jcodemunch_mcp/server.py`, `src/jcodemunch_mcp/counter.py`, `src/jcodemunch_mcp/tier_switch_cost.py`, `src/jcodemunch_mcp/storage/sqlite_store.py`, `src/jcodemunch_mcp/tools/_call_graph.py`, `src/jcodemunch_mcp/tools/plan_refactoring.py`, `src/jcodemunch_mcp/parser/context/framework_profiles.py`). 2,668 stars (GitHub API, this pass), Dual-Use License v1.1 (free for non-commercial use only; commercial use prohibited without license), Python, v1.108.317 (released September 2026). It defines ~90 MCP tools and fronts them on first-ever installs through "The Counter" (a 3-tool meta-dispatch surface: `order`, `menu`, `route`). Storage is SQLite WAL with tables for symbols, files, and runtime tracking (`runtime_calls`, `runtime_edges`). Route detection across ~13 frameworks uses regexes in context providers rather than true semantic graph edges. See the full head-to-head: [trace-mcp vs jCodeMunch](/vs/jcodemunch.html).

Three mechanisms were read at source and each got a decision:

- **The Counter meta-dispatch front door (`order`, `menu`, `route`): passing on meta-dispatch, validating the prompt budget lesson.** Fronting 90 tools with a single `order(action, args)` dispatch verb drastically cuts top-level schema tokens, but forces an extra indirection turn and bypasses client schema validation, increasing parameter hallucination risk. trace-mcp instead uses task-tailored presets (`minimal` default with 28 tools, `review`, `architecture`, `dev`) and dynamic runtime escalation via `load_tools`, preserving type-safe client schemas without meta-tool indirection. Nothing to take.
- **Agent configuration hygiene auditing (`audit_agent_config`): taking the idea for doc and config linting.** `audit_agent_config` cross-references `CLAUDE.md`, `.cursorrules`, and `copilot-instructions.md` against the symbol index to find dead symbol names, broken paths, and token waste. We already check doc-to-code path integrity (`verify_docs`, `tests/docs/doc-path-refs.test.ts`), and extending this to user-facing agent instruction files is a high-value developer workflow.
- **Text-based refactoring plan generation (`plan_refactoring`): passing, we already do better.** `plan_refactoring` generates text find-and-replace candidate blocks `{old_text, new_text}` using regexes on imports. trace-mcp provides native AST refactoring write tools (`refactor_rename`, `refactor_extract`, `refactor_move`, `refactor_codemod`) that execute atomic, syntax-verified transformations directly in the AST. Nothing to take.

**TokenSave profiled this pass** (September 8, 2026 — read through the GitHub API at `master`, no clone and nothing executed: repository metadata, `Cargo.toml`, `server.json`, `src/mcp/tools/definitions.rs`, `src/mcp/server.rs`, `src/tokensave/memory.rs`, `src/tokensave/staleness.rs`, `src/accounting/`, `src/extraction_worker.rs`). 621 stars (GitHub API, this pass), MIT, Rust (edition 2021), v7.11.1. It defines 86 MCP tools in `get_tool_definitions()` and advertises all 85+ on standard MCP hosts, with only 5 tools carrying `anthropic/alwaysLoad: true` (`tokensave_search`, `tokensave_context`, `tokensave_callees`, `tokensave_impact`, `tokensave_status`). Storage is embedded libSQL (SQLite fork) with FTS5 and local ONNX runtime (`ort`) embeddings. AST extraction covers 50+ languages across three compilation tiers (lite 11, medium +9, full +40 more) with zero framework awareness. See the full head-to-head: [trace-mcp vs TokenSave](/vs/tokensave.html).

Four mechanisms were read at source and each got a decision:

- **Subprocess-isolated extraction worker pool (`extraction_worker.rs`): noting the architecture, our runtime is already safer.** To prevent crashes (segfaults, aborts) in native C/Rust tree-sitter grammars from killing the MCP server daemon, TokenSave routes file extraction through a pool of isolated worker child processes that can be respawned if killed. trace-mcp instead executes tree-sitter parsers inside a WebAssembly sandbox (`web-tree-sitter`), where memory safety and process isolation are enforced by the V8 WASM runtime — eliminating native segfaults and panics by design without subprocess IPC overhead. Nothing to take.
- **Bounded catch-up sync ceiling (`AutoSyncScope::TooManyStale`): taking the guard concept.** Automatic background syncs on tool calls or server start cap sync volume at 2,000 stale files, refusing to turn a background access check into a runaway initial indexing pass over multi-terabyte uninitialized trees. We already track dirty files incrementally, but formalizing an explicit ceiling on automatic background syncs is a sound defensive pattern.
- **Multi-branch isolated index databases: passing, unified index is more efficient.** TokenSave allows opting into separate libSQL database files per git branch (`.tokensave/branches/<branch>.db`), with a branch drift guard (`BranchDrift`) stopping cross-branch writes. trace-mcp tracks branch and commit SHAs directly in unified SQLite WAL tables, allowing instant branch switches and cross-branch diff queries without managing fragmented database files. Nothing to take.
- **String replacement primitives (`tokensave_str_replace`): passing, we already do better.** TokenSave provides text-slice find-and-replace tools with anchor matching. trace-mcp provides verified AST refactoring tools (`refactor_rename`, `refactor_extract`, `refactor_move`, `refactor_codemod`) that execute atomic, syntax-checked code transformations with cross-file import graph rewrites. Nothing to take.

One take from the September 6 reading of the same project is not in the list above, because it is about us rather than about them. Its `verify_design` / `design_gaps` tools index a markdown document, pull the backtick-wrapped identifiers out of it, and check each against the graph — forward asks whether what the doc claims exists actually exists, reverse asks which public symbols the doc never mentions, and each miss comes back with the heading path that owns it. **We had no equivalent, and that is a real gap.** We generate documentation *from* the graph (`generate_docs`) and we gate published numbers in CI, but nothing checked an already-written document against the code, which is the direction that catches drift. Filed and shipped as `tests/docs/doc-path-refs.test.ts`; the first page it failed on was this one.

**Graft profiled this pass** (September 6, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `README.md`, `CHANGELOG.md`, `src/mcp/server.ts`, `src/mcp/tool-names.ts`, the `src/graph/` tree including its sixteen `queries/*.scm` grammars and `refresh.ts`/`check.ts`, and the `src/claude/` and `src/hosts/` wiring trees). This is a new name on this page, not a re-check: the repository was created July 3, 2026, is MIT, TypeScript, published as `@nanonets/graft`, pushed daily, and sits at 5,656 stars — two months from zero, which is faster than any other entrant here reached its count.

What it is: a tree-sitter structural graph, plus an optional LLM enrichment pass under the user's own provider key that writes prose summaries. The artefact is **a folder of linked markdown files** (`graft/`, gitignored as a regenerable cache) rather than a database — the agent opens and greps them like any other file. There is **no daemon and no persistent index process**: every query re-derives the structural graph against the working tree first, which their README puts at ~3 ms when nothing moved, and `graft check` is the freshness signal. It wires into hosts rather than waiting to be called: `graft init` writes Claude Code hooks, a statusline and an `AGENTS.md` section, and there are per-host modules for Cursor, Codex and Antigravity alongside a `retract` path that removes them again.

Four mechanisms were read at source and each got a decision:

- **A paired benchmark on a public task set, graded by someone else's harness: taking the method, and it is the one place a peer's method leads ours.** Recorded as an open gap in "where competitors lead" above rather than as a feature to copy — the detail and the caveats are there.
- **No resident process at all: passing on the architecture, taking the pressure.** Their answer to index freshness is to have no index to keep fresh, which costs them a re-derivation per query and buys them zero idle footprint and no watcher to miss events. Ours is the opposite trade and we are currently paying its full price without the benefit: a resident daemon with a measured idle footprint, plus a watcher we already know drops events. Switching architectures is not on the table — the framework edges, security passes and refactoring engine need a persisted graph — but "a peer serves this workload with no resident memory at all" is the honest comparison for the open daemon-footprint and watcher-reconciliation work, and it belongs next to those, not in a new feature.
- **A gitignored graph plus committed wiring: passing, ours already resolves this better.** Their split is deliberate — the derived graph is a local cache, what the team shares is the small host wiring. We reach the same place with a per-machine store and no repo artefact at all, so there is nothing to gitignore and nothing to regenerate per teammate.
- **Old tool names kept as permanent aliases: already ours.** `src/mcp/tool-names.ts` maps every pre-rename name onto its canonical one, on the reasoning that a tool name is an API other people's notes and skills reference. `src/server/retired-tools.ts` is our equivalent and predates this reading. Nothing to take, but worth recording that two independent projects converged on it.

One thing recorded and not acted on: they ship a GitHub App that posts a blast-radius review on every PR, which is a distribution surface rather than a code idea — the same category as the packer that emits an Agent Skill, noted in the September 5 pass.

**Narsil-MCP profiled this pass** (September 8, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `Cargo.toml`, `src/tool_metadata.rs`, `src/config/preset.rs`, `src/taint/`, `src/persistence/sparql.rs`, `docs/architecture.md`, `docs/ccg-spec.md`). 182 stars (GitHub API, this pass), Rust (edition 2021), MIT OR Apache-2.0, v1.7.0. It defines 90 tools across 11 categories and exposes four curated presets: `minimal` (20-30 tools), `balanced` (40-50), `full` (70+), and `security-focused` (~30). Storage combines `tantivy` (LZ4 full-text search) with `postcard` (binary serialization with `memmap2`) and `oxigraph` (SPARQL/RDF knowledge graph). Its headline concept is Code Context Graph (CCG), which structures code representations into 4 progressive disclosure tiers: Layer 0 (~1-2KB JSON-LD manifest with repo identity, symbol counts, languages, and security summary), Layer 1 (~10-50KB architecture), Layer 2 (~100-500KB gzipped N-Quads symbol index), and Layer 3 (~1-20MB full RDF).

Four mechanisms were read and evaluated:
- **Progressive Layer 0 repository manifest: taking the concept into repo overview.** Structuring a lightweight, deterministic repository summary (~1-2KB) that packs symbol counts, language distribution, entry points, and health signals into any initial context window is a clean pattern. We already have `get_repo_overview`, but formalizing an ultra-compact Layer 0 output mode bounds startup tokens.
- **SPARQL / RDF graph querying: passing, specialized typed tools are better.** Exposing raw SPARQL forces agents to write complex semantic queries with high syntax and hallucination overhead. Specialized typed tools (`get_callers`, `get_change_impact`) give zero-overhead deterministic answers.
- **Taint analysis and security scanning: passing, ours is AST-grounded.** Narsil's taint analyzer uses regex-like pattern matching over function and property names (`patterns.rs`). trace-mcp's AST-based dataflow analysis with type-aware pruning and OASIS SARIF 2.1.0 output is fundamentally sounder.
- **Zero refactoring tools and zero session memory.** Narsil-MCP is strictly read-only and stateless across agent turns — no symbol renames, moves, codemods, or code-linked decisions.

**RTK profiled this pass** (September 8, 2026 — read through the GitHub API at `master`, no clone and nothing executed: repository metadata, `Cargo.toml`, `README.md`, `src/cmds/system/read.rs`, `src/core/filter.rs`, `src/cmds/git/`, `src/cmds/js/vitest_cmd.rs`). 79,509 stars (GitHub API, this pass), Apache-2.0, Rust, v0.2.14. A high-performance CLI shell proxy that wraps bash/terminal execution in AI agent environments (Claude Code, Aider, Codex) to compress command output by 60–90% before it enters model context. It intercepts commands (`ls`, `git status`, `git diff`, `cargo test`, `npm test`, `pytest`, `docker ps`, `grep`), strips passing test logs, trims tracebacks, and collapses tables.

Three mechanisms were read and evaluated:
- **Smart file reading: passing on regex filtering.** RTK's `read`/`cat` uses regular expressions to strip comments and blank lines with zero AST awareness (no tree-sitter, no symbol graph). trace-mcp's `get_outline` and `get_symbol` provide true semantic AST slices without guessing.
- **Test output failure-only compression: already ours in workflow harness.** Our `scripts/test-quiet.mjs` applies the same failure-only discipline to test runs.
- **Adjacent shell proxy lane: noting positioning.** RTK does not parse code, resolve dependencies, index symbols, or execute refactorings. It sits in the adjacent shell proxy lane alongside Context Mode and Headroom, complementing rather than competing with code-graph tools: an agent can use RTK to compress bash command outputs while using trace-mcp for code intelligence, impact analysis, and refactoring.

**claude-mem profiled this pass** (September 8, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `package.json`, `src/servers/mcp-server.ts`, `src/services/smart-file-read/`, `src/services/sqlite/types.ts`). 93,476 stars (GitHub API, this pass), Apache-2.0, TypeScript, v13.24.1. The dominant session memory system for Claude Code, which recently expanded into code reading with `smart_search`, `smart_outline`, and `smart_unfold`. It utilizes 24 tree-sitter grammars to parse files dynamically on the fly (`walkDir`), folding bodies to display symbol signatures.

Three mechanisms were read and evaluated:
- **On-the-fly tree-sitter folding without an index: passing on the architecture.** claude-mem parses files during directory walks with no persistent graph, no cross-file import edges, no call hierarchy, and no impact analysis. trace-mcp's persistent SQLite graph amortizes parsing costs and computes deep semantic relationships across files.
- **File-bound vs symbol-bound memory: passing, ours is superior.** claude-mem records observations tied to file paths (`files_read`, `files_modified`) with no AST symbol linking and no git staleness verification. trace-mcp binds decisions directly to symbol IDs and verifies staleness at recall time.
- **Memory expansion into code intelligence: noting competitive convergence.** As generalist memory tools attempt to add code intelligence, they encounter the architectural ceiling of stateless file-folding without a persistent cross-file graph.

**Token Savior profiled this pass** (September 8, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `src/token_savior/server.py`, `src/token_savior/diagnostics.py`, `src/token_savior/tool_schemas.py`, `src/token_savior/tool_annotations.py`). 1,146 stars (GitHub API, this pass), Python, v4.0. It defines 75 tools with an adaptive `auto` and `optimized` profile.

Three mechanisms were read and evaluated:
- **Compiler diagnostics mapped to enclosing symbols (`get_diagnostics`): taking it.** Wraps the project's declared typechecker (`tsc --noEmit`, `mypy`, `pyright`), parses compiler errors, bounds the output, and maps each error position to its enclosing symbol via the AST symbol index (`attacher_symboles`). This prevents agents from running raw bash compiler builds that flood context with thousands of lines of untruncated output. Filed on Lead Engineer.
- **Sub-property schema description pruning (`_thin_input_schema`): already covered.** trace-mcp's `description_verbosity: "minimal"` already addresses schema verbosity.
- **MCP tool annotations (`readOnlyHint`, `destructiveHint`): already implemented.** trace-mcp already provides protocol-level tool annotations in `src/server/tool-annotations.ts`.

**AFT profiled this pass** (September 9, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `Cargo.toml`, `package.json`, `README.md`, `src/index/graph.rs`, `src/index/trigram.rs`, `src/tools/ast_grep.rs`, `src/transport/`). 278 stars (GitHub API, this pass), MIT, Rust + TypeScript, v0.7.2. Designed as a sensorimotor cortex / code intelligence sidecar for OpenCode and Pi agents, integrating a 30-language tree-sitter symbol graph, trigram search, and an embedded `ast-grep` engine.

Four mechanisms were read and evaluated:
- **Embedded `ast-grep` structural search (`src/tools/ast_grep.rs`): taking the concept for structural query evaluation.** AFT embeds `ast-grep` pattern matching, allowing agents to search AST structures using natural code pattern templates (e.g. `fn $NAME($$$ARGS) -> Result<$$$T>`) without writing raw tree-sitter SCM queries. trace-mcp excels at relational graph queries (`get_callers`, `get_change_impact`), but exposing an ergonomic AST template search mode would give agents flexible structural matching without query overhead.
- **Dual transport (MCP stdio + Unix Domain Socket): passing on socket transport.** AFT runs a local Unix domain socket alongside stdio MCP to minimize IPC overhead in dedicated agent environments. Standard stdio MCP is universally supported across all major host clients (Claude Code, Cursor, Zed, Windsurf) with imperceptible latency; maintaining an extra socket protocol adds daemon lifecycle complexity without meaningful benefit.
- **In-memory trigram symbol index: passing, SQLite FTS5 WAL is cleaner.** AFT maintains an in-memory trigram index alongside its AST graph. trace-mcp stores symbols and search indices in SQLite WAL mode using FTS5/trigram indexing, avoiding redundant memory consumption and cache synchronization drift.
- **Refactoring and session memory: absent in AFT.** AFT is purely an AST-assisted reader and search engine; it provides zero verified refactoring write tools (`refactor_rename`, `refactor_extract`, `refactor_codemod`), zero framework awareness, and zero symbol-anchored decision memory.

**GitNexus profiled this pass** (September 9, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `package.json`, `gitnexus/package.json`, `gitnexus/src/mcp/tools.ts`, `gitnexus/src/core/ingestion/community-processor.ts`, `gitnexus/src/core/ingestion/pipeline.ts`, `gitnexus/src/core/lbug/`). 47,177 stars (GitHub API, this pass), PolyForm-Noncommercial-1.0.0 (non-commercial only; commercial use prohibited without license), TypeScript / Node.js monorepo (`gitnexus`, `gitnexus-web`, `gitnexus-shared`), v1.6.11. It compiles native C++ Tree-sitter grammars (`node-gyp-build`, `node-addon-api`) across 10 languages (TS, JS, Python, Go, Rust, C#, C++, Java, PHP, Ruby). Storage pairs embedded LadybugDB graph database (`@ladybugdb/core` / Kùzu fork) with Cypher query execution, `graphology`, and in-memory Leiden community detection (`graphology-communities-leiden`). It defines 17 MCP tools (`list_repos`, `query`, `cypher`, `context`, `detect_changes`, `check`, `rename`, `impact`, `explain`, `pdg_query`, `route_map`, `tool_map`, `shape_check`, `api_impact`, `group_list`, `group_sync`, `trace`) and features Program Dependence Graph analysis (`analyze --pdg`) recording control dependence (CDG) and reaching definitions (REACHING_DEF).

Five mechanisms were read at source and each got a decision:

- **Leiden community detection with cohesion score (`calculateCohesion`): taking the cohesion score into subsystem metrics.** GitNexus uses Leiden graph clustering over `CALLS` edges to partition symbols into communities, calculating `cohesion = internalEdges / totalEdges` (sampling up to 50 nodes). In trace-mcp, rather than requiring an external native clustering engine or non-deterministic partition drift, calculating the intra-subsystem cohesion score for folders and modules gives agents an objective, deterministic modularity and coupling metric (0.0–1.0) directly from our symbol graph.
- **API response shape drift detection (`shape_check` and `api_impact`): taking the concept for framework edges.** GitNexus parses `.json({...})` return shapes from route handlers to extract top-level keys, compares them with client property accesses, and flags `MISMATCH` when consumers access properties not present in the route handler's shape. trace-mcp maps route-to-handler relationships across 88 frameworks; extending our AST extractor to compare route response object keys against frontend client usages is a high-value static contract check.
- **Shortest directed call tracing (`trace`): passing, we already do better.** GitNexus exposes a standalone `trace(from, to)` tool to find shortest call chains between two symbols. trace-mcp's `get_change_impact` and graph exploration already traverse transitive reachability across multi-tier resolution edges and framework boundaries; adding a dedicated single-pair path tool adds redundant surface.
- **Raw Cypher graph querying (`cypher`): passing, typed tools are safer for LLMs.** Allowing LLMs to write raw Cypher queries leads to severe prompt overhead, syntax errors, and hallucinations. Typed, schema-validated tools (`get_callers`, `get_change_impact`, `get_symbol`) provide deterministic context at a fraction of the token cost.
- **Proprietary PolyForm license and native build fragility: noting positioning.** PolyForm Noncommercial 1.0.0 forbids commercial deployment and enterprise adoption, whereas trace-mcp is 100% permissive MIT. Native C++ Tree-sitter bindings risk build failures across platforms, whereas trace-mcp uses WASM-sandboxed `web-tree-sitter` for universal portability.

**Code Pathfinder profiled this pass** (September 9, 2026 — read through the GitHub API at `main`, no clone and nothing executed: repository metadata, `server.json`, `sast-engine/mcp/tools.go`, `sast-engine/graph/initialize.go`, `sast-engine/graph/callgraph/builder/builder.go`, `sast-engine/graph/callgraph/doc.go`). 140 stars (GitHub API, this pass), Apache-2.0, Go core (`sast-engine` using `smacker/go-tree-sitter`) + Python SDK (`python-sdk`) for security rules, MCP server v2.1.1. Static code analysis engine exposing 13 MCP tools (`get_index_info`, `find_symbol`, `find_module`, `list_modules`, `get_callers`, `get_callees`, `get_call_details`, `resolve_import`, `find_dockerfile_instructions`, `find_compose_services`, `get_dockerfile_details`, `status`, `get_docker_dependencies`) across Python, Go, Java, Dockerfiles, and Docker Compose.

Four mechanisms were read at source and each got a decision:

- **Docker & Compose Infrastructure-as-Code (IaC) indexing (`find_dockerfile_instructions`, `find_compose_services`, `get_docker_dependencies`): taking the insight for cross-tier service topology.** Code Pathfinder parses Dockerfiles (extracting base images, stages, EXPOSE ports, USER, digests) and `docker-compose.yml` (service dependencies, volumes, ports, security flags like `privileged`). In full-stack and microservice repos, mapping Docker compose service links to backend ports bridges the gap between infrastructure and HTTP route handlers.
- **5-pass iterative type and call resolution pipeline: passing on Go pipeline architecture, validating our AST pipeline.** Code Pathfinder separates AST ingestion into 5 explicit sequential passes (module registry mapping, return type & variable extraction, attribute resolution, type-inferred call resolution, taint summaries). trace-mcp's incremental SQLite graph store achieves equivalent resolution stages with per-file invalidation and SCIP compiler enrichment, avoiding multi-pass re-indexing of unchanged files.
- **Programmatic security rules SDK (`python-sdk`): passing, we already do better.** Code Pathfinder provides a Python SDK (`dataflow.py`, `matchers.py`) to author custom taint rules. trace-mcp implements built-in OWASP Top-10 dataflow taint analysis with type-aware pruning, configurable quality gates, and standard OASIS SARIF 2.1.0 reporting.
- **Zero refactoring write tools and zero session memory.** Code Pathfinder is strictly a read-only SAST tool; it provides no AST refactoring write tools (`refactor_rename`, `refactor_extract`, `refactor_move`, `refactor_codemod`), zero framework awareness, and zero symbol-anchored decision memory.

**grafel profiled this pass** (September 11, 2026 — read through the GitHub API at `main`, no clone and nothing executed: `go.mod`, `cmd/grafel/`, `internal/mcp/`, `internal/substrate/`, `internal/responseshapediff/`, `internal/tautology/`, `internal/stubdetector/`, `internal/mmapview.go`). 15 stars (GitHub API, this pass), MIT, Go (Go 1.23+ with cgo Tree-sitter), v0.x. Multi-repo code knowledge graph daemon for AI agents exposing 22 MCP tools (`grafel_whoami`, `grafel_find`, `grafel_inspect`, `grafel_expand`, `grafel_trace`, `grafel_traces`, `grafel_clusters`, `grafel_orient`, `grafel_effects`, `grafel_control_flow`, `grafel_endpoint_posture`, `grafel_payload_drift`, `grafel_literal_parity`, `grafel_auth_posture_diff`, `grafel_stub_detector`, `grafel_response_shape_diff`, `grafel_security_findings`, `grafel_pure_functions`, `grafel_import_cycles`, `grafel_def_use`, `grafel_data_flows`, `grafel_stats`). Storage uses an in-memory/mmap graph substrate (`mmapview.go`) with file-watcher driven incremental cache updates.

Four mechanisms were read at source and each got a decision:

- **Static quality canaries: Stub and tautology detection (`grafel_stub_detector`, `grafel_tautology_detector`): taking into quality gates.** grafel includes dedicated AST canaries to detect unimplemented stub functions (TODOs, empty blocks, panic/throw stubs) and tautological logic (`x == x`, redundant self-assignments, useless boolean branches). Adding static stub and tautology checks to trace-mcp's `check_quality_gates` and `detect_antipatterns` gives coding agents an immediate automated sanity check to catch placeholder code before committing.
- **Cross-repo payload drift (`grafel_response_shape_diff`, `grafel_payload_drift`): taking concept for multi-package monorepos.** grafel compares route handler return dictionaries/structs against API client field accesses across multiple repositories, flagging breaking contract drift. trace-mcp already tracks 88 frameworks; extending our AST extractor to compare route response shape keys against consumer fetch/axios/RPC callers across workspaces bridges frontend and backend contracts.
- **Multi-repo workspace topology (`internal/repowalk/`, `internal/repolock/`, `internal/routing/`): taking into monorepo and workspace roadmap.** grafel links multiple git repositories into a unified knowledge graph, tracking endpoints in backend services to API client callers in frontend/mobile repos. Adding multi-workspace graph linking enables agents in distributed microservice architectures to trace API callers across repo boundaries.
- **cgo Tree-sitter daemon with in-memory/mmap storage vs. portable SQLite WASM: passing.** grafel runs a Go daemon compiling C Tree-sitter grammars with cgo (`grammars.lock`), introducing native compiler dependencies and build fragility across platforms. trace-mcp's WASM sandbox guarantees memory safety and crash isolation with zero native compilation. Additionally, trace-mcp provides full AST refactoring write tools (`refactor_rename`, `refactor_extract`, `refactor_move`, `refactor_codemod`) and code-anchored decision memory, neither of which exists in grafel.

Priority for next deep-dive: **Narsil-MCP** (`postrv/narsil-mcp`, Rust, 182★, CCG 4-layer progressive disclosure) and a re-read of **Graft** (`trailhq/Graft`, 7.0K★, fastest-growing peer).

**Narsil-MCP profiled this pass** (September 11, 2026 — read through the GitHub API at `main`, no clone and nothing executed: `Cargo.toml`, `src/ccg/mod.rs`, `src/ccg/layers.rs`, `src/callgraph.rs`, `src/cfg.rs`, `src/taint/`, `src/mcp.rs`, `docs/CODE_CONTEXT_GRAPH_SIZING_ARCH.md`). {{ site.data.competitors.narsil_mcp.stars }} stars (GitHub API, this pass), Apache-2.0, Rust, v0.x. High-performance code intelligence MCP server written in Rust with 32 Tree-sitter parsers, hybrid BM25/neural embeddings, and a multi-layer Code Context Graph (CCG) generation pipeline.

Four mechanisms were read at source and each got a decision:

- **Hierarchical progressive disclosure (CCG L0–L3 layers: Manifest, Architecture, Symbol Index, Full Detail): taking concept into `pack_context` and architecture summaries.** Narsil-MCP sizes codebase knowledge into 4 discrete layers: L0 Manifest (~1–2 KB JSON-LD with repository identity, counts, top-level stacks), L1 Architecture (~10–50 KB module hierarchy and public API), L2 Symbol Index (call graph and definitions), and L3 Full Detail. Adopting a strict L0 budget (~1–2 KB) in `pack_context` and `describe_architecture` gives agents an immediate overview of repository topology on turn zero without blowing prompt budgets.
- **RDF / N-Quads triple stores and semantic web ontologies: passing.** Narsil-MCP exports graphs in RDF/N-Quads format (`<subject> <predicate> <object> <graph> .`). LLMs require significant prompt overhead to parse or reason over N-Quads compared to clean, typed JSON tool responses. trace-mcp's flat, strongly-typed JSON schema and embedded SQLite engine minimize token deserialization cost while providing relational indexing.
- **90-tool uncurated schema vs. adaptive role presets: passing, validating our preset architecture.** Narsil-MCP advertises ~90 tools on startup (generating over 15K tokens of schema definitions). trace-mcp curates tools into task-specific presets (`minimal`, `review`, `architecture`, `dev`) keeping initial schema load under 2K tokens while providing dynamic tool access via `load_tools`.
- **Read-only SAST vs. AST refactoring write path and code-anchored memory: passing.** Like most SAST-rooted peers, Narsil-MCP provides zero AST modification tools and no decision memory. trace-mcp provides atomic AST refactorings (`refactor_rename`, `refactor_extract`, `refactor_move`, `refactor_codemod`) and symbol-bound decision memory.

**Graft profiled this pass** (September 11, 2026 — read through GitHub repository at `main`: `package.json`, `README.md`, `src/cli/`, `src/graph/`, `src/mcp/`). 7,056 stars ({{ site.data.competitors.graft.stars }}, GitHub API, this pass), MIT, TypeScript, v0.x (`@nanonets/graft` / `trailhq/Graft`). Rapidly growing context layer for AI coding agents (Claude Code, Cursor) that generates plain-language subsystem and concept explanation nodes in markdown files.

Three mechanisms were read at source and each got a decision:

- **Plain-language concept nodes as navigable markdown docs: taking concept for documentation generation.** Graft generates curated markdown files in `graft/` describing subsystems and architectural boundaries in plain English rather than raw AST dumps. Bringing concept-level summaries into trace-mcp's `describe_architecture` and decision memory bridges syntax graphs with high-level developer intent.
- **Offline LLM dependency for graph generation: passing, affirming local-first deterministic parsing.** Graft requires an external LLM (OpenAI, Anthropic, OpenRouter) and paid API keys to read and summarize every source file before the graph exists. trace-mcp indexes polyglot codebases in seconds using 100% deterministic local Tree-sitter WASM and SQLite with zero external API calls, zero token bills, and complete offline privacy.
- **Loose file-based markdown store vs. relational embedded SQLite: passing.** Graft stores graph nodes as loose files on disk. For large codebases with tens of thousands of symbols and deep call hierarchies, traversing file trees is slow and lacks relational join capabilities. trace-mcp's embedded SQLite with FTS5 and indexed edge tables provides sub-millisecond graph queries (`find_symbol`, `find_usages`, `get_change_impact`, `find_path`). → [trace-mcp vs Graft](/vs/graft.html)

Priority for next deep-dive: **SDL-MCP** client-side hook generation and **RTK** (Real-Time Knowledge).

**Bottom line:** trace-mcp's moat — framework-aware graph + refactoring + code-linked memory in one local MCP — is intact and unmatched as a *combination*. Six of seven gaps identified in the June 2026 re-verification are now shipped; the adversarial validation pass that followed found and fixed 15+ real bugs (several of them "the feature silently didn't work at all," not cosmetic) rather than taking the initial implementation on faith. The one deliberately-open gap (a peer-reviewed validated health metric) is honestly labeled as such rather than oversold.

## Next steps

- See the full [tools reference](/tools-reference.html) for every MCP tool trace-mcp exposes, grouped by framework.
- Read the [architecture](/architecture.html) page for how the indexing pipeline, storage, and LSP enrichment fit together.
- Check [supported frameworks & languages](/supported-frameworks.html) to confirm your stack is covered.
- [Get started](/#install) — trace-mcp works out of the box, no configuration required.

---

# Repomix alternative: trace-mcp vs Repomix

Source: https://trace-mcp.com/vs/repomix.html



**TL;DR.** Repomix answers "put my repository into a prompt." trace-mcp answers "let the agent look things up in my repository." Repomix is a packer: it concatenates files into one artifact, optionally stripping function bodies with tree-sitter to save bytes. trace-mcp is an index: it parses the repo into a dependency graph with full-text search and serves it over MCP, so an agent asks for the outline of one file or the callers of one symbol instead of loading a snapshot of everything.

If you are picking between them, the question is not "which is better" — it is **how many turns your agent spends in the same repo**.

## Head-to-head

| Capability | trace-mcp | Repomix |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.repomix.stars }} |
| Model | live index (SQLite + FTS5) | one-shot pack |
| Tree-sitter AST parsing | ✓ {{ site.data.counts.languages }} languages | ✓ `--compress` only (~20) |
| Token-efficient symbol lookup | ✓ outlines, symbols, bundles | ✗ packs entire files |
| Cross-file dependency graph | ✓ directed edge graph | ✗ |
| Framework-aware edges | ✓ {{ site.data.counts.frameworks }} integrations | ✗ |
| Call graph | ✓ bidirectional, graph-based | ✗ |
| Impact analysis | ✓ reverse dependency traversal | ✗ |
| Search | ✓ FTS5 + embeddings + graph | ✓ regex over the pack (`grep_repomix_output`) |
| Refactoring tools | ✓ rename, move, signature, codemod, extract | ✗ |
| Security scanning | ✓ OWASP Top-10, taint analysis | ✓ Secretlint (secrets only) |
| Freshness | ✓ incremental, file-watcher, content hash | ✓ `--watch`, but a full re-pack, local dirs only |
| Remote repositories | ✓ multi-repo subprojects | ✓ packs remote repos directly |
| Official MCP server | ✓ core product | ✓ `--mcp` |
| Setup cost | index build, then instant queries | none, but re-pack on every change |
| Works offline, no API keys | ✓ | ✓ |
| Written in | TypeScript | TypeScript |

## When to pick Repomix

Honest version, and it is a real list:

- **One-shot questions.** "Read this whole repo and tell me what it does" is exactly what a pack is for. No index build, no daemon, no config.
- **Repositories you do not own.** `repomix --remote owner/name` gives you a third-party codebase in a prompt in seconds. trace-mcp can index other repos as subprojects, but that is a heavier setup for a one-time look.
- **Small repositories that fit in context.** If the whole thing fits, a graph buys you nothing — the model already has every file.
- **Zero-install-in-the-loop workflows.** Pasting a pack into a web chat needs no MCP client at all.
- **Ecosystem.** Repomix is roughly 280× more popular by stars, with far more third-party recipes and integrations. That matters when you need an answer from a search engine at 2am.

## When to pick trace-mcp

- **The repo does not fit in context**, so a pack is either truncated or ruinously expensive.
- **Multi-turn sessions.** A pack is a fixed cost re-paid every time it is regenerated; an index is a fixed cost paid once and amortised across every query in the session.
- **The question is structural.** "What breaks if I change this function", "who calls this", "which route handler renders this component" — a pack contains the bytes that would answer this, but nothing that computes it. trace-mcp resolves it as one tool call over the graph.
- **Framework semantics matter.** A graph that knows `UserController` exists but not that it renders `Users/Show.vue` via Inertia is missing the edges a developer actually reasons about. trace-mcp ships {{ site.data.counts.frameworks }} framework integrations for exactly those edges.
- **You want the agent to change code, not just read it.** Rename across files, move a symbol, change a signature, apply an AST codemod, remove verified-dead code — Repomix has no write path.
- **Freshness.** trace-mcp reindexes incrementally on file change, per file. Repomix's `--watch` re-packs the whole output after a 300 ms debounce and only works on local directories; without it, a pack is stale from the first edit after it was written.

## The honest caveat on token cost

trace-mcp's per-query cost is small, but its *advertised* cost is not free: on the shipped default path, `tools/list` is 28 tools and roughly 11.6K tokens, paid by every client that does not support deferred tool loading. That is down from ~50K, once the preset bypass on the daemon-backed path was fixed and the default preset moved to `minimal`; everything outside it is one `load_tools` call away. A short session on a small repo can still genuinely cost less through Repomix. We would rather say that here than have you discover it yourself.

**Our security scanning has a ceiling, and it is stated on the [comparisons page](/comparisons.html) rather than only here.** The control-flow graph is line-based, not AST-based, and taint analysis is lexical/regex, not a real dataflow engine. Type-aware pruning cuts false positives; it does not turn this into a dataflow analyser. A full AST/dataflow rewrite is out of scope for now.

## FAQ

**Is trace-mcp a drop-in replacement for Repomix?**
No. Repomix produces one packed file you paste or attach; trace-mcp exposes MCP tools an agent calls during a session. If your workflow is "paste my repo into a chat", Repomix is the closer fit. If your agent runs many turns against the same repo, trace-mcp replaces the pack entirely, because the agent queries the index instead of re-reading a snapshot.

**Does Repomix have an MCP server?**
Yes — an official one, via `--mcp`, including packing remote repositories. It is still packing rather than indexing: the tools return file content, not a symbol graph.

**Repomix has a `--compress` flag. Isn't that the same as a code graph?**
No. `--compress` uses tree-sitter to strip function bodies and keep signatures, cutting roughly 70% of a pack's bytes. That is lossy summarisation *per file*. There are no cross-file edges, no call graph, and no impact analysis.

**Which one is cheaper in tokens?**
It depends on session length. A pack is a fixed up-front cost, re-paid on every refresh. trace-mcp pays an up-front schema cost (see the caveat above) and then small scoped per-query costs. One-shot question on a small repo: Repomix. Multi-turn session on a repo that does not fit in context: trace-mcp.

**Can I use both?**
Yes, and it is a sensible setup — Repomix for handing a whole small or third-party repo to a model in one shot, trace-mcp for navigation, impact analysis and refactoring in the repo you work in daily.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- Comparing Repomix against something other than us: [Repomix vs codegraph](/vs/repomix-vs-codegraph.html) — packing against indexing, on their own terms.
- Shopping on license rather than packing? The [jCodeMunch alternative](/vs/jcodemunch.html) head-to-head compares MIT against a non-commercial-only license.
- [Cut Claude Code token usage](/reduce-claude-code-token-usage.html) — the measured tactics, including the ones that have nothing to do with us.
- [Get started](/#install) — no configuration required.

---

# Serena MCP alternative: trace-mcp vs Serena

Source: https://trace-mcp.com/vs/serena.html



**TL;DR.** Serena and trace-mcp both give an agent structured code navigation instead of raw file reads, and they get there from opposite directions. Serena is a **live LSP proxy**: it asks a real language server your question, so its references and renames are compiler-grade, but its world is exactly what the language server knows. trace-mcp is a **precomputed graph**: tree-sitter parsing across {{ site.data.counts.languages }} languages into SQLite, with framework-aware edges, refactoring, security scanning and code-linked memory on top — and LSP or offline SCIP as an *optional* precision upgrade rather than a hard dependency.

Pick Serena if precision on one well-supported language is the whole job. Pick trace-mcp if breadth, framework semantics, or anything beyond navigation is.

## Head-to-head

| Capability | trace-mcp | Serena |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.serena.stars }} |
| Languages | {{ site.data.counts.languages }} (tree-sitter) | 40+ (73 LSP backends) |
| Requires a language server | ✗ optional enrichment | ✓ core premise |
| Reference precision by default | AST-resolved (tiered) | compiler-grade (LSP) |
| Compiler-grade path | ✓ opt-in LSP + offline SCIP ingestion | ✓ live LSP |
| Framework integrations | ✓ {{ site.data.counts.frameworks }} | ✗ |
| Cross-language edges | ✓ | ✗ |
| Persistent state across restarts | ✓ SQLite + FTS5 graph | partial — on-disk symbol cache, no graph |
| Impact analysis | ✓ reverse dependency traversal + decorator filter | ✗ |
| Call graph | ✓ bidirectional, graph-based | ✗ not exposed as a tool |
| Refactoring tools | ✓ rename, move, signature, AST codemod, extract | ✓ rename, safe-delete; move and inline only via the JetBrains bridge |
| Live debugger | ✗ deliberately out of lane | ✓ via a JetBrains IDE bridge (optional, beta) |
| Session memory | ✓ code-linked decision graph, staleness-checked at recall | ✓ markdown notes, cross-referenced but not code-linked |
| Security scanning | ✓ OWASP Top-10, type-aware taint | ✗ |
| Control-flow / data-flow | ✓ CFG with basic blocks and loop back-edges | ✗ |
| SARIF / CI output | ✓ 2.1.0, schema-validated | ✗ |
| Multi-repo subprojects | ✓ cross-repo API linking | partial — query another project, no cross-repo edges |
| Graph visualization | ✓ desktop app | ✗ |
| MCP tools advertised (default) | 29 (~11.6K tok); {{ site.data.counts.tools }} on `full` | 29; 52 defined |
| Written in | TypeScript | Python |

## When to pick Serena

- **You work in one language with a first-class language server.** For Python or TypeScript, "find all references" and "rename symbol" from a real language server are correct in cases AST heuristics get wrong: overloads, re-exports, generics, dynamic dispatch through interfaces. That is a genuine precision lead, and it is on by default for Serena while it is opt-in for us.
- **You want no index build step.** There is no graph to construct and nothing to re-index after a pull. Serena is not fully stateless, though — `SolidLanguageServer` keeps two pickled per-file symbol caches under `.serena/cache/<language>/` (`raw_document_symbols.pkl`, `document_symbols.pkl`), loaded on start and keyed by file content hash, so warm queries survive a restart. What it does not keep is edges: no import graph, no call graph, no impact traversal.
- **You already work inside a JetBrains IDE.** Serena can bridge into it for debugging — breakpoints, stepping and variable inspection driven by the agent (an optional beta tool, and it needs the IDE plus their plugin running). trace-mcp deliberately does not do this; a static graph is not the right tool for a running process, and we are not planning to chase it.
- **Popularity.** Serena is roughly 280× larger by stars, with correspondingly more community answers and integrations.

## When to pick trace-mcp

- **Your stack is polyglot or unusual.** {{ site.data.counts.languages }} tree-sitter grammars beat 40+ language servers when part of your repo is Terraform, Kotlin, SQL, Dockerfiles, or a language whose LSP is a maintenance liability.
- **The edges you care about are framework edges.** Route → handler, controller → template, model → table, component → component. No language server models these. trace-mcp ships {{ site.data.counts.frameworks }} integrations that do.
- **You want impact analysis, not just references.** "Everything transitively affected by changing this function, filtered to route handlers" is a graph traversal; it is not an LSP request.
- **The job goes past navigation.** Security scanning with type-aware taint pruning, quality gates, dead-code removal, AST codemods, SARIF output for CI, complexity and churn hotspots — Serena's scope stops well before these.
- **Memory should survive the session and be tied to code.** Serena's memories are notes the agent writes. trace-mcp's decisions are linked to symbol IDs, verified as non-stale at recall time, and surface inside `get_change_impact`.

## Where we are not being smug

Two honest points.

First, **the table above used to be built from Serena's README, and reading the source moved four rows in Serena's favour.** We cloned it at commit `43ae021` (version 1.7.1.dev0, MIT) and read its tool package, its memory package, its project server and its `solidlsp` language-server layer. What changed:

- **It is not stateless.** We claimed "no persistent state, per-session". It persists two pickled document-symbol caches per language and loads them at startup (see the bullet above). Warm symbol lookups do survive a restart; only the edges do not exist.
- **It can reach other repositories.** We claimed a flat ✗. `query_project` and `list_queryable_projects` run any read-only Serena tool against another registered project, through a small Flask project server. Both are optional tools, off unless enabled, and there are still no edges between repositories — but "cannot" was wrong.
- **Its memories are more than notes.** We called them manual notes. They are markdown files under `.serena/memories` with topic namespacing, a global scope beside the project scope, and `mem:` cross-references with referential-integrity checking and autofix. What they are not is code-linked: nothing ties a memory to a symbol, and nothing rechecks it against the code when it is recalled. That narrower difference is the real one.
- **Its default surface is 29 tools, not ~55.** The registry marks 52 tool classes, 23 of them optional (13 are the JetBrains bridge), leaving 29 enabled by default — so the honest comparison against our 29 is "the same size", not "half".

Two rows moved the other way, and we state the evidence rather than the verdict. **Call graph**: `callHierarchy/incomingCalls` and `outgoingCalls` are implemented in the LSP client layer, but no tool class calls them, so an agent cannot ask Serena for a call graph. **Move and inline refactoring**: `JetBrainsMoveTool` and `JetBrainsInlineSymbol` proxy to a running JetBrains IDE; both are optional and beta. Native and always-on are `rename_symbol` and `safe_delete_symbol`.

If you maintain Serena and something here is wrong, [open an issue](https://github.com/nikolai-vysotskyi/trace-mcp/issues) and we will fix it.

Second, **our default tool surface is expensive.** trace-mcp advertises 29 tools, roughly 11.6K tokens, on the shipped default path as of August 29, 2026 — down from ~50K, once the preset bypass on the daemon-backed path was fixed and the default preset moved to `minimal`. That is level with Serena's 29 default tools rather than an order of magnitude above it, and anything outside the default is one `load_tools` call away.

**Our security scanning has a ceiling, and it is stated on the [comparisons page](/comparisons.html) rather than only here.** The control-flow graph is line-based, not AST-based, and taint analysis is lexical/regex, not a real dataflow engine. Type-aware pruning cuts false positives; it does not turn this into a dataflow analyser. A full AST/dataflow rewrite is out of scope for now.

## FAQ

**What is the core difference between Serena and trace-mcp?**
Serena proxies a live language server per request: compiler-grade, but only as broad as the language server. trace-mcp precomputes a persistent graph from tree-sitter, then optionally upgrades edges with LSP or offline SCIP. Precision-first and stateless versus breadth-first and persistent.

**Is Serena more accurate than trace-mcp?**
For plain references and renames in a well-served language, yes by default. trace-mcp closes that gap only with opt-in LSP enrichment or a SCIP index, which raise edges to the `lsp_resolved` / `scip_resolved` tier. For cross-language and framework edges, no language server has the answer at all.

**Does trace-mcp need a language server installed?**
No. tree-sitter alone covers {{ site.data.counts.languages }} languages with no toolchain and no compile step. LSP is opt-in; SCIP ingestion is offline. Serena's premise is the opposite — no language server for your stack means no answers.

**Can Serena do impact analysis or framework-aware navigation?**
Not as a graph. "References to this symbol" is an LSP request; "this controller renders that template via Inertia" is not something a language server models.

**Which has a lower startup cost?**
Serena on a cold repo — no index build, though the language server still has to warm up, which on a large TypeScript or Java project is not free. Its pickled symbol caches make the second start cheaper than the first. trace-mcp pays a one-time index build, then serves from SQLite; both survive restarts, but only trace-mcp's stored state includes edges.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- [PR review context benchmark](/pr-context-benchmark.html) — measured input-token cost of code-review context on 60 merged pull requests.
- [Architecture](/architecture.html) — how the indexing pipeline, storage and LSP enrichment fit together.
- [Get started](/#install) — no configuration required.

---

# codebase-memory-mcp alternative: trace-mcp vs codebase-memory-mcp

Source: https://trace-mcp.com/vs/codebase-memory-mcp.html



**TL;DR.** codebase-memory-mcp (DeusData) is the peer closest to trace-mcp's premise: parse a repository into a persistent knowledge graph and serve it to agents over MCP, instead of letting them re-read files. Both do impact analysis, call-path tracing, cross-service linking and infrastructure-as-code as graph nodes.

The split is depth versus breadth, in both directions. codebase-memory-mcp is broader on languages (161 vs {{ site.data.counts.languages }}) and dramatically leaner on advertised tool cost. trace-mcp is deeper per repository: {{ site.data.counts.frameworks }} framework integrations produce edges a language-agnostic parser cannot, and it can act on the graph — rename, move, codemod, remove dead code, scan for vulnerabilities — rather than only describe it.

## Head-to-head

| Capability | trace-mcp | codebase-memory-mcp |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.codebase_memory_mcp.stars }} |
| Languages | {{ site.data.counts.languages }} | 161 |
| Framework integrations | ✓ {{ site.data.counts.frameworks }} | ✗ (partial REST routes) |
| Persistent knowledge graph | ✓ SQLite + FTS5 | ✓ |
| Knowledge-graph queries | ✓ `graph_query` | ✓ Cypher-like |
| Impact analysis | ✓ reverse dependency traversal + decorator filter | ✓ `detect_changes` |
| Call graph | ✓ bidirectional | ✓ `trace_call_path` |
| Cross-service / multi-repo | ✓ cross-repo API linking | ✓ cross-service HTTP linking |
| IaC as graph nodes | ✓ K8s/Kustomize/HCL/Docker, cross-file resolved | ✓ K8s/Kustomize/HCL/Docker |
| Clone / community detection | ✓ AST Type-2 subtree hashing, 11 antipatterns | ✓ MinHash near-clone, Louvain communities |
| Refactoring tools | ✓ rename, move, signature, AST codemod, extract | ✗ |
| Security scanning | ✓ OWASP Top-10, type-aware taint, SARIF 2.1.0 | ✗ |
| Control-flow graph | ✓ basic blocks, loop back-edges, try/catch merges | ✗ |
| Quality gates in CI | ✓ complexity / security / coverage thresholds | ✗ |
| Code-linked decision memory | ✓ decisions bound to symbol IDs, staleness-verified | partial (`manage_adr` markdown documents) |
| Runtime trace ingestion | ✗ | ✓ `ingest_traces` |
| Graph visualization | ✓ desktop app | ✓ 3D web UI |
| MCP tools advertised (default) | 29 (~11.6K tok); {{ site.data.counts.tools }} on `full` | 15 (~7K tok); profiles: 11 / 7 |
| Supply-chain posture | OpenSSF Scorecard, CodeQL, Semgrep | SLSA L3, VirusTotal, OpenSSF Scorecard |
| Published benchmark | ✓ [PR review context](/pr-context-benchmark.html), one task, losses published | ✓ preprint, 31 repos, not independently reproduced |
| Written in | TypeScript | C |

## When to pick codebase-memory-mcp

This is the peer where the honest list is longest, so here it is in full:

- **Your advertised tool budget is tight.** 15 tools at roughly 7K tokens — or 7 with `--tool-profile=scout` — against trace-mcp's ~11.6K on the shipped default path (down from ~50K; the preset-bypass bug is fixed and the default is now `minimal`). If you run several MCP servers in one client and every one of them is competing for the same context window, a ~1.7× difference still matters. This is the clearest place any competitor beats us, and we are not going to pretend otherwise on our own comparison page.
- **You need a language we do not parse.** 161 grammars against {{ site.data.counts.languages }}. If your repo has one in the gap, none of trace-mcp's depth helps you.
- **You want evidence across a broad workload.** Its authors published a benchmark preprint (arXiv 2603.27277: 83% answer quality, ~10× fewer tokens, 2.1× fewer tool calls across 31 repositories). We have not reproduced it and it is not peer-reviewed. Ours — the [PR review context benchmark](/pr-context-benchmark.html), median {{ site.data.pr_context_bench.median_savings_pct }}% over {{ site.data.pr_context_bench.pr_count }} merged pull requests in {{ site.data.pr_context_bench.repo_count }} repositories we do not maintain — is the more auditable of the two — it ships the exact revisions, the losing cases and the command that re-runs it — but it measures one task, not general exploration, and theirs runs on real open-source repositories too. If breadth of workload is what you need evidence for, theirs is the wider claim.
- **Supply-chain requirements are strict.** SLSA Level 3 provenance plus VirusTotal-scanned reproducible release candidates is a stronger posture than ours, and in a regulated environment that can be the whole decision.
- **You have runtime traces to fold in.** `ingest_traces` enriches the graph with observed caller/callee counts — dynamic edges static analysis cannot see. trace-mcp has no equivalent.

## When to pick trace-mcp

- **Framework semantics.** A graph that knows `UserController` exists but not that it renders `Users/Show.vue` via Inertia is missing the edges developers actually reason about. {{ site.data.counts.frameworks }} integrations produce route → handler, controller → template, model → table and component edges; a language-agnostic parser produces none of them.
- **You want the agent to change code.** Rename across files with import rewriting, symbol and file moves, signature changes that update call sites, AST-based codemods with metavariable substitution, dead-code removal with orphan-import detection. codebase-memory-mcp is read-only.
- **Security is part of the job.** OWASP Top-10 rules, taint analysis with type-aware pruning, and OASIS-schema-validated SARIF 2.1.0 for CI ingestion.
- **Memory should be code-linked and verified.** `manage_adr` writes flat markdown documents. trace-mcp binds decisions to symbol IDs, checks at recall time that the linked code still resolves and is unchanged, and surfaces them inside `get_change_impact` — so a decision about code that was deleted stops being served.
- **Gates, not just reports.** Quality gates with configurable complexity, security and tech-debt thresholds, plus SARIF output, make the graph a CI participant rather than a chat aid.

## The honest caveat on security scanning

**Our security scanning has a ceiling, and it is stated on the [comparisons page](/comparisons.html) rather than only here.** The control-flow graph is line-based, not AST-based, and taint analysis is lexical/regex, not a real dataflow engine. Type-aware pruning cuts false positives; it does not turn this into a dataflow analyser. A full AST/dataflow rewrite is out of scope for now.

## FAQ

**How similar are trace-mcp and codebase-memory-mcp?**
The closest pair in this space. Both parse with tree-sitter into a persistent knowledge graph, both do impact analysis and call-path tracing, both model IaC as nodes. The divergence is what sits on top: framework-aware edges, refactoring, security and code-linked memory for trace-mcp; raw language breadth and a much leaner advertised surface for codebase-memory-mcp.

**It supports 161 languages and trace-mcp supports {{ site.data.counts.languages }}. Does that matter?**
Only if your repository contains a language in the gap. trace-mcp's coverage targets the real-world long tail rather than a count; the depth goes into per-framework semantics instead.

**Is codebase-memory-mcp cheaper in tokens?**
On advertised surface, yes — ~7K against our ~11.6K on the shipped default path as of August 29, 2026. The preset-bypass bug that put us at ~50K is fixed and the default preset is now `minimal`; the remaining ~1.7× gap is real and is the clearest place a competitor leads.

**Does it have a published benchmark?**
Yes — a self-published preprint (arXiv 2603.27277) across 31 repositories, not independently reproduced and not peer-reviewed. So does trace-mcp, narrower: the [PR review context benchmark](/pr-context-benchmark.html), median {{ site.data.pr_context_bench.median_savings_pct }}% over {{ site.data.pr_context_bench.pr_count }} merged pull requests in {{ site.data.pr_context_bench.repo_count }} repositories nobody here maintains, with the losing cases and the re-run command shipped. Theirs is the wider workload; ours is the more auditable.

**Can either one refactor code, not just read it?**
Only trace-mcp. codebase-memory-mcp is read-only analysis.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- [PR review context benchmark](/pr-context-benchmark.html) — measured input-token cost of code-review context on 60 merged pull requests.
- [Decision memory](/decision-memory.html) — how code-linked decisions differ from a notes file.
- [Get started](/#install) — no configuration required.

---

# CodeGraphContext alternative: trace-mcp vs CodeGraphContext

Source: https://trace-mcp.com/vs/codegraphcontext.html



**TL;DR.** CodeGraphContext is the peer that drives the most compiler-grade indexers, and that is the thing to understand before comparing anything else. Turn on `SCIP_INDEXER=true` and it shells out to **eleven** Sourcegraph SCIP indexer families, folds their symbol data into its property graph, and falls back to tree-sitter for whatever SCIP did not cover. Nobody else here does that, us included: our bridge auto-runs three.

The price is set-up. Every SCIP language needs its indexer binary installed first, C/C++ additionally need a `compile_commands.json`, and the graph itself lives in one of six database backends you pick between. trace-mcp asks none of those questions — one embedded SQLite+FTS5 store, no binaries, no backend — and spends its complexity budget elsewhere: {{ site.data.counts.frameworks }} framework integrations resolving route → handler, controller → template and model → table, plus a write path.

Pick CodeGraphContext when reference precision on a mainstream language justifies installing a toolchain. Pick trace-mcp when the job continues past reading.

## Head-to-head

| Capability | trace-mcp | CodeGraphContext |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.codegraphcontext.stars }} |
| License | MIT | MIT |
| Written in | TypeScript | Python |
| Maturity self-classified | stable releases | `Development Status :: 3 - Alpha` |
| Languages (tree-sitter) | {{ site.data.counts.languages }} | 23 |
| SCIP indexers driven for you | 3 (scip-typescript, scip-python, rust-analyzer) | **11 families**, opt-in via `SCIP_INDEXER=true` |
| Ingests a `.scip` index you built | ✓ | ✓ |
| Framework integrations | ✓ {{ site.data.counts.frameworks }} | 2 tools, Java Spring only |
| Framework edges beyond routing | ✓ controller → template, model → table, component → component | ✗ |
| Storage | embedded SQLite + FTS5, no choice to make | 6 backends: FalkorDB Lite / Remote, KuzuDB, LadybugDB, Nornic DB, Neo4j |
| Runs fully local, no API key | ✓ | ✓ (embedded backends) |
| MCP tools defined | {{ site.data.counts.tools }} | 29 |
| MCP tools advertised by default | 28 (~11.6K tok) | **29** (~3.7K tok) |
| Trimming the surface | ✓ presets + `load_tools` allowlist | `disabledTools` denylist |
| Raw graph query escape hatch | ✗ fixed tool set | ✓ `execute_cypher_query` |
| Portable pre-indexed bundles | ✗ | ✓ `.cgc` snapshots, Hugging Face registry |
| Database structure as graph nodes | ✗ | ✓ MySQL, Redis, Cassandra ingesters |
| Impact analysis | ✓ reverse traversal + decorator filter | ✓ `simulate_architectural_change` (reports only) |
| Dead code / complexity | ✓ detect **and** remove | ✓ detect only |
| Refactoring tools | ✓ rename, move, signature, AST codemod, extract | ✗ |
| Security scanning | ✓ OWASP Top-10, type-aware taint | ✗ |
| SARIF / CI output | ✓ 2.1.0, schema-validated | ✗ |
| Session memory | ✓ code-linked decision graph | ✗ |
| Published token benchmark | ✓ [PR review context](/pr-context-benchmark.html), {{ site.data.pr_context_bench.pr_count }} merged PRs | ✗ |

Verified on September 6, 2026 against CodeGraphContext's source at repository head (`pyproject.toml` 0.6.13, latest tagged release v0.5.7, pushed that day). Tool count and names come from `src/codegraphcontext/tool_definitions.py`, the denylist from `server.py`, the indexer families from `tools/scip_indexer.py`, backends and language count from the README's own tables.

## When to pick CodeGraphContext

- **You want references a heuristic parser cannot give you, across a lot of languages.** Eleven SCIP families — python, typescript, go, rust, java, clang, dotnet, php, ruby, swift, ctags — is more driven indexers than any other project in this comparison, and the fallback to tree-sitter for uncovered files means turning it on does not cost you coverage.
- **Someone else has already indexed the dependency you care about.** `.cgc` bundles are downloadable graph snapshots from a public registry. Skipping an index entirely is a capability nobody else here offers.
- **Your graph question is not one of the shipped tools.** `execute_cypher_query` hands you the database. Our tool set is fixed by design; theirs has a back door, if you write Cypher.
- **Your data layer is part of the architecture question.** Their MySQL, Redis and Cassandra ingesters put schema structure in the same graph as the code. We model code only.
- **You want the whole surface listed without opting in.** All 29 tools are advertised, for about 3.7K tokens of schema — a third of what our default preset costs.

## When to pick trace-mcp

- **You want it working in one command with nothing else installed.** No indexer binaries, no `compile_commands.json`, no graph database and no backend decision. That difference is the whole first-run experience.
- **The edges you care about are framework edges.** {{ site.data.counts.frameworks }} integrations resolving route → handler, controller → template, model → table. CodeGraphContext's framework awareness is two hardcoded Java Spring tools.
- **The job goes past reading.** Rename across a repository, move a symbol with its imports, an AST codemod, dead-code removal, a taint scan, SARIF for CI. They detect and report; they do not write.
- **Your stack is polyglot beyond the mainstream.** {{ site.data.counts.languages }} grammars against 23.
- **You want memory that outlives the session and is tied to code.** trace-mcp's decisions link to symbol IDs, are checked for staleness before recall, and surface inside `get_change_impact`. CodeGraphContext has no cross-session memory.
- **You want a published, re-runnable number.** The [PR review context benchmark](/pr-context-benchmark.html): a median {{ site.data.pr_context_bench.median_savings_pct }}% input-token reduction across {{ site.data.pr_context_bench.pr_count }} merged pull requests in {{ site.data.pr_context_bench.repo_count }} repositories nobody here maintains, shipping base and head SHAs, the cases where it lost, and one command to re-run it.

## Where we are not being smug

**Their reference resolution beats ours where SCIP is installed.** Eleven driven indexer families against our three is not a rounding difference, and compiler-grade symbol data is more accurate than any tree-sitter heuristic, ours included. We publish our own limits per language as a `resolution_tier` rather than claiming parity.

**Their default tool surface is cheaper than ours.** 29 tools for ~3.7K tokens against our 28 for ~11.6K including the server-instructions block. Our surface is trimmable per role and theirs only per denylist, which is the argument in our favour — but on the number itself they win.

**Bundles are a genuinely good idea we do not have.** Downloading a pre-built graph of a dependency instead of indexing it is the kind of thing that only looks obvious afterwards.

**They document their own dependency pain in public.** Their comments record that Kùzu was archived upstream and that redis-py is pinned to 5.x to keep FalkorDB Lite's Unix-socket path working. Projects that write that down are easier to trust than projects that do not.

**Our security scanning has a ceiling.** The control-flow graph is line-based, not AST-based, and taint analysis is lexical rather than a real dataflow engine. Type-aware pruning cuts false positives; it does not make this a dataflow analyser.

If you maintain CodeGraphContext and something here is wrong, [open an issue](https://github.com/nikolai-vysotskyi/trace-mcp/issues) and we will fix it.

## FAQ

**What is the core difference between CodeGraphContext and trace-mcp?**
They buy reference precision with setup — eleven SCIP indexer families and a graph database of your choosing. We buy zero setup and framework-level edges, and we write code as well as reading it.

**Does CodeGraphContext need a graph database installed?**
One of six backends. FalkorDB Lite is the default on Unix with Python 3.12+, and the embedded options are a pip install rather than a server — but KuzuDB and LadybugDB default to a 4 GiB buffer pool, so it is a decision with consequences. trace-mcp's index is an embedded SQLite file.

**Which one has the larger MCP tool surface?**
They define 29 and advertise 29 (~3.7K tokens), trimmable through a `disabledTools` denylist. We advertise 28 (~11.6K including server instructions) and keep the other {{ site.data.counts.tools }}-minus-28 one `load_tools` call away. Cheaper default: theirs.

**Can CodeGraphContext refactor code or scan for vulnerabilities?**
No. Source read at head on September 6, 2026: no rename/move/codemod, no taint analysis, no SARIF, no cross-session memory. It finds dead code and computes complexity, and reports both.

**What are CodeGraphContext bundles?**
Portable `.cgc` graph snapshots, published to a Hugging Face-hosted registry and pulled with `load_bundle` / `search_registry_bundles`, so a dependency's graph can be fetched instead of built. Nobody else in this field ships that.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- [PR review context benchmark](/pr-context-benchmark.html) — measured input-token cost of code-review context on 60 merged pull requests.
- [Language matrix](/language-matrix.html) — what resolution tier each language actually reaches.
- [Get started](/#install) — no configuration required.

---

# SocratiCode alternative: trace-mcp vs SocratiCode

Source: https://trace-mcp.com/vs/socraticode.html



**TL;DR.** SocratiCode is a hybrid retrieval engine for AI agents that pairs vector embeddings in Qdrant with syntax AST dependency graphs via ast-grep. It excels at semantic natural-language chunk search, multi-agent concurrency locking, and includes an interactive browser-based HTML graph viewer.

The trade-off is infrastructure and depth. SocratiCode requires running Docker containers for Qdrant and Ollama (or paying for cloud API keys), exposes all 25 tools unconditionally, parses 19 languages without resolving framework-specific connections (route → handler, controller → template, model → table), and ships under AGPL-3.0. trace-mcp requires zero infrastructure—one embedded SQLite file via `npx trace-mcp`—under permissive MIT, with {{ site.data.counts.languages }} languages, {{ site.data.counts.frameworks }} framework integrations, and a safe refactoring write path.

Pick SocratiCode if you already run Qdrant and want hybrid vector-AST search with an interactive in-browser graph visualization. Pick trace-mcp if you want zero-setup local intelligence that understands your framework and writes code as well as reading it.

## Head-to-head

| Capability | trace-mcp | SocratiCode |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.socraticode.stars }} |
| License | **MIT** (permissive) | AGPL-3.0-only / Commercial dual |
| Written in | TypeScript | TypeScript |
| Infrastructure required | **Zero** (single npx / CLI) | **Docker** (Qdrant + Ollama) or cloud APIs |
| Underlying storage | Embedded SQLite + FTS5 + local ONNX | Qdrant vector DB (`:16333`) + JSON caches |
| Languages (AST parsing) | **{{ site.data.counts.languages }}** (tree-sitter WASM) | 19 (@ast-grep/napi) |
| Framework integrations | **{{ site.data.counts.frameworks }}** integrations | ✗ (syntax AST only) |
| Framework-aware edges | ✓ route → handler, template, ORM model | ✗ |
| MCP tools defined | {{ site.data.counts.tools }} | 25 |
| MCP tools advertised by default | 29 (~11.6K tok) | **25** (~5.2K tok) |
| Surface trimming / Presets | ✓ adaptive presets (`minimal`, `review`, etc.) | ✗ (all 25 tools always advertised) |
| Search mechanism | Structural AST + FTS5 + ONNX embeddings | Hybrid RRF (dense vector + keyword) |
| Call flow & impact analysis | ✓ bidirectional call graph + blast radius | ✓ `codebase_flow` + `codebase_impact` |
| Graph visualization | Desktop app (cosmos.gl) + GraphML/JSON | **Interactive HTML viewer** (`codebase_graph_visualize`) |
| Refactoring tools | ✓ rename, move, signature, codemod, extract | ✗ (read-only) |
| Security scanning | ✓ OWASP Top-10 taint analysis, SARIF 2.1.0 | ✗ |
| Session memory | ✓ code-linked decision graph with staleness checks | partial (context artifacts in Qdrant, not code-linked) |
| Multi-agent concurrency | Daemon process pool | Cross-process lockfile (`proper-lockfile`) |
| Cloud / Team edition | Local-first, self-hosted ([privacy](/privacy.html)) | SocratiCode Cloud (private beta) |

Verified on September 7, 2026 against SocratiCode's repository at `main` (v1.13.0, commit `88a8ff5`, {{ site.data.competitors.socraticode.stars }} stars). Tool definitions from `src/index.ts` and `src/tools/`, storage architecture from `src/constants.ts` and `src/config.ts`, language mappings from `src/constants.ts`.

## Key architectural differences

### 1. Zero-dependency local SQLite vs. Docker-managed Qdrant

SocratiCode's storage model is built around [Qdrant](https://qdrant.tech/), an external vector database. When run locally, SocratiCode automatically starts and manages a Docker container (`qdrant/qdrant:v1.17.0`) bound to port 16333, plus an Ollama container (`ollama/ollama:latest`) on port 11435 to compute embeddings (defaulting to `nomic-embed-text`). If Docker is not available, you must configure a remote Qdrant URL and an external embedding API key (OpenAI, Gemini, Cohere).

trace-mcp is designed for zero infrastructure overhead. It runs entirely in-process using an embedded SQLite database with FTS5 full-text indexing and bundled local ONNX vector embeddings. There is no daemon to start in Docker, no open network ports, no container volume management, and zero third-party API dependencies. You run `npx trace-mcp` and it works out of the box on any macOS, Linux, or Windows machine.

### 2. Syntax AST vs. Framework Semantics

Both tools use abstract syntax trees for parsing code structure—SocratiCode via `@ast-grep/napi` (19 languages) and trace-mcp via `tree-sitter-wasm` ({{ site.data.counts.languages }} languages).

Where they diverge is semantic understanding. SocratiCode stops at lexical and syntactic relationships: file imports, function definitions, and call hierarchy. It does not know what a web framework is doing. If your codebase is a Next.js, Django, Spring Boot, or Ruby on Rails application, SocratiCode sees isolated controllers, route handlers, and database models with no edges between them.

trace-mcp ships {{ site.data.counts.frameworks }} framework integrations. It extracts semantic domain edges that AST parsers miss:
- HTTP routes mapped directly to their controller handlers and middleware chains.
- Templates and UI components (React, Vue, Svelte, Blade, Jinja) connected to their backend view controllers.
- ORM entities connected to database tables and migration files.
- Event emitters connected to asynchronous listeners.

When an AI agent asks "what does modifying this database column affect?", trace-mcp traces through the ORM model, the API handler, the validation schema, and the frontend component. SocratiCode only finds literal text or import matches.

### 3. Tool Surface & Context Budget

Every tool advertised by an MCP server consumes prompt tokens on every turn of an agent session, even when not called.

SocratiCode registers and advertises all 25 tools unconditionally (~5.2K tokens of schema). There is no preset system or selective tool activation.

trace-mcp advertises 29 tools on its default `minimal` preset (~11.6K tokens including comprehensive agent instructions). However, trace-mcp gives you active control over your context window:
- Shipped default preset `minimal` advertises 29 tools (~11.6K tokens), keeping the rest of the surface deferred.
- For focused workflows, select task-tailored presets: `review` (33 tools), `architecture` (42 tools), or `dev` (44 tools).
- Any tool not in the active preset remains accessible dynamically via `load_tools` without restarting the server.

### 4. Interactive Browser Visualization: where SocratiCode shines

SocratiCode includes `codebase_graph_visualize`, a dedicated tool that generates a standalone, interactive HTML file using Vis.js and automatically opens it in the developer's default web browser. Developers can visually inspect file clusters, dependency arrows, and isolated nodes without external tooling.

trace-mcp prioritizes agent workflow continuity: opening browser tabs during automated CLI runs can steal window focus. For visual inspection, trace-mcp exports standard GraphML, Mermaid, and JSON via `export_graph`, and provides an optional native Electron desktop app (`trace-mcp.app`) powered by cosmos.gl for hardware-accelerated rendering of massive 100k+ node codebases.

### 5. Licensing: Permissive MIT vs. Copyleft AGPL-3.0

SocratiCode is dual-licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)** for open source, requiring any organisation offering modified versions over a network to publish their complete source code. For proprietary enterprise use, a commercial license must be purchased from Altaire Limited.

trace-mcp is 100% open-source under the **MIT License**. It is freely usable in commercial products, private cloud environments, CI/CD pipelines, and internal tools without copyright assignment, copyleft obligations, or license fees.

## When to choose SocratiCode

- **You want semantic natural-language chunk search**: If your primary workflow is asking questions like "where is user authentication rate limiting configured?" and expecting embedding-ranked text chunks, SocratiCode's Qdrant RRF hybrid search is purpose-built for that.
- **You want an instant interactive graph in your browser**: The `codebase_graph_visualize` tool produces an interactive HTML canvas with zero extra setup.
- **You already have Docker or Qdrant in your stack**: If running Docker containers is standard in your local environment, SocratiCode's container-backed architecture fits right in.

## When to choose trace-mcp

- **Zero setup and local privacy**: You want code intelligence that runs instantly with `npx trace-mcp`, requiring no Docker, no external ports, and no API keys.
- **Framework-heavy applications**: You work with React, Vue, Next.js, Django, Laravel, Spring Boot, or Rails, and need your agent to understand routes, middleware, ORM mappings, and component hierarchies.
- **Refactoring and writing code**: You need the agent to execute atomic renames, move files, extract functions, and apply AST codemods safely.
- **Security & Quality Gates**: You want automated OWASP Top-10 taint tracking and SARIF 2.1.0 vulnerability reporting directly in your agent loop.
- **Permissive licensing**: You need an enterprise-safe MIT-licensed tool with no AGPL copyleft strings.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- Explore measured token savings and quality results across 60 open-source pull requests: [PR context benchmark](/pr-context-benchmark.html).
- Explore all MCP tools in the [tools reference](/tools-reference.html).
- Read the [architecture](/architecture.html) guide to see how embedded SQLite and tree-sitter WASM work together.
- Install trace-mcp in seconds: `npx -y trace-mcp@latest init`.

---

# jCodeMunch alternative: trace-mcp vs jCodeMunch

Source: https://trace-mcp.com/vs/jcodemunch.html



**TL;DR.** As a jCodeMunch alternative for commercial work, trace-mcp is MIT while jCodeMunch's commercial license bans for-profit use without a paid tier. jCodeMunch is a Python AST code-exploration MCP server: symbol extraction across 70+ languages behind a 3-tool "Counter" front door (`order`, `menu`, `route`), plus agent config auditing and git provenance narratives. What decides it is licensing, semantic depth, and refactoring safety: jCodeMunch's Dual-Use License bars commercial use and redistribution, its framework routes are regex matches rather than graph edges, and its refactoring drafts text replacements instead of AST-verified transforms. trace-mcp is MIT-licensed, runs from `npx -y trace-mcp`, and pairs framework-aware edges with atomic refactoring and taint analysis.

Pick jCodeMunch for personal non-commercial projects where the 3-tool surface and git narratives matter. Pick trace-mcp for commercial licensing, framework-aware graphs, verified refactoring, and zero-setup npm distribution.

> **Bottom line for `alternative` searchers:**
> - Commercial use needs a paid jCodeMunch license; trace-mcp is MIT with zero fees.
> - jCodeMunch matches framework routes with regex; trace-mcp traverses typed graph edges.
> - jCodeMunch suggests text replacements; trace-mcp applies AST-verified edits.

## Head-to-head

| Capability | trace-mcp | jCodeMunch |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.jcodemunch.stars }} |
| License | **MIT** (permissive open-source) | Dual-Use v1.1 (**Non-commercial only**; commercial prohibited) |
| Written in | TypeScript (Node.js) | Python (>=3.10, uv) |
| Installation / Distribution | `npx -y trace-mcp@latest` (npm registry) | `uv tool install` / git clone (public registry distribution barred) |
| Underlying storage | Embedded SQLite + FTS5 + local ONNX | SQLite WAL (`symbols`, `files`, `runtime_*`) |
| Languages (AST parsing) | **{{ site.data.counts.languages }}** (tree-sitter WASM) | 70+ (`tree-sitter-language-pack` <1.0.0) |
| Framework integrations | **{{ site.data.counts.frameworks }}** semantic integrations | ~13 context profiles (regex route matching) |
| Framework-aware edges | ✓ route → handler, middleware, template, ORM | ✗ (text regex matches, no graph edges) |
| MCP tools defined | {{ site.data.counts.tools }} | ~90 tools |
| Default advertised tools | 29 (~11.6K tok, task presets) | **3** via Counter (`order`, `menu`, `route`) or ~90 full |
| Tool dispatch model | Direct MCP tool invocation with presets | Meta-dispatch verb (`order(action, args)`) |
| Call graph resolution | 5-tier resolution (`compiler_verified` to `fuzzy`) with calibrated confidence | Multi-tier ladder (`dispatch` → `lsp` → `ast` → text heuristic fallback) |
| Refactoring capability | ✓ AST-native safe transforms (rename, extract, move, codemods) | Candidate text blocks (`plan_refactoring`) |
| Security scanning | ✓ OWASP Top-10 taint analysis, SARIF 2.1.0 | Anti-pattern presets (`search_ast`) + secret redaction |
| Config hygiene | ✓ `verify_docs` + docs-to-code audit | ✓ `audit_agent_config` (CLAUDE.md / .cursorrules token audit) |
| Git archaeology | Commit diff history + change tracking | ✓ `get_symbol_provenance` + `get_delivery_metrics` |
| Session memory | ✓ code-linked decision graph with staleness checks | SQLite index persistence |

Verified on September 7, 2026 against jCodeMunch's repository at `main` (v1.108.317, commit `cf4e96a`, {{ site.data.competitors.jcodemunch.stars }} stars). Tool definitions from `src/jcodemunch_mcp/tools/`, storage architecture from `src/jcodemunch_mcp/storage/sqlite_store.py`, licensing from `LICENSE`.

## Key architectural differences

### 1. Permissive MIT vs. Non-Commercial Dual-Use License

The most consequential difference between the two tools is legal and operational.

jCodeMunch is distributed under a bespoke **Dual-Use License (Version 1.1)**. Clause 3 of the license explicitly states:
> *"The software may not be used, directly or indirectly, in any product, service, or workflow that generates revenue, is offered commercially, or is used within a for-profit organization to support revenue-generating activities."*

Furthermore, the license explicitly forbids publishing or uploading modified or unmodified versions to public package registries like npm, PyPI, or crates.io. For engineering teams, startups, or enterprise companies building commercial software, adopting jCodeMunch requires negotiating commercial licensing terms with the author.

trace-mcp is 100% open-source under the **permissive MIT License**. It can be deployed across commercial codebases, internal enterprise tooling, proprietary products, and CI/CD pipelines with zero restrictions, zero legal ambiguity, and zero commercial fees. It is distributed through npm (`npx -y trace-mcp`) and requires no compilation from source or custom toolchains.

### 2. True Framework Semantics vs. Text Regex Heuristics

Both tools index code syntax using tree-sitter grammars. However, how each tool interprets modern web frameworks differs fundamentally.

jCodeMunch implements framework awareness through context provider modules (`decorator_routes.py`, `express.py`, `django.py`) that rely heavily on regular expressions. For instance, route detection in Flask and FastAPI uses `re.compile` to scan for `@app.route(...)` and `@router.get(...)` strings in source files. While this captures simple, statically declared endpoints, it breaks down when routes are constructed dynamically, mounted through modular sub-routers, wrapped in authentication middleware factories, or linked across architectural boundaries.

trace-mcp builds a true semantic code graph across {{ site.data.counts.frameworks }} frameworks:
- **HTTP Routes & Handlers**: Direct directed edges from route definitions to handler functions, parameter schemas, and middleware chains (Express, Fastify, NestJS, Next.js, Django, Flask, FastAPI, Rails, Spring Boot, Gin, Actix, Axum).
- **UI Components & Templates**: Relationships connecting backend view controllers to React/Vue/Svelte components, Blade templates, and Jinja layouts.
- **ORM & Data Layer**: Database models connected to table definitions, migration files, and query callsites.

When an AI agent asks "what endpoints are impacted if I change this authentication signature?", trace-mcp traverses typed graph edges. jCodeMunch must rely on text word matches and reverse import traversals.

### 3. Tool Surface Management: The Counter vs. Adaptive Task Presets

As MCP servers grow in capability, advertising dozens of tools overwhelms the model's system prompt context and degrades tool selection accuracy (dispatch dilution). Both projects acknowledge this challenge but solve it differently.

jCodeMunch introduces **"The Counter"** (`counter.py`): on new installations, the server advertises only 3 meta-tools:
- `order(action, args)`: Executes any underlying tool action by name.
- `menu(query, tier)`: Searches and browses available tools in the catalog.
- `route(task, execute)`: Matches natural language intent to tool actions.

While The Counter reduces resident schema tokens, it introduces significant friction into the agent loop. Running an action through `order` requires an extra turn of indirection and passes parameters inside generic unstructured objects, bypassing the client's native tool schema validation and increasing argument hallucination rates.

trace-mcp addresses context cost through **Adaptive Task Presets**:
- Shipped default preset `minimal` advertises 29 tools (~11.6K tokens), keeping the rest of the surface deferred.
- Task-specific presets curate tools for the active workflow: `review` (33 tools), `architecture` (42 tools), or `dev` (44 tools).
- Any tool not in the current preset remains immediately accessible dynamically via `load_tools` without restarting the server or adding meta-dispatch indirection.

### 4. Call Graph Architecture: Precomputed Graph Edges vs. Query-Time Resolution Ladders

Understanding who calls a function is essential for safe code edits, and both tools implement multi-tier resolution ladders rather than single-strategy lookups.

jCodeMunch (`_call_graph.py`) resolves callers and callees through a tiered dispatch pipeline:
1. `_dispatch_callers`: Interface-to-implementation resolution (`lsp_dispatch`).
2. `_lsp_callers`: Live LSP-resolved caller locations (`lsp_resolved`).
3. `_callers_from_references`: AST-derived call sites stored in the symbol index (`call_references`, v8+ schema), tagged `ast_resolved` or `ast_inferred`.
4. Text heuristic fallback: If call-site data is missing or indexing is partial, it falls back to word-token regex matching (`_word_match` scanning imported file bodies for `\b<name>\b`).

The key architectural differences lie in persistence and confidence contracts:
- **Index-resident vs. query-time traversal**: trace-mcp precomputes and indexes explicit directed graph edges directly in SQLite during the indexing pass. Relationships (including cross-file framework edges) are materialized before the agent queries them, rather than reconstructed at query time across import tables.
- **5-tier resolution with calibrated confidence**: trace-mcp tags every edge with an explicit confidence level and resolution tier:
  - `compiler_verified`: Direct compiler/SCIP evidence.
  - `scope_resolved`: Lexical AST scope resolution.
  - `import_bound`: Explicit module import binding.
  - `type_inferred`: Type-inferred call targets.
  - `fuzzy_matched`: Fallback heuristic match with explicit confidence flags.
- **Transparent edge contracts**: When an AI agent queries trace-mcp for call hierarchy or change impact, the client receives calibrated confidence scores per edge, distinguishing exact compiler-grade links from heuristic inferences. In jCodeMunch, callers must inspect the resolution tier to verify whether an edge came from AST call sites or from the text-regex fallback (`_word_match`).

### 5. Code Modification: AST-Native Transforms vs. Text Replacement Blocks

jCodeMunch includes `plan_refactoring`, which produces text-based find-and-replace candidate blocks `{old_text, new_text}` using regular expressions across import lines. The tool suggests replacements for renames, moves, and extractions, but leaves execution and syntax validation entirely to the caller.

trace-mcp provides a complete suite of **AST-native refactoring write tools**:
- `refactor_rename`: Performs scope-aware symbol renames across files, updating import declarations and call sites while preserving syntax validity.
- `refactor_extract`: Extracts code blocks into new functions with inferred parameters and return types.
- `refactor_move`: Moves functions and classes across module boundaries with automatic import resolution.
- `refactor_codemod`: Applies structural AST transformation patterns safely.

## When to choose jCodeMunch

- **Non-commercial personal projects**: You are an individual open-source enthusiast or student working solely on hobby projects where commercial license restrictions do not apply.
- **You prefer a minimal 3-tool dispatch entry point**: You want to experiment with `order`/`menu`/`route` meta-tools to keep top-level schema definitions under 3 tools.
- **Agent config file auditing**: You want `audit_agent_config` to inspect your `CLAUDE.md`, `.cursorrules`, or `copilot-instructions.md` for dead symbol references and token bloat.
- **Git archaeology insights**: You want `get_symbol_provenance` to generate commit narratives explaining how a specific function evolved over time.

## When to choose trace-mcp

- **Commercial and enterprise development**: You require permissive MIT licensing with no restrictions on revenue generation, enterprise distribution, or cloud deployment.
- **Modern framework architectures**: You work with React, Vue, Next.js, Django, FastAPI, Laravel, Spring Boot, or Rails, and need true semantic edges between routes, middleware, models, and UI templates.
- **High-confidence impact analysis**: You need a 5-tier call graph with calibrated confidence distinguishing compiler-verified relationships from heuristic fallbacks.
- **Safe, automated refactoring**: You want your AI agent to execute atomic renames, extractions, and file moves with syntax validation.
- **Integrated security auditing**: You want OWASP Top-10 taint tracking and SARIF 2.1.0 vulnerability reporting built directly into your MCP workflow.
- **Zero infrastructure setup**: You want immediate execution via `npx -y trace-mcp` with no Python virtual environment, uv, or local compilation required.

## FAQ — jCodeMunch alternatives

### Is trace-mcp a drop-in replacement for jCodeMunch?

No — and it does not pretend to be. Installation differs (`npx -y trace-mcp` vs `uv tool install`), the tool surface differs (29 default-preset tools vs the 3-tool Counter dispatch), and jCodeMunch-only features like `audit_agent_config` and `get_symbol_provenance` have no one-to-one counterpart. What transfers directly is the codebase itself: point trace-mcp at the same repository and re-index.

### Can I use jCodeMunch for commercial work?

Not on the default license. jCodeMunch's Dual-Use License v1.1 permits non-commercial, personal, and academic use only; any revenue-generating workflow inside a for-profit organisation needs a separate paid license from the author, and redistribution via public registries is barred. trace-mcp is MIT-licensed with no such restriction — that is the whole of the licensing section above in one paragraph.

### Which alternative fits a framework-heavy codebase?

If the codebase is Next.js, Django, Rails, or similar and the agent's questions are structural ("which endpoints break if this middleware signature changes?"), trace-mcp's typed route → handler → template → table edges answer them directly; jCodeMunch's regex route providers match declared route strings but compute no edges. For a small personal Python project where that question never arises, jCodeMunch's lighter surface is the honest pick.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- Explore measured token savings and quality results across 60 open-source pull requests: [PR context benchmark](/pr-context-benchmark.html).
- Explore all MCP tools in the [tools reference](/tools-reference.html).
- Read the [architecture](/architecture.html) guide to see how embedded SQLite and tree-sitter WASM work together.
- Every knob is optional — [configuration](/configuration.html) works with none, reference when needed.
- Install trace-mcp in seconds: `npx -y trace-mcp@latest init`.

---

# TokenSave alternative: trace-mcp vs TokenSave

Source: https://trace-mcp.com/vs/tokensave.html



**TL;DR.** TokenSave is a Rust-based code intelligence MCP server that indexes code into an embedded libSQL (SQLite) database with tree-sitter parsers across 50+ languages. It features 86 specialized MCP tools, subprocess-isolated grammar extraction, multi-branch indexing, git blame integration, and text replacement editing primitives.

The core architectural differences center on advertised prompt overhead, framework awareness, refactoring safety, and security. TokenSave advertises all 85+ tools by default on standard MCP hosts, consuming significant schema tokens on every session start, whereas trace-mcp ships a 29-tool `minimal` preset and dynamically escalates via `load_tools`. TokenSave extracts language syntax without resolving framework connections; trace-mcp builds semantic graph edges across {{ site.data.counts.frameworks }} frameworks (routes, controllers, templates, ORM models). TokenSave edits code via string-replacement primitives; trace-mcp executes scope-aware AST refactorings with cross-file import rewrites and includes OWASP Top-10 taint analysis with SARIF output.

Pick TokenSave if you want a Rust binary indexing broad syntax across 50+ languages (including shaders, Basic dialects, and mainframe languages) with multi-branch database isolation. Pick trace-mcp if you develop web applications in modern frameworks, require compiler-calibrated 5-tier call graphs, need safe AST refactoring write tools, and want zero-setup distribution via npm.

## Head-to-head

| Capability | trace-mcp | TokenSave |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.tokensave.stars }} |
| License | **MIT** (permissive open-source) | **MIT** (permissive open-source) |
| Written in | TypeScript (Node.js) | Rust (edition 2021) |
| Installation / Distribution | `npx -y trace-mcp@latest` (npm registry) | `cargo binstall tokensave` / Homebrew tap / Scoop / prebuilt binary |
| Underlying storage | Embedded SQLite + FTS5 + local ONNX | Embedded libSQL (SQLite fork) + FTS5 + ONNX runtime (`ort`) |
| Languages (AST parsing) | **{{ site.data.counts.languages }}** (tree-sitter WASM) | 50+ (tree-sitter native, lite/medium/full tiers) |
| Framework integrations | **{{ site.data.counts.frameworks }}** semantic integrations | ✗ (syntax AST only, no framework semantics) |
| Framework-aware edges | ✓ route → handler, middleware, template, ORM | ✗ |
| MCP tools defined | {{ site.data.counts.tools }} | 86 tools |
| Default advertised tools | **29** (~11.6K tok, task presets) | **85+** advertised on standard hosts (~12-15K tok schema) |
| Tool surface management | Task presets (`minimal`, `review`, `architecture`, `dev`) + `load_tools` | 5 tools marked `anthropic/alwaysLoad`; 85+ returned on `tools/list` |
| Call graph resolution | 5-tier resolution (`compiler_verified` to `fuzzy`) with calibrated confidence | Graph traversal (`callers`, `callees`, `call_chain`) over AST call sites |
| Refactoring capability | ✓ AST-native safe transforms (rename, extract, move, codemods) | String replacement primitives (`str_replace`, `multi_str_replace`, `insert_at`) |
| Security scanning | ✓ OWASP Top-10 taint analysis, SARIF 2.1.0 | ✗ (`tokensave_unsafe_patterns` syntactic grep only) |
| Session memory | ✓ code-linked decision graph with staleness checks | Text decisions with 14-day recency decay (`tokensave_record_decision`) |
| Extraction crash safety | WASM sandbox (memory-safe, crash-isolated by runtime) | Subprocess worker pool (`extraction_worker.rs`) |
| Multi-branch indexing | Git-aware commit/file tracking in unified SQLite WAL | Opt-in separate libSQL database per git branch |

Verified on September 8, 2026 against TokenSave's repository at `master` (v7.11.1, {{ site.data.competitors.tokensave.stars }} stars). Tool definitions from `src/mcp/tools/definitions.rs`, server dispatch from `src/mcp/server.rs`, memory architecture from `src/tokensave/memory.rs`, storage and extraction from `src/db/` and `src/extraction/`.

## Key architectural differences

### 1. Tool Surface Management: 86 Advertised Tools vs. 29-Tool Minimal Preset

The number of tools an MCP server exposes directly impacts agent performance. Every tool definition consumes prompt tokens in the initial `tools/list` response, and large tool lists increase parameter hallucination and tool mis-selection rates (dispatch dilution).

TokenSave defines 86 MCP tools in `get_tool_definitions()`. In Anthropic-specific environments supporting the deferred-loading proposal (`_meta: { "anthropic/alwaysLoad": true }`), TokenSave tags 5 tools (`tokensave_search`, `tokensave_context`, `tokensave_callees`, `tokensave_impact`, `tokensave_status`). However, on all standard MCP hosts (including Claude Code, Codex CLI, Cursor, Antigravity, OpenCode, and Zed), the `tools/list` endpoint returns all 85+ tool definitions unconditionally. TokenSave's own source comments in `src/mcp/server.rs` record this reality:
> *"The original metric only counted the tool's own answer text, so overhead that's very real to the model — 80+ tool schemas, the call itself, warning banners — was invisible."*

To balance this, TokenSave implements session debt accounting (`settle_session_debt`), charging the schema overhead against future token savings over multiple turns.

trace-mcp addresses context overhead architecturally through **Adaptive Task Presets**:
- **29-tool `minimal` default**: Advertised by default (~11.6K tokens), providing search, navigation, outlines, and change impact without prompt bloat.
- **Workflow-tailored presets**: Dedicated presets for `review` (33 tools), `architecture` (42 tools), or `dev` (44 tools).
- **Dynamic runtime escalation**: Any deferred tool can be loaded on demand in the live session via `load_tools` without server restarts or meta-tool indirection.

### 2. Pure Syntax Parsing vs. 88 Framework Semantic Integrations

Both trace-mcp and TokenSave parse source code using tree-sitter grammars. Where they diverge is how structural syntax is translated into architectural comprehension.

TokenSave is language-broad: it includes tree-sitter grammars for 50+ languages across three compilation tiers (`lite` with 11 core languages, `medium` with 9, and `full` adding 40+ including GLSL/HLSL/Metal shaders, CUDA, Fortran, Cobol, and Basic dialects). However, its extractors capture purely syntactic constructs: functions, classes, structs, methods, import statements, and call expressions. It contains no framework-specific extractors:
- It knows an Express or FastAPI file has a function call named `app.get()`, but creates no route-to-handler relationship in the graph.
- It cannot connect a backend controller to a React/Vue/Svelte frontend component or Blade/Jinja template.
- It cannot link an ORM model (Prisma, TypeORM, Drizzle, SQLAlchemy, Django ORM) to database schema migrations.

trace-mcp builds a true semantic code graph across {{ site.data.counts.frameworks }} frameworks:
- **HTTP Routing & Middleware**: Explicit directed edges connect route definitions to handler functions, parameter schemas, and authentication middleware chains across Express, Fastify, NestJS, Next.js, Django, Flask, FastAPI, Rails, Spring Boot, Gin, Actix, and Axum.
- **Component & View Hierarchies**: Resolves relationships between backend controllers, API endpoints, and UI view layers.
- **Data Layer & ORM Models**: Connects models directly to database tables, migration files, and query callsites.

When an agent asks "what breaks if I change this endpoint parameter?", trace-mcp traverses typed framework edges. In TokenSave, the agent must trace raw call sites and manually infer route bindings.

### 3. Code Modification: String Replacement Primitives vs. AST-Verified Refactoring

AI agents frequently introduce syntax errors or broken imports when editing code. The two tools approach code modification with fundamentally different primitives.

TokenSave provides string-level and regex-anchored editing tools:
- `tokensave_str_replace`: Uniquely anchored find-and-replace for string blocks.
- `tokensave_multi_str_replace`: Applies an array of string replacements atomically.
- `tokensave_insert_at`: Inserts text before or after a matched anchor string.
- `tokensave_ast_grep_rewrite`: Optional structural pattern replacement via ast-grep CLI.

While anchored string replacement is safer than raw shell sed commands, it operates on text slices rather than semantic symbols. If a symbol is renamed across a project, string replacement cannot update importing files or adjust lexical scopes.

trace-mcp provides a complete suite of **AST-native refactoring write tools**:
- `refactor_rename`: Performs scope-aware symbol renames across all referencing files, updating import statements and call sites while verifying syntax integrity.
- `refactor_extract`: Extracts code blocks into new functions with inferred arguments and return signatures.
- `refactor_move`: Relocates functions or classes across module boundaries with automatic import resolution.
- `refactor_codemod`: Applies structural AST transformation patterns with compiler-level validation.

### 4. Memory Models: Text Recency Decay vs. Symbol-Bound Staleness Verification

Both tools provide persistent memory across agent sessions, recognizing that agents should not re-learn project architectural decisions from scratch on every turn.

TokenSave implements decision and code area memory (`src/tokensave/memory.rs`):
- `tokensave_record_decision`: Saves title, rationale, and consequences into libSQL.
- `tokensave_record_code_area`: Records high-interest file paths and architectural components.
- **Exponential recency decay**: Decisions have a 14-day half-life (`RECALL_DECAY_HALF_LIFE_SECS = 14 days`), gently lowering older decisions in search rank without expiring them.
- **Session start delta**: Summarizes the top 5 recent decisions and code areas on session startup.

However, TokenSave's decisions are stored as free-form text and path strings. If a referenced function is deleted, renamed, or refactored, the decision remains in the database and continues to be recalled.

trace-mcp implements **Symbol-Bound Decision Memory**:
- Decisions are bound directly to symbol IDs (`src/db/connection.ts::Pool#class`) and file nodes in the code graph.
- When `get_change_impact` is run on a symbol, linked decisions appear directly in the output.
- **Staleness verification**: At recall time, trace-mcp verifies that referenced symbols and files still exist in the current index. If code was removed, stale decisions are suppressed rather than misleading the agent.

### 5. Security & Quality Gates: General Intelligence vs. OWASP Top-10 Taint Analysis in CI

trace-mcp integrates static application security testing directly into the MCP server:
- **OWASP Top-10 Taint Analysis**: Tracks data flows from untrusted inputs (HTTP parameters, request bodies) to sensitive sinks (SQL queries, shell execution, HTML output) with type-aware pruning.
- **OASIS SARIF 2.1.0 Export**: Generates standardized vulnerability reports for GitHub Code Scanning, GitLab CI, and Azure DevOps.
- **Configurable Quality Gates**: Enforces architectural boundaries, dependency cycles, and dead-code thresholds in CI.

TokenSave includes `tokensave_unsafe_patterns`, which performs regex/AST pattern matching for known hazardous constructs (such as `eval` or `unsafe` blocks in Rust), but provides no cross-file taint analysis, no source-to-sink data flow tracking, and no SARIF report generation.

## Measured in Benchmark Lab

Tool counts describe the advertised surface; the Benchmark Lab measures what answers cost. On {{ site.data.benchmark_lab.generated_at | date: "%-d %B %Y" }}, at trace-mcp {{ site.data.benchmark_lab.measured_build.version }} (`{{ site.data.benchmark_lab.measured_build.commit }}`){% if site.data.measurements.benchmark_lab.historical %} — a result from that build, not a claim about the current one{% endif %}, the in-app Lab ran its pinned battery — {{ site.data.benchmark_lab.battery.fixture_count }} recall fixtures, battery sha `{{ site.data.benchmark_lab.battery.fixtures_sha }}` — over three arms, priced at {{ site.data.benchmark_lab.model.name }} (${{ site.data.benchmark_lab.model.input_usd_per_mtok }}/Mtok input). Tokens are exact (o200k_base), not estimated:

| arm | tokens | calls | success | vs file-reading | cost (USD) |
|-----|-------:|------:|--------:|----------------:|----------:|
| file-reading (control) | {{ site.data.benchmark_lab.arms[0].total_tokens }} | {{ site.data.benchmark_lab.arms[0].total_calls }} | {{ site.data.benchmark_lab.arms[0].success_count }}/{{ site.data.benchmark_lab.arms[0].fixtures }} | — | ${{ site.data.benchmark_lab.arms[0].cost_usd }} |
| minimal | {{ site.data.benchmark_lab.arms[1].total_tokens }} | {{ site.data.benchmark_lab.arms[1].total_calls }} | {{ site.data.benchmark_lab.arms[1].success_count }}/{{ site.data.benchmark_lab.arms[1].fixtures }} | −{{ site.data.benchmark_lab.arms[1].savings_vs_baseline_pct }}% | ${{ site.data.benchmark_lab.arms[1].cost_usd }} |
| standard | {{ site.data.benchmark_lab.arms[2].total_tokens }} | {{ site.data.benchmark_lab.arms[2].total_calls }} | {{ site.data.benchmark_lab.arms[2].success_count }}/{{ site.data.benchmark_lab.arms[2].fixtures }} | −{{ site.data.benchmark_lab.arms[2].savings_vs_baseline_pct }}% | ${{ site.data.benchmark_lab.arms[2].cost_usd }} |

<figure>
  <img src="/images/benchmark-lab-tokens.svg" alt="Bar chart of exact tokens per Benchmark Lab arm over {{ site.data.benchmark_lab.battery.fixture_count }} pinned fixtures: file reading {{ site.data.benchmark_lab.arms[0].total_tokens }} tokens, minimal preset {{ site.data.benchmark_lab.arms[1].total_tokens }}, standard preset {{ site.data.benchmark_lab.arms[2].total_tokens }}" width="720" height="252" loading="lazy" />
  <figcaption>Benchmark Lab, {{ site.data.benchmark_lab.generated_at | date: "%-d %B %Y" }}: the file-reading control bar dwarfs both index arms; the minimal arm answers {{ site.data.benchmark_lab.arms[1].success_count }} of {{ site.data.benchmark_lab.arms[1].fixtures }} fixtures, the standard arm all {{ site.data.benchmark_lab.arms[2].fixtures }}. Re-run with <code>tsx scripts/bench-lab.ts</code>; the <a href="/perf/prereg-benchmark-lab/">preregistration</a> binds the next run.</figcaption>
</figure>

The control arm reads the raw files that answer each fixture — no index, the price of answering without trace-mcp. The minimal arm's one miss is `06-context-pipeline`: raw `search_text` for "IndexingPipeline" does not rank `src/indexer/pipeline.ts` in its top 10 (too many files mention the class), while the standard arm's packed envelope does — a real measurement of that strategy's limits, published rather than re-run until it passes. Per-fixture rows, the battery hash and the re-run command live in [`benchmark_lab.json`](https://github.com/nikolai-vysotskyi/trace-mcp/blob/master/docs/_data/benchmark_lab.json); run it yourself from the Benchmark Lab tab in the app.

## When to choose TokenSave

- **Polyglot codebases with niche or shader languages**: Your repository contains GLSL/HLSL/Metal shaders, CUDA, Fortran, Cobol, Pascal, or QuickBasic alongside general-purpose code.
- **Independent multi-branch index databases**: You work in multiple active git worktrees and prefer completely separate libSQL databases per branch.
- **Git blame and commit archaeology**: You want native blame-graph metrics (`tokensave_blame`, `tokensave_log`, `tokensave_diff`) built into your MCP queries.
- **You prefer a compiled Rust native binary**: You want a self-contained single binary installed via `cargo binstall` or Homebrew rather than running Node.js.

## When to choose trace-mcp

- **Modern web and backend frameworks**: You build with Next.js, React, Vue, Express, Fastify, Django, FastAPI, Rails, Spring Boot, or Laravel, and need semantic edges between routes, middleware, templates, and ORM models.
- **Prompt budget efficiency**: You want a lean 29-tool `minimal` preset (~11.6K tokens) that protects the model's context window on every turn, with dynamic escalation via `load_tools`.
- **Safe, automated AST refactoring**: You want your AI agent to perform atomic renames, extractions, and file moves with syntax validation and import graph updates.
- **High-confidence impact analysis**: You need a 5-tier call graph that explicitly distinguishes compiler-verified relationships from heuristic inferences.
- **Integrated CI security & quality gates**: You want OWASP Top-10 taint analysis and SARIF reporting built into your code graph workflow.
- **Zero-setup npm distribution**: You want instant execution via `npx -y trace-mcp@latest` with embedded SQLite and bundled ONNX embeddings.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- Explore measured token savings and quality results across 60 open-source pull requests: [PR context benchmark](/pr-context-benchmark.html).
- Explore all MCP tools in the [tools reference](/tools-reference.html).
- Read the [architecture](/architecture.html) guide to see how embedded SQLite and tree-sitter WASM work together.
- Install trace-mcp in seconds: `npx -y trace-mcp@latest init`.

---

# GitNexus alternative: trace-mcp vs GitNexus

Source: https://trace-mcp.com/vs/gitnexus.html



**TL;DR.** GitNexus is a popular code intelligence engine ({{ site.data.competitors.gitnexus.stars }} stars) pairing an embedded LadybugDB graph database (a Kùzu fork) with in-memory Leiden community clustering and raw Cypher query execution. It features Program Dependence Graph (PDG) analysis, cross-file impact tracking, and an interactive web visualization UI.

The core architectural differences center on licensing, query reliability, framework awareness, build portability, and write capabilities. GitNexus is distributed under PolyForm Noncommercial 1.0.0, which prohibits commercial and enterprise deployment, whereas trace-mcp is 100% permissive open-source under MIT. GitNexus provides a raw `cypher` query tool that forces models to compose graph queries from scratch, risking hallucinations and token waste; trace-mcp exposes deterministic, typed MCP tools. GitNexus requires native C++ build tools (`node-gyp-build`) across 10 languages; trace-mcp runs anywhere via WASM-sandboxed `web-tree-sitter` across {{ site.data.counts.languages }} languages. Finally, trace-mcp models {{ site.data.counts.frameworks }} frameworks and provides AST refactoring write tools and OWASP Top-10 taint analysis.

Pick GitNexus if you need an interactive visual web graph UI, want in-memory Leiden community detection with modularity cohesion scores, or require Program Dependence Graph (PDG) reachability in non-commercial personal projects. Pick trace-mcp if you build commercial or enterprise software, require semantic edges across web frameworks, need prompt-efficient typed MCP tools, and want safe AST refactoring write capabilities with zero native compilation.

## Head-to-head

| Capability | trace-mcp | GitNexus |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.gitnexus.stars }} |
| License | **MIT** (permissive open-source, commercial use permitted) | **PolyForm Noncommercial 1.0.0** (commercial use strictly prohibited) |
| Written in | TypeScript (Node.js) | TypeScript / Node.js monorepo (`gitnexus`, `gitnexus-web`) |
| Installation / Distribution | `npx -y trace-mcp@latest` (npm registry) | `npx gitnexus` / git clone (npm registry) |
| Underlying storage | Embedded SQLite WAL + FTS5 + local ONNX | Embedded LadybugDB graph database (Kùzu fork) + `graphology` |
| Languages (AST parsing) | **{{ site.data.counts.languages }}** (tree-sitter WASM) | 10 (native C++ tree-sitter grammars) |
| Build dependencies | **Zero native builds** (precompiled WASM sandboxes) | Native C++ compiler toolchain required (`node-gyp-build`, Python) |
| Framework integrations | **{{ site.data.counts.frameworks }}** semantic integrations | Basic HTTP route pattern detection |
| Framework-aware edges | ✓ route → handler, controller → template, ORM → table | ✗ (syntax AST only, route strings to functions) |
| MCP tools defined | {{ site.data.counts.tools }} tools | 17 tools |
| Default advertised tools | **29** (~11.6K tok, task presets `minimal`, `review`, `dev`) | 17 tools advertised unconditionally |
| Query paradigm | **Typed, schema-validated tools** (`get_callers`, `get_symbol`, `get_change_impact`) | Hybrid: typed tools + raw Cypher queries (`cypher`) |
| Call graph resolution | 5-tier resolution (`compiler_verified` to `fuzzy`) | Graph traversal over LadybugDB AST edges |
| Community detection | Subsystem folder modularity cohesion | In-memory Leiden clustering (`calculateCohesion`) |
| Program Dependence Graph | Call & data flow reachability | CDG (control dependence) + REACHING_DEF (`analyze --pdg`) |
| API drift detection | Planned static route contract verification | Static response key check (`shape_check`, `api_impact`) |
| Refactoring capability | ✓ AST-native safe transforms (rename, extract, move, codemods) | Basic symbol rename (`rename`) |
| Security scanning | ✓ OWASP Top-10 taint analysis, SARIF 2.1.0 | ✗ |
| Session memory | ✓ Symbol-bound decision knowledge graph with staleness checks | ✗ |
| Web UI visualization | ✗ (terminal & agent-focused) | ✓ Interactive Cytoscape/graphology web UI (`gitnexus-web`) |

Verified on September 11, 2026 against GitNexus repository at `main` (v1.6.11, {{ site.data.competitors.gitnexus.stars }} stars). Monorepo structure from `package.json`, tool definitions from `gitnexus/src/mcp/tools.ts`, ingestion pipeline from `gitnexus/src/core/ingestion/pipeline.ts`, Leiden community clustering from `gitnexus/src/core/ingestion/community-processor.ts`, and storage bindings from `gitnexus/src/core/lbug/`.

## Key architectural differences

### 1. Licensing & Commercial Adoption: Permissive MIT vs. PolyForm Noncommercial 1.0.0

The single most consequential difference between trace-mcp and GitNexus is the legal license governing their code.

GitNexus is published under the **PolyForm Noncommercial 1.0.0** license. The core condition of PolyForm Noncommercial states:
> *"You may use the software for noncommercial purposes only. Commercial purposes include any use by a commercial entity or for any commercial purpose, whether or not for profit."*

This license strictly prohibits:
- Using GitNexus in any commercial company, enterprise, or startup.
- Using GitNexus on codebases that produce commercial products or generate revenue.
- Integrating GitNexus into commercial developer tooling or CI pipelines.
- Deploying GitNexus on company-owned developer workstations without negotiating a custom commercial license.

trace-mcp is licensed under the **MIT License**. You are free to use it for personal projects, commercial software, enterprise monorepos, and proprietary agentic workflows without licensing fees, legal friction, or enterprise procurement roadblocks.

### 2. Query Reliability: Typed MCP Tools vs. Raw Cypher Query Hallucinations

GitNexus exposes 17 MCP tools (`list_repos`, `query`, `cypher`, `context`, `detect_changes`, `check`, `rename`, `impact`, `explain`, `pdg_query`, `route_map`, `tool_map`, `shape_check`, `api_impact`, `group_list`, `group_sync`, `trace`).

Among these, `cypher` allows the LLM to write raw graph query strings against LadybugDB:
```cypher
MATCH (fn:Function)-[:CALLS]->(target:Function {name: "processPayment"})
RETURN fn.name, fn.file_path
```

While raw Cypher querying appears flexible in theory, in practice it introduces severe operational issues for LLM coding agents:
- **Syntax and Schema Hallucinations**: LLMs frequently hallucinate edge types, property names, or Cypher syntax constructs not supported by embedded graph engines, leading to runtime query failures and wasted agent turns.
- **Context Window Bloat**: Prompting an agent to write Cypher requires injecting the entire database schema, node labels, relationship types, and query examples into the agent prompt on every turn.
- **Non-Deterministic Retrieval**: Different model families formulate graph traversals inconsistently, resulting in uneven context retrieval.

trace-mcp intentionally avoids raw graph query languages in favor of **typed, schema-validated MCP tools**:
- `get_callers`, `get_callees`, `get_symbol`, and `get_change_impact` provide deterministic inputs with strict Zod validation.
- Output shapes are calibrated for minimal token consumption (TOON format or compact JSON).
- The agent simply requests "who calls `processPayment`", and trace-mcp traverses multi-tier edges in SQLite without the agent ever needing to know the database query language.

### 3. Framework Awareness: 88 Web Framework Integrations vs. Generic Syntax

Both tools parse source code using Tree-sitter. However, parsing raw syntax into AST nodes is only the first step of codebase comprehension.

GitNexus parses language syntax across 10 languages (TypeScript, JavaScript, Python, Go, Rust, C#, C++, Java, PHP, Ruby) and maps function calls, class inheritance, and imports. It includes a basic `route_map` tool that identifies URL pattern strings in route definitions, but does not resolve deep framework semantics:
- It cannot trace from a frontend API client (e.g. `apiClient.get('/invoices')`) through authentication middleware to a controller action.
- It does not connect backend controllers to view templates (JSX, Vue, Blade, Jinja) or API response serializers.
- It does not link ORM models (Prisma, Drizzle, TypeORM, SQLAlchemy) to database tables and migrations.

trace-mcp constructs semantic graph edges across **{{ site.data.counts.frameworks }} frameworks**:
- **HTTP Routing & Middleware**: Full resolution of route definitions, HTTP verbs, parameter schemas, and middleware chains across Express, NestJS, Next.js, Fastify, Django, Flask, FastAPI, Spring Boot, Rails, Gin, and Axum.
- **Component & View Hierarchies**: Maps data flow from backend handlers into frontend client components.
- **Data Layer & ORMs**: Connects database entities to repositories, migrations, and queries.

When an agent refactors an API endpoint, trace-mcp traverses these framework edges to warn the agent about broken frontend callers and affected database queries.

### 4. Build Portability: Sandboxed WASM vs. Fragile Native C++ Compilations

GitNexus relies on native Node.js addons:
- Native C++ Tree-sitter bindings compiled via `node-gyp-build` and `node-addon-api`.
- Native C++ bindings for the LadybugDB graph database engine (`@ladybugdb/core`).

Native addons require a host-level C/C++ compiler toolchain (`gcc`, `clang`, `make`, `python3`) and frequently fail to install across different operating systems, Node.js versions, and architectures (such as Apple Silicon vs. x86_64 or Windows environments). If a developer lacks local build tools or runs a locked-down enterprise workstation, `npm install` fails immediately.

trace-mcp is engineered for **zero-setup, universal portability**:
- Code parsing runs inside WASM sandboxes via `web-tree-sitter` and precompiled WASM grammars.
- Graph storage runs in embedded `better-sqlite3` with prebuilt platform binaries.
- Running `npx -y trace-mcp@latest` requires only Node.js—no C++ compilers, no Python build scripts, and no native compilation steps.

### 5. Community Detection vs. AST Refactoring Write Tools

GitNexus incorporates in-memory Leiden community detection (`graphology-communities-leiden`). It clusters functions and modules into cohesive communities based on `CALLS` edges and calculates a modularity cohesion score (internal edges divided by total edges). This provides agents with an architectural overview of how tightly coupled modules are. However, GitNexus is almost entirely a read-only exploration tool; its only code-modification tool is a basic `rename` command.

trace-mcp pairs architectural read analysis with **production-grade write tools**:
- `refactor_rename`: Performs scope-aware symbol renames across the entire codebase, updating call sites and cross-file imports while validating syntax integrity.
- `refactor_extract`: Extracts selected statements into new functions with inferred arguments and return types.
- `refactor_move`: Moves functions or classes across file boundaries and automatically rewrites dependent imports.
- `refactor_codemod`: Executes structural AST transformations with compiler validation.
- **Security Taint Analysis**: Analyzes data flows from untrusted inputs to sensitive sinks (SQL, command execution, DOM) and exports standardized OASIS SARIF 2.1.0 reports for CI integration.

## When to choose GitNexus

- **Interactive visual graph exploration**: You want a local web UI (`gitnexus-web`) with Cytoscape/graphology rendering to visually explore your repository node relationships.
- **In-memory Leiden community detection**: You want graph clustering algorithms to partition your code into functional communities and compute cohesion scores.
- **Program Dependence Graph (PDG) analysis**: You need control dependence (CDG) and reaching definition (REACHING_DEF) graphs for advanced program slicing.
- **Non-commercial personal projects**: You are a student, researcher, or hobbyist working exclusively on personal, non-commercial open-source code.

## When to choose trace-mcp

- **Commercial software and enterprise codebases**: You work at a commercial company, agency, or startup requiring a permissive **MIT** license without commercial restrictions.
- **Modern web framework depth**: You build with Next.js, React, Vue, Express, Fastify, Django, FastAPI, Rails, Spring Boot, or Laravel, and need semantic connections between routes, controllers, middleware, and ORM models.
- **Prompt budget efficiency**: You want a lean, 29-tool `minimal` preset (~11.6K tokens) that protects agent context windows, with dynamic escalation via `load_tools`.
- **Deterministic typed tools**: You want reliable, schema-validated tools (`get_callers`, `get_change_impact`, `get_symbol`) rather than fragile raw Cypher queries.
- **Safe AST refactoring**: You want your AI agent to perform verified symbol renames, code extractions, and file moves with automatic import graph updates.
- **Built-in CI security & quality gates**: You need OWASP Top-10 taint analysis and SARIF 2.1.0 reporting integrated into your development pipeline.
- **Instant zero-setup installation**: You want a tool that runs immediately via `npx -y trace-mcp@latest` without native C++ compilation or build tool dependencies.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [Repomix vs codegraph](/vs/repomix-vs-codegraph.html)
- Explore measured token savings and quality results across 60 open-source pull requests: [PR context benchmark](/pr-context-benchmark.html).
- Explore all MCP tools in the [tools reference](/tools-reference.html).
- Read the [architecture](/architecture.html) guide to see how embedded SQLite and tree-sitter WASM work together.
- Install trace-mcp in seconds: `npx -y trace-mcp@latest init`.

---

# Graft alternative: trace-mcp vs Graft

Source: https://trace-mcp.com/vs/graft.html



**TL;DR.** Graft (`trailhq/Graft` / `@nanonets/graft`, {{ site.data.competitors.graft.stars }} stars, MIT) is a context layer for AI coding agents (Claude Code, Cursor, Codex) that generates a repository knowledge graph as a folder of linked markdown files. It uses an external LLM (Anthropic Claude or OpenAI) to summarize subsystems, architectural boundaries, and concepts in plain English.

The fundamental differences between the two projects lie in indexing cost, privacy, graph storage, framework depth, and write capabilities. Graft relies on external LLM API calls to generate and update its markdown files, meaning indexing costs tokens, requires external API keys, and uploads proprietary source code to cloud models. trace-mcp is 100% local, deterministic, and private: it parses code in seconds using local Tree-sitter WASM and stores edges in an embedded SQLite database with zero external network requests and zero token bills. Graft stores concept nodes as loose markdown files on disk; trace-mcp stores relational symbol graphs that enable sub-millisecond multi-hop graph queries (`get_callers`, `get_callees`, `get_change_impact`). Furthermore, trace-mcp models deep semantic edges across {{ site.data.counts.frameworks }} web frameworks and provides verified AST refactoring write tools (`refactor_rename`, `refactor_extract`, `refactor_move`, `refactor_codemod`) and OWASP taint analysis, neither of which exists in Graft.

Pick Graft if you want human-readable markdown documentation files committed directly to your repository that developers can browse in standard markdown viewers. Pick trace-mcp if you require instant local indexing with zero API bills, complete source privacy, relational graph traversal across {{ site.data.counts.frameworks }} frameworks, and safe AST refactoring write capabilities.

## Head-to-head

| Capability | trace-mcp | Graft |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.graft.stars }} |
| License | **MIT** (permissive open-source) | **MIT** (permissive open-source) |
| Written in | TypeScript (Node.js) | TypeScript (Node.js) |
| Installation / Distribution | `npx -y trace-mcp@latest` (npm registry) | `npx @nanonets/graft` / `npm i -g @nanonets/graft` |
| Indexing engine | **100% deterministic local WASM** (Tree-sitter) | Hybrid: Tree-sitter + external LLM calls (Claude / OpenAI) |
| Indexing cost | **$0.00** (zero API tokens, zero keys) | Requires external API keys, bills tokens per file |
| Code privacy | **100% local** (code never leaves the machine) | Sends code chunks to external LLM APIs for summarization |
| Underlying storage | Embedded SQLite WAL + FTS5 full-text index | Folder of loose markdown files (`graft/*.md`) + front matter |
| Query speed | **Sub-millisecond** indexed SQL queries | File system traversal and front matter text parsing |
| Languages (AST parsing) | **{{ site.data.counts.languages }}** (precompiled WASM) | 9 (native C++ tree-sitter grammars) |
| Build dependencies | **Zero native builds** (WASM sandboxes) | Native C++ compiler toolchain required (`node-gyp`, Python) |
| Framework integrations | **{{ site.data.counts.frameworks }}** semantic integrations | 0 (generic syntax AST only) |
| Framework-aware edges | ✓ route → handler, controller → template, ORM → table | ✗ (syntax AST only) |
| MCP tools defined | {{ site.data.counts.tools }} tools (adaptive task presets) | 6 tools (`graft_find_code`, `graft_trace_calls`, etc.) |
| Default advertised tools | **29** (~11.6K tok, task presets `minimal`, `review`, `dev`) | 6 tools advertised unconditionally |
| Refactoring write tools | ✓ AST-native transforms (rename, extract, move, codemods) | ✗ (read-only context retrieval) |
| Security analysis | ✓ OWASP Top-10 taint analysis, SARIF 2.1.0 | ✗ |
| Session & decision memory | ✓ Symbol-bound decision knowledge graph with staleness checks | ✗ (file freshness check only) |
| Human-browsable markdown docs | ✗ (structured query context via MCP) | ✓ Generates readable markdown files in `graft/` |

Verified on September 11, 2026 against Graft repository at `main` (v0.18.0, {{ site.data.competitors.graft.stars }} stars, `trailhq/Graft`). Tool definitions from `src/mcp/tool-names.ts` and `src/mcp/tools.ts`, package dependencies from `package.json`, graph representation from `src/graph/`, and CLI configuration from `src/cli/`.

## Key architectural differences

### 1. Indexing Cost & Privacy: Local Deterministic Parsing vs. External Paid LLMs

The most fundamental architectural difference between trace-mcp and Graft is how the codebase graph is constructed.

Graft relies on external generative LLMs (`@anthropic-ai/sdk`, `openai`) to synthesize concept nodes and describe subsystems:
- Before Graft can build a graph, developers must supply an Anthropic or OpenAI API key.
- Source code is partitioned and sent over the network to commercial LLM providers, raising data privacy, compliance, and NDA concerns on proprietary codebases.
- Indexing incurs continuous token costs on every initial build and subsequent update, scaling with the size and churn of the codebase.

trace-mcp is **100% local, offline, and private**:
- Code is parsed entirely on your workstation using sandboxed `web-tree-sitter` WebAssembly binaries.
- Your code, ASTs, and indices never leave your local environment.
- Indexing an entire enterprise monorepo of 50,000+ files completes in seconds with zero API tokens consumed and zero dollars spent.

### 2. Storage Architecture: Relational SQLite WAL vs. File-Based Markdown Cache

Graft stores its knowledge graph as a directory of loose markdown files (`graft/*.md`) using YAML front matter (`gray-matter`):
- Subsystems and concept nodes are saved as individual `.md` files in the repository.
- While markdown files are easy for humans to open and read, traversing multi-hop symbol relationships (e.g., finding all indirect callers of an authentication helper across 20 modules) requires walking directories and parsing text files off disk.
- Maintaining graph integrity across thousands of loose files is vulnerable to disk fragmentation, file lock contention, and drift.

trace-mcp stores symbols, calls, and relationships in an **embedded SQLite database** with WAL (Write-Ahead Logging) mode and FTS5 (Full-Text Search):
- Relational tables and B-tree indices support instant sub-millisecond graph traversals (`find_symbol`, `get_callers`, `get_callees`, `find_path`, `get_change_impact`).
- Multi-tier resolution (from compiler-verified to heuristic AST matching) executes within structured SQL queries.
- SQLite WAL mode ensures concurrent read access and instantaneous updates when files change.

### 3. Tool Surface & Write Path: AST Refactoring vs. Read-Only Retrieval

Graft exposes 6 read-only MCP tools:
- `graft_find_code`: Natural language code search across generated markdown concepts.
- `graft_find_all`: Symbol and pattern grep.
- `graft_trace_calls`: Upstream and downstream call tracing.
- `graft_file_api`: File outline / skeleton extraction.
- `graft_repo_map`: Top-level subsystem map.
- `graft_check_freshness`: Checks if markdown documentation is out of date relative to source files.

Graft offers zero tools to modify code. If an agent needs to refactor a function, rename a symbol across 50 files, or extract duplicate logic, it must fall back to blind string replacement or manual file rewrites.

trace-mcp pairs comprehensive graph navigation with **production-grade AST refactoring write tools**:
- `refactor_rename`: Performs scope-aware symbol renames across the entire codebase, updating call sites and cross-file imports while validating syntax integrity.
- `refactor_extract`: Extracts selected statements into new functions with inferred arguments and return types.
- `refactor_move`: Moves functions or classes across file boundaries and automatically rewrites dependent imports.
- `refactor_codemod`: Executes structural AST transformations with compiler validation.
- `taint_analysis`: Tracks untrusted user input to security-sensitive sinks across the call graph and exports SARIF 2.1.0 reports.

### 4. Framework Awareness: 88 Web Framework Integrations vs. Generic Syntax

Graft extracts syntactic symbols (classes, functions, calls) from raw language grammars. It does not model web application frameworks or cross-tier abstractions:
- It cannot link an HTTP route declared in a router file to its controller action and underlying database model.
- It does not resolve dependency injection bindings (e.g. NestJS, Spring Boot, Angular).
- It does not track ORM models (Prisma, Drizzle, TypeORM, SQLAlchemy) to database tables and migrations.

trace-mcp constructs semantic graph edges across **{{ site.data.counts.frameworks }} frameworks**:
- Connects frontend API calls to backend endpoints.
- Maps ORM models to database schemas and migrations.
- Resolves framework-specific lifecycle hooks, middleware pipelines, and controller routes.

When an AI agent modifies a backend controller, trace-mcp warns the agent about affected frontend callers and impacted database queries.

### 5. Build Portability: Sandboxed WASM vs. Native C++ Compilations

Graft relies on native Node.js addons:
- Native C++ Tree-sitter bindings compiled via `node-gyp` across multiple language packages (`tree-sitter-go`, `tree-sitter-java`, `tree-sitter-python`, `tree-sitter-swift`, etc.).
- Installing Graft requires a host C++ compiler toolchain (`gcc`, `clang`, `make`, `python3`). On minimal CI containers, Alpine Linux, or locked-down developer laptops, `npm install` frequently fails due to missing compilation tools.

trace-mcp is engineered for **zero-setup, universal portability**:
- Code parsing runs inside isolated WASM sandboxes via `web-tree-sitter` and precompiled WASM grammars.
- Storage runs in embedded `better-sqlite3` with prebuilt platform binaries.
- Running `npx -y trace-mcp@latest` requires only Node.js—no C++ compilers, no Python build scripts, and no native compilation steps.

## When to choose Graft

- **Human-browsable documentation**: You want plain-English markdown files committed to `graft/` in your repository so team members can read architectural overviews in GitHub or markdown viewers.
- **Natural language concept indexing**: You prefer an external LLM synthesizing English descriptions of what each subsystem does rather than querying AST relationships.
- **Small to medium codebases with cloud LLM access**: Your organization allows sending source code to Anthropic or OpenAI, and you don't mind paying API token bills for graph generation.

## When to choose trace-mcp

- **Zero token cost & complete code privacy**: You need local-first code intelligence that runs 100% offline, requires no API keys, incurs no token bills, and never sends source code to external servers.
- **Fast, relational graph traversal**: You need sub-millisecond graph queries (`get_callers`, `get_callees`, `get_change_impact`) backed by an embedded SQLite database.
- **Web framework depth**: You build with modern stacks (React, Next.js, Express, NestJS, Django, FastAPI, Spring Boot, Rails, etc.) and require semantic edges across routes, controllers, and ORM models.
- **Safe AST refactoring**: You want your AI agent to safely rename symbols across files, extract functions, move modules, and run codemods with syntax verification.
- **Security & quality gates**: You want automated OWASP Top-10 taint analysis and CI-ready SARIF 2.1.0 vulnerability reporting.
- **Instant zero-setup portability**: You want a tool that runs immediately via `npx -y trace-mcp@latest` with zero native C++ compiler toolchains.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs GitNexus](/vs/gitnexus.html) · [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [Repomix vs codegraph](/vs/repomix-vs-codegraph.html)
- Explore measured token savings and quality results across 60 open-source pull requests: [PR context benchmark](/pr-context-benchmark.html).
- Explore all MCP tools in the [tools reference](/tools-reference.html).
- Read the [architecture](/architecture.html) guide to see how embedded SQLite and tree-sitter WASM work together.
- Install trace-mcp in seconds: `npx -y trace-mcp@latest init`.

---

# Narsil-MCP alternative: trace-mcp vs Narsil-MCP

Source: https://trace-mcp.com/vs/narsil-mcp.html



**TL;DR.** Narsil-MCP is a Rust-based code intelligence MCP server that organizes codebase knowledge into a 4-layer Code Context Graph (CCG) stored in an `oxigraph` SPARQL/RDF triple store with `tantivy` LZ4 full-text search. It exposes 90 specialized MCP tools across 4 presets, features an embedded Axum HTTP server with a React visualization SPA, and provides 147 syntactic security rules.

The fundamental architectural differences center on query ergonomics, framework semantics, refactoring capabilities, and security grounding. Narsil-MCP exposes raw SPARQL queries against RDF triples, which introduces significant syntax and hallucination overhead for LLM agents; trace-mcp provides deterministic, strongly typed MCP tools (`get_callers`, `get_change_impact`, `find_usages`). Narsil-MCP extracts syntax for 32 languages without framework models; trace-mcp builds typed semantic edges across {{ site.data.counts.frameworks }} frameworks (connecting HTTP routes to handlers, controllers to templates, and ORM models to tables). Narsil-MCP is strictly read-only with zero refactoring write tools and zero session memory; trace-mcp provides atomic AST-verified refactoring write tools (`refactor_rename`, `refactor_extract`, `refactor_move`, `refactor_codemod`) and code-linked decision memory with staleness verification.

Pick Narsil-MCP if you need formal RDF/SPARQL knowledge graph querying, want a self-contained embedded React web UI for visual exploration, or prefer a compiled Rust standalone binary. Pick trace-mcp if you develop web applications in modern frameworks, require calibrated 5-tier call graphs, need safe AST refactoring write tools, and want zero-setup execution via npm.

## Head-to-head

| Capability | trace-mcp | Narsil-MCP |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.narsil_mcp.stars }} |
| License | **MIT** (permissive open-source) | **MIT OR Apache-2.0** (dual permissive) |
| Written in | TypeScript (Node.js) | Rust (edition 2021) |
| Installation / Distribution | `npx -y trace-mcp@latest` (npm registry) | `cargo install narsil-mcp` / GitHub release binaries |
| Underlying storage | Embedded SQLite + FTS5 + local ONNX | `oxigraph` (SPARQL/RDF) + `tantivy` (LZ4) + `postcard` |
| Graph specification | 5-tier directed code graph (SQLite WAL) | Code Context Graph (CCG) v0.2 spec (4 RDF layers) |
| Languages (AST parsing) | **{{ site.data.counts.languages }}** (tree-sitter WASM) | 32 (tree-sitter native) |
| Framework integrations | **{{ site.data.counts.frameworks }}** semantic integrations | ✗ (syntax AST only, no framework semantics) |
| Framework-aware edges | ✓ route → handler, middleware, template, ORM | ✗ |
| MCP tools defined | {{ site.data.counts.tools }} tools | 90 tools (11 categories) |
| Default advertised tools | **29** (~11.6K tok, task presets) | 20-30 (`minimal`) up to 70+ (`full`) |
| Tool surface management | Task presets (`minimal`, `review`, `architecture`, `dev`) + `load_tools` | 4 presets (`minimal`, `balanced`, `full`, `security-focused`) |
| Call graph resolution | 5-tier resolution (`compiler_verified` to `fuzzy`) with calibrated confidence | Graph traversal over AST call sites (`--call-graph` flag) |
| Refactoring capability | ✓ AST-native safe transforms (rename, extract, move, codemods) | ✗ (analysis-only, zero refactoring write tools) |
| Security scanning | ✓ OWASP Top-10 taint analysis, SARIF 2.1.0 | ✓ 147 rules (regex-pattern taint matching, OSV/SBOM) |
| Session memory | ✓ code-linked decision graph with staleness checks | ✗ (stateless across turns, no decision memory) |
| Graph visualization | Desktop app (cosmos.gl, offscreen headless safe) | Embedded Axum HTTP server + React SPA frontend |
| Graph query interface | Strongly typed MCP primitives + `graph_query` | SPARQL 1.1 queries against RDF triples (`query_sparql`) |

Verified on September 8, 2026 against Narsil-MCP's repository at `main` (v1.7.0, {{ site.data.competitors.narsil_mcp.stars }} stars). Tool definitions from `src/tool_metadata.rs`, presets from `src/config/preset.rs`, taint matching from `src/taint/patterns.rs`, SPARQL persistence from `src/persistence/sparql.rs`, and CCG architecture from `docs/ccg-spec.md`.

## Key architectural differences

### 1. Query Ergonomics: SPARQL 1.1 on RDF vs. Strongly Typed MCP Primitives

The core thesis of Narsil-MCP is representing codebases as semantic RDF knowledge graphs according to the Code Context Graph (CCG) specification. Its Layer 3 graph stores classes, methods, modules, and dependencies as RDF triples inside `oxigraph`.

To query this graph, Narsil-MCP exposes SPARQL 1.1 endpoints (`query_sparql`). While SPARQL is a powerful W3C standard for semantic knowledge graphs, it introduces severe friction for AI coding agents:
- **High prompt and syntax overhead**: The agent must construct valid SPARQL query strings adhering to specific namespaces (`https://codecontextgraph.com/vocab/`).
- **Parameter and URI hallucinations**: Models frequently invent predicate URIs (such as `ccg:invokesMethod` instead of `ccg:calls`), resulting in query parse errors or silent empty result sets that waste agent turns.
- **Round-trip latency**: Recovering from SPARQL errors requires additional reasoning turns and schema re-inspections.

trace-mcp is designed around **Deterministic, Strongly Typed MCP Primitives**:
- Dedicated tools for specific questions: `get_callers`, `get_change_impact`, `find_usages`, `get_outline`, `get_symbol`.
- Zero query language syntax to hallucinate: parameters are simple strings (`symbol_id`, `file_path`, `depth`).
- Deterministic structured output formatted for model comprehension without RDF triple deserialization.
- When flexible graph exploration is needed, `graph_query` provides a safe, domain-specific traversal interface without requiring SPARQL query generation.

### 2. Context Delivery: 4-Layer CCG Disclosure vs. 29-Tool Minimal Preset with Dynamic Escalation

Managing model context window budgets is critical to prevent prompt dilution and excessive token costs. The two servers approach context efficiency from different angles.

Narsil-MCP structures repository data into four progressive CCG tiers:
- **Layer 0 (Manifest)**: Minimal repository identity, symbol counts, and language breakdown (~1-2KB JSON-LD).
- **Layer 1 (Architecture)**: High-level component topology and entry points (~10-50KB).
- **Layer 2 (Symbol Index)**: Comprehensive symbol index (~100-500KB gzipped N-Quads).
- **Layer 3 (Full RDF)**: Complete semantic graph with all triples (~1-20MB).

While Layer 0 provides an ultra-compact start, accessing granular symbols in Layers 2 and 3 requires fetching large chunks of serialized graph data. Furthermore, in tool discovery, Narsil-MCP's 90 tools across 11 categories must be managed via static presets (`minimal`, `balanced`, `full`, `security-focused`). If an agent on the `minimal` preset needs a specialized tool from `full`, it cannot load it without server re-configuration.

trace-mcp addresses context overhead on both tool and data surfaces:
- **Lean 29-tool `minimal` default**: Consumes ~11.6K tokens total (schema plus server instructions) at session start, preserving prompt capacity.
- **Dynamic runtime escalation**: Any of the {{ site.data.counts.tools }} tools outside the active preset can be activated on demand in the live session via `load_tools`.
- **Targeted context slices**: Tools like `get_outline`, `get_symbol`, and `get_change_impact` return exact AST slices and blast-radius summaries rather than requiring the agent to parse megabytes of raw RDF triples.

### 3. Language Breadth vs. 88 Framework Semantic Integrations

Both engines parse source code using tree-sitter grammars. Where they diverge is how syntax trees are elevated into software architecture.

Narsil-MCP provides native tree-sitter parsers for 32 programming languages. However, its extractors capture strictly syntactic elements: function declarations, structs, class hierarchies, imports, and method invocations. It has zero framework-aware extractors:
- It records route definition function calls (e.g., `router.get('/api/users', ...)` in Express or `@app.get('/items')` in FastAPI), but creates no route-to-handler edge in the graph.
- It cannot link an MVC controller to its corresponding frontend component (React, Vue, Svelte) or template (Blade, Jinja, ERB).
- It models no database schema relationships or ORM mappings (Prisma, TypeORM, Drizzle, SQLAlchemy, Django ORM).

trace-mcp bridges syntax and application semantics across {{ site.data.counts.frameworks }} frameworks:
- **HTTP Routing & Middleware Chains**: Directly connects URL routes, parameters, and middleware pipelines to backend handler functions.
- **Component & Template Edges**: Maps relationships between server controllers and UI view templates.
- **ORM & Database Models**: Connects ORM models to database tables, migration files, and query callsites.

When an agent reviews a pull request or plans a feature, trace-mcp traces the complete path from the user-facing route to the database query. In Narsil-MCP, the agent must inspect disconnected call sites and manually reconstruct the framework flow.

### 4. Code Modification: Stateless Analysis vs. Atomic AST Refactoring Write Tools

A critical distinction between the two projects is their operational scope: read-only navigation versus active code modification.

Narsil-MCP is strictly **read-only and stateless across agent turns**:
- It identifies complexity hotspots and potential refactoring candidates based on call graph connectivity.
- It provides **zero refactoring write tools**: no symbol renaming, no function extraction, no module moves, and no codemods.
- It provides **zero session memory**: it retains no decisions, architectural constraints, or tradeoff notes across agent turns.

When an agent using Narsil-MCP needs to edit code, it must revert to generic string replacement or full file overwrites, risking broken imports and syntax errors.

trace-mcp provides a complete suite of **AST-native refactoring write tools**:
- `refactor_rename`: Performs scope-aware symbol renames across all referencing files, updating import declarations and call sites with syntax verification.
- `refactor_extract`: Extracts code blocks into new functions with inferred arguments and return signatures.
- `refactor_move`: Relocates functions or classes across module boundaries with automatic import resolution.
- `refactor_codemod`: Applies structural AST transformation patterns with compiler-level validation.
- **Symbol-bound decision memory**: Persists architectural decisions linked directly to symbol IDs, actively checking for code staleness before returning context to the agent.

### 5. Security & Taint Analysis: Syntactic Regex Matching vs. AST-Grounded Dataflow with SARIF Output

Both tools emphasize security analysis, but implement fundamentally different analysis engines.

Narsil-MCP includes security scanning with 147 rules (covering OWASP, CWE, and OSV/SBOM supply chain checks). However, its taint analysis engine (`src/taint/patterns.rs`) operates via regex-like pattern matching over function and property names (`function_patterns`, `property_patterns`). This syntactic approach cannot track dataflow through intermediate variables, assignments, or scope closures, resulting in high false-positive rates and missed vulnerabilities across complex paths.

trace-mcp implements **True AST Dataflow Taint Analysis**:
- Tracks data flow paths from untrusted sources (HTTP parameters, request payloads, environment variables) to sensitive sinks (SQL queries, shell commands, HTML outputs).
- Applies type-aware pruning to eliminate benign variables and safe type conversions.
- Generates standardized **OASIS SARIF 2.1.0** reports, enabling seamless integration into GitHub Code Scanning, GitLab CI, and automated PR quality gates.

## When to choose Narsil-MCP

- **Formal RDF and semantic web pipelines**: You require standardized RDF triples and SPARQL 1.1 query capabilities for integration into corporate knowledge graphs or ontology systems.
- **Built-in web visualization**: You want a self-contained local web UI with an embedded Axum server and interactive React SPA graph viewer compiled into the binary.
- **Multi-tenant access control**: You require the Triple-Heart WebACL access control model for tiered repository permissions.
- **You prefer a compiled Rust standalone binary**: You prefer installing a single native Rust binary via `cargo install` or GitHub releases rather than running Node.js.

## When to choose trace-mcp

- **Modern web application development**: You build with Next.js, React, Vue, Express, Fastify, Django, FastAPI, Rails, Spring Boot, or Laravel, and need semantic edges between routes, middleware, templates, and ORMs.
- **Deterministic agent tooling**: You want strongly typed, zero-hallucination MCP tools (`get_callers`, `get_change_impact`, `find_usages`) rather than generating complex SPARQL queries.
- **Safe, automated AST refactoring**: You want your AI agent to perform atomic symbol renames, extractions, and file moves with syntax validation and cross-file import rewrites.
- **Prompt budget efficiency**: You want a lean 29-tool `minimal` preset (~11.6K tokens) that protects the model's context window on every turn, with dynamic escalation via `load_tools`.
- **High-confidence impact analysis**: You need a 5-tier call graph that explicitly distinguishes compiler-verified relationships from heuristic inferences.
- **Integrated CI security & quality gates**: You want AST-grounded OWASP Top-10 taint analysis and OASIS SARIF 2.1.0 reporting built into your code graph workflow.
- **Zero-setup npm distribution**: You want instant execution via `npx -y trace-mcp@latest` with embedded SQLite and bundled ONNX embeddings.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html)
- Explore measured token savings and quality results across 60 open-source pull requests: [PR context benchmark](/pr-context-benchmark.html).
- Explore all MCP tools in the [tools reference](/tools-reference.html).
- Read the [architecture](/architecture.html) guide to see how embedded SQLite and tree-sitter WASM work together.
- Install trace-mcp in seconds: `npx -y trace-mcp@latest init`.

---

# CodeGraph MCP alternative: trace-mcp vs codegraph

Source: https://trace-mcp.com/vs/codegraph.html



**TL;DR.** codegraph is the largest project in this field by stars, and it made one design decision that is worth understanding before you compare anything else: it defines eight MCP tools and **advertises exactly one of them**. Everything an agent can ask it goes through `codegraph_explore`. The reasoning, stated in its own source, is that the other seven are narrower slices of `explore` and that the mere presence of a tool steers agents into mis-picking it.

trace-mcp bets the other way. It advertises 28 tools on its default preset — navigation, impact analysis, refactoring, security scanning, code-linked memory — because those are genuinely different operations, not slices of one.

Pick codegraph if the job is *orient an agent in a repository it has never seen*, and you want that to cost almost nothing in advertised schema. Pick trace-mcp if the job continues after orientation.

## Head-to-head

| Capability | trace-mcp | codegraph |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.codegraph.stars }} |
| License | MIT | MIT |
| Languages | {{ site.data.counts.languages }} (tree-sitter) | 34 (tree-sitter, Rust kernel + WASM fallback) |
| Framework integrations | ✓ {{ site.data.counts.frameworks }} | ✓ 17 (route → handler) |
| Framework edges beyond routing | ✓ controller → template, model → table, component → component | partial — route → handler, plus React Native `component`/`property` nodes |
| Cross-language edges | ✓ | ✓ Swift ↔ ObjC, RN bridge / TurboModules / Expo / Fabric |
| MCP tools defined | {{ site.data.counts.tools }} | 8 |
| MCP tools advertised by default | 28 (~11.6K tok) | **1** (`codegraph_explore`) |
| Rest of the surface reachable | ✓ `load_tools`, one call | ✓ `CODEGRAPH_MCP_TOOLS` env allowlist, restart |
| Persistent graph across restarts | ✓ SQLite + FTS5 | ✓ SQLite |
| Runs fully local, no API key | ✓ | ✓ |
| Incremental re-index on save | ✓ | ✓ debounced file watcher |
| Impact analysis | ✓ reverse traversal + decorator filter | ✓ `codegraph_impact` (behind the allowlist) |
| Refactoring tools | ✓ rename, move, signature, AST codemod, extract | ✗ |
| Security scanning | ✓ OWASP Top-10, type-aware taint | ✗ |
| Control-flow / data-flow | ✓ CFG with basic blocks and loop back-edges | ✗ |
| SARIF / CI output | ✓ 2.1.0, schema-validated | ✗ |
| Session memory | ✓ code-linked decision graph | ✗ |
| Multi-repo | ✓ cross-repo API linking into one graph | partial — queries other separately-indexed projects by path |
| Graph visualization | ✓ desktop app | ✗ |
| Published A/B token benchmark | ✗ per-repo `get_real_savings` instead | ✓ 7 repos, methodology disclosed |
| Written in | TypeScript | TypeScript + Rust kernel |

Verified on August 29, 2026 against codegraph's source and README at commit `6a056ec` — the `main` head, shipped after the `v1.6.0` tag. Tool-surface claims come from the source; language, framework and bridging counts come from the README's own tables, which the source directory layout corroborates.

## When to pick codegraph

- **Your agent's expensive problem is orientation, not editing.** codegraph's own benchmark shows its largest wins exactly where an agent would otherwise burn a big slice of budget on find/grep/read before touching the right file — 2 tool calls against 28 on VS Code, 2 against 43 on Excalidraw, zero file reads in both. If most of your sessions are "understand this unfamiliar codebase", that is the shape of win you are buying.
- **You want the cheapest possible advertised surface.** One tool. Nothing else is listed to the model at all. Our 28-tool default is real money next to that, paid on every session by every client that does not defer tool loading.
- **You want a published benchmark you can argue with.** codegraph reports 88% fewer tool calls, 62% fewer tokens, 44% lower cost and 53% faster across seven repositories, and it discloses the model, the queries, four runs per arm, and a correction to an earlier version of its own harness that had let the control arm reach CodeGraph through the shell. It is self-run, not independently reproduced — but it is the most transparent self-benchmark in this field, and it is more than we publish.
- **Indexing speed on very large trees matters.** A native Rust extraction kernel with per-language tree-sitter grammars, a WASM fallback for unbuilt platforms, and cgroup-aware resource scaling for small VPS boxes is a different engineering investment than a TypeScript-only parser, and their reported numbers on the Swift compiler and the Linux kernel reflect it.
- **Popularity.** codegraph is roughly 670× larger by stars, with the community answers and integrations that follow from that.

## When to pick trace-mcp

- **The job goes past navigation.** Rename across a repo, move a symbol with its imports, an AST codemod, a taint scan with type-aware pruning, quality gates, SARIF for CI, dead-code removal. codegraph has none of these, by design and by its own README's scope.
- **The edges you care about are framework edges beyond routing.** codegraph links URL patterns to their handlers across 17 frameworks, and does it well; its React Native work also emits `component` and `property` nodes. It does not model controller → template or model → table. trace-mcp's {{ site.data.counts.frameworks }} integrations do, and traverses them.
- **Your stack is polyglot.** {{ site.data.counts.languages }} grammars against 34.
- **You want memory that outlives the session and is tied to code.** trace-mcp's decisions link to symbol IDs, are verified as non-stale before recall, and surface inside `get_change_impact`. codegraph has no session memory at all.
- **You want the other tools without an env var and a restart.** codegraph's seven unlisted tools are fully implemented and re-enablable through `CODEGRAPH_MCP_TOOLS`; that is a config change, not something the agent can decide mid-task. trace-mcp's deferred surface is one `load_tools` call away inside the session.

## Where we are not being smug

Four honest points.

**Their default surface is cheaper than ours and it is not close.** One advertised tool against our 28 and ~11.6K tokens. Our number is down from ~50K after the preset bypass on the daemon path was fixed and the default preset moved to `minimal`, and everything outside it is one call away — but "much better than we were" is not "as cheap as theirs."

**Their benchmark covers more of the job than ours does.** Both projects now publish an A/B across named repositories with a disclosed harness — theirs across seven repos and a broad slice of session work, ours the [PR review context benchmark](/pr-context-benchmark.html): a median {{ site.data.pr_context_bench.median_savings_pct }}% input-token reduction over {{ site.data.pr_context_bench.pr_count }} merged pull requests in {{ site.data.pr_context_bench.repo_count }} repositories nobody here maintains, with the losing cases and the re-run command shipped in the repo. Theirs covers the wider workload; ours publishes the revisions it ran on and the five cases where it lost. Both run on repositories their authors do not maintain — that is not a point of difference, and this page said otherwise until September 5, 2026. One task type measured well is not the same as a general claim. For everything else we now publish {{ site.data.response_tokens.reduction_pct }}%, measured on {{ site.data.response_tokens.calls_weighted }} real tool calls from one machine against a baseline that is still an estimate — it replaced an aggregate that turned out to be arithmetic on a constant, and [why it moved](/reduce-claude-code-token-usage.html#the-number-moved-on-5-september-2026-and-here-is-why) is published too.

**They publish their own downside, so we will repeat it rather than quietly use it.** codegraph's README states that its responses leave roughly 80% more retrieval context resident at the end of a multi-turn session than a file-reading agent's do — 67K tokens against 18K on VS Code. That is a genuine cost of returning rich graph answers, it is a cost trace-mcp pays in its own form, and the fact that they printed it is a point in their favour.

**Our security scanning has a ceiling, and it is stated on the [comparisons page](/comparisons.html) rather than only here.** The control-flow graph is line-based, not AST-based, and taint analysis is lexical/regex, not a real dataflow engine. Type-aware pruning cuts false positives; it does not turn this into a dataflow analyser. A full AST/dataflow rewrite is out of scope for now.

If you maintain codegraph and something here is wrong, [open an issue](https://github.com/nikolai-vysotskyi/trace-mcp/issues) and we will fix it.

## FAQ

**What is the core difference between codegraph and trace-mcp?**
codegraph defines eight tools and advertises one, on the reasoning that the rest are narrower slices of `explore` and that presence itself steers mis-picks. trace-mcp advertises 28 and keeps ~140 more one `load_tools` call away, because refactoring, security scanning and memory are not slices of navigation.

**Does codegraph have a smaller tool surface than trace-mcp?**
Yes, substantially — one advertised tool against 28 and ~11.6K tokens. That is a cost we pay every session and they do not. What it buys is a much wider set of operations addressable without an env-var opt-in and a restart.

**Can codegraph do refactoring or security scanning?**
No. Reading its source on August 29, 2026 found no rename/move/codemod, no taint analysis, no control-flow graph, no SARIF and no cross-session memory. It is a navigation and discovery tool, and scopes itself that way.

**Whose token-savings numbers are better supported?**
Both publish one. Theirs: seven repositories, model and queries named, four runs per arm, a documented fix to a flaw in their own earlier harness — 62% fewer tokens, 44% lower cost. Ours: the [PR review context benchmark](/pr-context-benchmark.html), a median {{ site.data.pr_context_bench.median_savings_pct }}% input-token reduction across {{ site.data.pr_context_bench.pr_count }} merged pull requests in {{ site.data.pr_context_bench.repo_count }} repositories we do not maintain, with base and head SHAs, the five cases where it lost, and one command to re-run it. Theirs covers more of a session; ours is the more auditable. Both run on code their authors do not maintain, and neither is third-party reproduced.

**Do either of them send code to a cloud service?**
No. Both index locally into SQLite, need no API key, and survive restarts.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- Comparing codegraph against something other than us: [Repomix vs codegraph](/vs/repomix-vs-codegraph.html) — indexing against packing, on their own terms.
- [Architecture](/architecture.html) — how the indexing pipeline, storage and LSP enrichment fit together.
- [Get started](/#install) — no configuration required.

---

# trace-mcp vs Context Mode

Source: https://trace-mcp.com/vs/context-mode.html



**TL;DR.** These two tools are not really rivals, and a page that pretended otherwise would be wrong in a way you would catch in ten minutes.

Context Mode attacks the cost of what tool calls *return*. A Playwright snapshot, twenty GitHub issues, an nginx access log — its answer is that the agent should write a script, run it in a subprocess, and put only the printed result into the conversation. Everything long gets indexed into SQLite FTS5 and retrieved by BM25 instead of pasted.

trace-mcp attacks the cost of *asking about code*. It parses your repository into a symbol graph so "what calls this", "what breaks if I change this", "where is this route handled" are single cheap lookups rather than a sequence of reads that need compressing afterwards.

If your agent is drowning in tool output, Context Mode is aimed at your problem and trace-mcp is not. If your agent is drowning in `Read` calls trying to understand a codebase, it is the other way round. Both connect to the same client at the same time.

## Head-to-head

| Capability | trace-mcp | Context Mode |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.context_mode.stars }} |
| Licence | MIT | Elastic License 2.0 (source-available, not OSI) |
| Written in | TypeScript | TypeScript |
| MCP tools defined | {{ site.data.counts.tools }} | 11 |
| MCP tools advertised (default) | 29 (~11.6K tok) | 11 — all of them |
| Parses source code (AST) | ✓ tree-sitter, {{ site.data.counts.languages }} languages | ✗ no parser in its dependency tree |
| Symbol index | ✓ | ✗ |
| Cross-file dependency graph | ✓ directed edge graph | ✗ |
| Call graph | ✓ bidirectional | ✗ |
| Impact analysis | ✓ reverse traversal + decorator filter | ✗ |
| Framework-aware edges | ✓ {{ site.data.counts.frameworks }} integrations | ✗ |
| Refactoring tools | ✓ rename, move, signature, codemod, dead code | ✗ |
| Security scanning | ✓ OWASP Top-10, type-aware taint | ✗ |
| Runs agent-written code | ✗ by design | ✓ 12 runtimes, subprocess |
| Compresses other tools' output | ✗ | ✓ core premise |
| Full-text search over arbitrary content | ✓ FTS5 over the indexed repo | ✓ FTS5 + BM25 over docs, logs, fetched pages |
| Fetches and indexes web pages | ✗ | ✓ `ctx_fetch_and_index` |
| Survives context compaction | ✓ decision memory, code-linked | ✓ session snapshot replayed after compaction |
| Cross-session memory | ✓ decisions bound to symbol IDs | ✓ session events, deleted unless `--continue` |
| Client coverage | any MCP client | 17 hosts, but session continuity varies by host |
| Runs fully local, no API key | ✓ | ✓ |
| Published measurement | per-repo `get_real_savings` | ✓ 21 fixtures, harness in repo |

Verified on August 30, 2026 against Context Mode's source at commit `8a35367`, matching `package.json` version `1.0.169`. Tool, parser and storage claims come from the source; host-coverage and self-stated limits come from its README, quoted below.

## What Context Mode actually is, from its source

Four things are worth stating precisely, because the marketing word "context" covers both products and hides how differently they work.

**Eleven tools, all advertised.** `ctx_execute`, `ctx_execute_file`, `ctx_index`, `ctx_search`, `ctx_fetch_and_index`, `ctx_batch_execute`, `ctx_stats`, `ctx_doctor`, `ctx_upgrade`, `ctx_purge`, `ctx_insight`. There is no preset system and no deferred loading; the one mode that hides them is the embedded-plugin path, where the host registers the same eleven natively instead.

**"12 languages" is not the same axis as our language count.** Context Mode's list — JavaScript, TypeScript, Python, shell, Ruby, Go, Rust, PHP, Perl, R, Elixir, C# — is the set of runtimes it can *shell out to* in order to run a script you wrote. trace-mcp's {{ site.data.counts.languages }} is the set of grammars it can *parse* to build a graph. Reading the two numbers as comparable is the single easiest mistake to make about these tools, and it is worth not making it in either direction.

**The "sandbox" is hardening, not isolation.** A scratch temp directory, a timeout, and a large denylist of environment variables that enable injection (`LD_PRELOAD`, `NODE_OPTIONS`, `PYTHONSTARTUP`, `RUBYOPT`, `BASH_ENV` and roughly seventy in all, each annotated with its rationale). No container, no seccomp, no VM. The project says this itself rather than leaving you to find it: its README states that the execution tools "run arbitrary code and still inherit the process's filesystem access, so the boundary guard is a defense-in-depth layer for the *file-read* tool, not a full OS sandbox — treat approving any execution tool as approving arbitrary code, and keep host-level sandboxing enabled." Its MCP annotations agree: `ctx_execute` is marked `destructiveHint: true` and `openWorldHint: true`.

**The benchmark is real, narrow, and honestly bounded.** `BENCHMARK.md` reports 21 scenarios over fixtures captured from actual tool output — Context7 docs, Playwright page snapshots, GitHub issue lists, vitest and tsc output, an nginx log, a 500-row analytics CSV — with the fixtures and the harness committed. The headline "315 KB becomes 5.4 KB, 98% reduction" is the subtotal of the 14 `ctx_execute_file` scenarios (its own table says 5.5 KB). The same file reports the FTS5 retrieval path at 44-93%, and labels the overall figure 96%. It measures output bytes, not task success — but it names its fixtures and ships them, which is more than most claims in this field do.

## When to pick Context Mode

- **Your context is being eaten by tool output, not by code reading.** Browser automation, log analysis, big API responses, CI output. That is exactly the problem it was built for, and trace-mcp does nothing about it.
- **You want the agent to compute rather than read.** "Write a script that counts, print the count" is a genuinely good instinct, and Context Mode makes it a first-class routed path instead of a habit you have to nag the model into.
- **You need continuity across compaction on a supported host.** Its session snapshot is rebuilt and re-injected after the conversation compacts. Check its host table first, because coverage is uneven: it calls session support *full* on Claude Code, OpenCode and KiloCode; *high* on Gemini CLI, VS Code and JetBrains Copilot, GitHub Copilot CLI, OpenClaw, Pi and OMP (tool events captured, user decisions mostly not); *partial* on Cursor, Codex CLI, Antigravity CLI and Kiro; and Antigravity IDE and Zed have no hook support and get no session tracking at all.
- **You are not shipping it as a service.** For ordinary internal use, ELv2 is unlikely to bother you.

## When to pick trace-mcp

- **The expensive question is structural.** "What breaks if I change this signature", "who calls this", "which template does this controller render". Those are graph queries. Context Mode has no graph to query — it would help your agent write a script that greps, and a grep is not a resolved edge.
- **You want the work that comes after understanding.** Rename across a repo, move a symbol with its imports, an AST codemod, taint analysis, SARIF for CI, verified dead-code removal. None of that exists in Context Mode's eleven tools.
- **Your memory needs to be about code, not about the session.** trace-mcp's decisions bind to symbol IDs and are checked for staleness before recall, so a decision about a function that has since changed does not get replayed as if it still held. Context Mode's session store is an event journal about the conversation, and it is wiped on a fresh start unless you pass `--continue`.
- **Licence class matters where you work.** MIT against ELv2 is a policy question at many companies, and it gets decided before anyone reads a feature table.

## Where we are not being smug

**Their advertised surface is smaller than ours and always fully loaded.** Eleven tools against our 29 at roughly 11.6K tokens at session start. If you run both servers, you pay both — that is a real cost of the "run them together" recommendation on this page, and you should weigh it rather than take the recommendation on faith.

**Their measurement covers the session; ours covers one task in it.** We now have a benchmark with named fixtures — the [PR review context benchmark](/pr-context-benchmark.html), a median {{ site.data.pr_context_bench.median_savings_pct }}% input-token reduction over {{ site.data.pr_context_bench.pr_count }} merged pull requests in {{ site.data.pr_context_bench.repo_count }} open-source repositories nobody here maintains, re-runnable from the repo. It measures assembling code-review context, not a whole working session, so it does not answer the question Context Mode's numbers answer. For general use we quote {{ site.data.response_tokens.reduction_pct }}%, measured on {{ site.data.response_tokens.calls_weighted }} real tool calls from one machine against an estimated baseline — still our own instrumentation, not a benchmark, and it replaced an earlier aggregate we [disproved ourselves](/reduce-claude-code-token-usage.html#the-number-moved-on-5-september-2026-and-here-is-why).

**They are 200 times our size, and it is not only marketing.** A tool that reaches 20K stars in six months has found something people wanted. The "think in code" framing is a genuinely good idea that we do not have an equivalent of.

**Our security scanning has a ceiling, and it is stated on the [comparisons page](/comparisons.html) rather than only here.** The control-flow graph is line-based, not AST-based, and taint analysis is lexical/regex, not a real dataflow engine. Type-aware pruning cuts false positives; it does not turn this into a dataflow analyser. A full AST/dataflow rewrite is out of scope for now.

If you maintain Context Mode and something here is wrong, [open an issue](https://github.com/nikolai-vysotskyi/trace-mcp/issues) and we will fix it.

## FAQ

**Is Context Mode a competitor to trace-mcp?**
Mostly no. It compresses what tools return; we make questions about code cheap to ask. Different halves of the same bill, and they compose in one client.

**Does Context Mode build a code graph or symbol index?**
No. At commit `8a35367` its eight runtime dependencies contain no tree-sitter and no other parser, and none of its eleven tools resolves a symbol, an import edge or a call edge.

**What does the 98% reduction number actually measure?**
Raw output bytes against summary bytes, over 14 committed fixtures, on the `ctx_execute_file` path only. Its own file reports 44-93% for FTS5 retrieval and 96% overall. It is not a task-success benchmark, and it does not claim to be.

**Is Context Mode open source?**
Source-available under the Elastic License 2.0, which GitHub reports as NOASSERTION. ELv2 forbids offering the software as a managed service. trace-mcp is MIT.

**Is its sandbox an OS-level sandbox?**
No — a scratch directory, a timeout and an environment denylist. Its README says outright that approving an execution tool means approving arbitrary code and that host-level sandboxing should stay on.

**Can I run both?**
Yes, and for a codebase-heavy agent that also drives browsers or CI, that is probably the right setup. Budget for both tool surfaces at session start.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- [Cut Claude Code token usage](/reduce-claude-code-token-usage.html) — seven tactics, ordered by measured impact.
- [Get started](/#install) — no configuration required.

---

# code-review-graph alternative: trace-mcp vs code-review-graph

Source: https://trace-mcp.com/vs/code-review-graph.html



**TL;DR.** [code-review-graph](https://github.com/tirth8205/code-review-graph) (tirth8205/code-review-graph, {{ site.data.competitors.code_review_graph.stars }} stars, Python, MIT) and trace-mcp share the same core architectural premise: parse code with tree-sitter into an incremental, persistent SQLite knowledge graph and serve it to AI coding agents over MCP, instead of letting agents burn context on raw file reads. Both provide cross-file symbol lookup, bidirectional call graphs, reverse-dependency impact analysis, and multi-repo support.

The split is between code review triage and comprehensive codebase intelligence. code-review-graph is designed for review exploration and CI blast-radius checks, with an elegant uncertainty contract that explains why empty results occur. trace-mcp goes deeper into repository semantics with {{ site.data.counts.frameworks }} framework integrations, active refactoring, OWASP security scanning, and session memory that binds architectural decisions to code.

## Head-to-head

| Capability | trace-mcp | code-review-graph |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.code_review_graph.stars }} |
| License | MIT | MIT |
| Written in | TypeScript | Python |
| Current release | v3.22.0 | v2.3.8 |
| Languages | {{ site.data.counts.languages }} | 23 + Jupyter notebooks |
| Framework integrations | ✓ {{ site.data.counts.frameworks }} integrations | ✗ (Python entry points only) |
| Persistent graph storage | ✓ SQLite + FTS5 | ✓ SQLite (`nodes` / `edges` / `metadata`) |
| Edge confidence model | ✓ 5 resolution tiers (`scip_resolved` > `lsp_resolved` > `ast_resolved` > `ast_inferred` > `text_matched`) | 2 tiers (`EXTRACTED` / `INFERRED`) |
| Empty-result reasoning | ✗ derived from edge tier (cap in progress) | ✓ `uncertainty.py` (≤140 chars per empty result) |
| Impact analysis / blast radius | ✓ reverse dependency traversal + decorator filter | ✓ blast-radius + Leiden communities (`igraph`/`networkx`) |
| Call graph | ✓ bidirectional | ✓ graph-based |
| Refactoring tools | ✓ rename, move, signature, AST codemod, dead code | ✗ |
| Security scanning | ✓ OWASP Top-10, type-aware taint, SARIF 2.1.0 | ✗ |
| Control-flow / data-flow | ✓ CFG with basic blocks, loop back-edges | ✗ |
| Session memory | ✓ code-linked decision graph, staleness-verified | ✗ |
| Compiler-grade precision path | ✓ opt-in LSP + offline SCIP ingestion | ✗ |
| Multi-repo support | ✓ cross-repo API linking | ✓ multi-repo daemon |
| CI / PR blast-radius Action | ✓ quality gates + SARIF | ✓ turnkey blast-radius GitHub Action |
| Graph visualization | ✓ desktop app (cosmos.gl) | ✗ |
| MCP tools advertised (default) | 29 (`minimal`, ~11.6K tok); {{ site.data.counts.tools }} on `full` | 29 advertised (~8K description tokens) |
| Tool surface trimming | ✓ dynamic `load_tools` in session; 3 presets | manual allowlist (`serve --tools`, `CRG_TOOLS=`) |

Verified on September 2, 2026 against code-review-graph's source at commit `b58668751ab0` (v2.3.8). Tool registrations, parser dependencies, and graph architecture claims come directly from the source; star count from the GitHub API.

## What code-review-graph actually is, from its source

Cloning the repository at commit `b58668751ab0` and reading `pyproject.toml`, `code_review_graph/graph.py`, `main.py`, `uncertainty.py`, `scoped_resolver.py`, and `parser.py` surfaced four details worth understanding beyond the README.

**Empty results as first-class answers.** The clearest idea in code-review-graph is `uncertainty.py`. When a graph query returns `result_count: 0`, the agent does not know whether the symbol truly has no callers or whether the target was never indexed, the language has a static-analysis blind spot, or the graph is behind the working tree. A confused agent either assumes the relationship does not exist or abandons the tool and runs expensive brute-force scans. `uncertainty.py` attaches an explanation under a strict `MAX_CONFIDENCE_CHARS = 140` budget when the result set is empty, while keeping normal non-empty results byte-identical. Blind spots are maintained in a `LanguageGap` table pairing language sets with query patterns, so call-resolution caveats land on call graphs and never on file summaries.

**Conventional SQLite storage with string keys.** The storage model is a single SQLite file containing `nodes`, `edges`, and `metadata` tables. Edge endpoints are stored as qualified-name strings rather than integer IDs. AST parsing uses `tree-sitter-language-pack`, traversal runs through `networkx`, and `igraph` is an optional extra for calculating Leiden communities.

**Advertised tool cost.** `code_review_graph/main.py` registers 29 `@mcp.tool()` handlers and advertises all 29 to the client by default. Its own docstrings estimate this at "~8k description tokens per LLM turn". Trimming the surface requires setting the `CRG_TOOLS=` environment variable or launching with `serve --tools ...`. There is no preset hierarchy and no mechanism for an agent to load deferred tools mid-session.

**Headline claims.** Its README claims a ~65× median per-question reduction across six repositories (36×–376×), measured against a whole-corpus baseline that the README itself concedes "no real agent pays".

## When to pick code-review-graph

- **You value empty-result explanations.** When a query returns zero results, code-review-graph explicitly tells the model *why* under a 140-character cap rather than returning an ambiguous empty list, preventing the model from hallucinating or falling back to grep.
- **Turnkey GitHub Action for pull request reviews.** It ships a ready-made blast-radius GitHub Action designed to comment impact summaries directly on PRs in CI.
- **You work with Jupyter notebooks.** It parses `.ipynb` notebooks alongside 23 traditional programming languages.
- **Leiden community detection.** It uses `igraph` to partition codebases into functional clusters, which helps with architectural understanding.
- **Multi-repo background daemon.** It includes a dedicated daemon architecture designed to serve multi-repo environments.
- **Established adoption.** At {{ site.data.competitors.code_review_graph.stars }} stars, it has an active user base and broad community awareness.

## When to pick trace-mcp

- **Framework semantics.** A graph that knows functions and files but not that a route links to a handler or an ORM model backs a table misses what developers actually care about. trace-mcp models those connections across {{ site.data.counts.frameworks }} framework integrations.
- **Active refactoring.** Code modification goes beyond reading. trace-mcp provides cross-file rename with import updates, symbol and file moves, signature modifications, AST-based codemods (`@ast-grep/napi`), and dead-code removal. code-review-graph is strictly read-only.
- **Security scanning and quality gates.** trace-mcp includes OWASP Top-10 rules, type-aware taint analysis, control-flow graphs with loop back-edges, and OASIS SARIF 2.1.0 output for CI quality gates.
- **Code-linked session memory.** Architectural decisions and rationale persist across agent sessions bound to symbol IDs, verified against code staleness before recall, and surfaced in impact analysis. code-review-graph has no session memory.
- **Language breadth and compiler-grade precision.** trace-mcp parses {{ site.data.counts.languages }} languages via tree-sitter, and offers an opt-in path for live LSP and offline SCIP index ingestion to raise edge resolution to compiler-grade tiers.
- **Dynamic tool surface.** trace-mcp's default `minimal` preset advertises 29 tools (~11.6K tokens total), keeping ~140 additional tools one `load_tools` call away in-session without server restarts.

## Where we are not being smug

Four honest points where code-review-graph leads or sets a standard.

**Empty-result honesty is a genuine design win we did not think of first.** Treating zero-results with respect by spending ~30 tokens of explanation prevents thousands of tokens of wasted manual file searching. We acknowledged this in our profiling pass and plan to adopt empty-result confidence markers derived from edge resolution tiers.

**Their CI GitHub Action is more turnkey than our quality gates.** They provide an out-of-the-box GitHub Action for blast-radius reporting on pull requests; our CI integration requires running trace-mcp quality gates or ingesting SARIF payloads.

**Our security scanning has a ceiling, and it is stated on the [comparisons page](/comparisons.html) rather than only here.** The control-flow graph is line-based, not AST-based, and taint analysis is lexical/regex, not a full dataflow engine. Type-aware pruning cuts false positives; it does not turn this into a full static application security testing platform.

**Their popularity is roughly 300 times ours.** At {{ site.data.competitors.code_review_graph.stars }} stars, code-review-graph is a proven tool in many workflows, and we do not dismiss that difference.

If you maintain code-review-graph and something here is inaccurate, [open an issue](https://github.com/nikolai-vysotskyi/trace-mcp/issues) and we will correct it.

## FAQ

**What is the core difference between code-review-graph and trace-mcp?**
Both projects parse code with tree-sitter into an incremental SQLite knowledge graph so agents can query dependencies instead of re-reading raw files. code-review-graph focuses on code review navigation and blast-radius reporting in CI, pairing it with an uncertainty contract that explains why empty results occur. trace-mcp builds a deeper graph with framework semantics across {{ site.data.counts.frameworks }} integrations, active refactoring, security scanning, and code-linked session memory.

**What is code-review-graph's empty-result uncertainty mechanism?**
Its uncertainty module treats an empty result as an answer that owes the caller a reason. Under a hard 140-character cap, it explains whether a zero result is genuine or the result of a known parser gap or unindexed dependency. This prevents agents from drawing false conclusions or falling back to costly whole-repository file scans.

**How do their advertised tool surfaces compare in token cost?**
code-review-graph registers 29 MCP tools and advertises all 29 by default, costing roughly 8K tokens of descriptions alone every turn, trimmable only via manual allowlists. trace-mcp advertises 29 tools on its minimal preset costing roughly 11.6K tokens including instructions, and keeps ~140 additional tools reachable dynamically via `load_tools` without requiring an allowlist restart.

**Can code-review-graph refactor code or run security scans?**
No. Reading code-review-graph's source at commit `b58668751ab0` confirmed it is read-only navigation and blast-radius analysis. It provides no rename, move, signature update, or AST codemods, and no OWASP taint analysis or SARIF reporting. trace-mcp ships full refactoring tools and OASIS SARIF 2.1.0 security scanning.

**Which languages and frameworks do they support?**
code-review-graph supports 23 languages plus Jupyter notebooks via tree-sitter-language-pack, but has no framework awareness beyond Python entry points. trace-mcp parses {{ site.data.counts.languages }} languages and understands {{ site.data.counts.frameworks }} framework integrations, resolving route-to-handler, controller-to-template, and model-to-table edges.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Repomix](/vs/repomix.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- [PR review context benchmark](/pr-context-benchmark.html) — measured input-token cost of code-review context on 60 merged pull requests.
- [Architecture](/architecture.html) — how the indexing pipeline, storage and LSP enrichment fit together.
- [Get started](/#install) — no configuration required.

---

# Repomix vs codegraph

Source: https://trace-mcp.com/vs/repomix-vs-codegraph.html



**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** | {{ site.data.competitors.repomix.stars }} | {{ site.data.competitors.codegraph.stars }} |
| 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

- **The repository is not yours.** `repomix --remote owner/name` gives you a third-party codebase in a prompt in seconds, with `--remote-branch` for a tag or a commit. codegraph indexes a local checkout; there is no remote mode.
- **The whole thing fits in context.** If the model can hold every file, a graph buys you nothing — it already has the answer to every structural question, in full.
- **You want no MCP client in the loop.** A pack is a file. Paste it into a web chat, attach it to a ticket, hand it to a colleague. codegraph is only useful through a tool call.
- **You need the pack itself as an artifact.** `--token-count-tree` shows where the tokens are, and `--token-budget` fails a CI job when the packed output exceeds a threshold. That is a build-pipeline primitive; a graph is not.
- **Secrets scanning on the way out.** Repomix runs Secretlint over what it packs, so a key in a `.env` does not silently land in a prompt.

## When to pick codegraph

- **The repository does not fit, and re-packing is the cost you are trying to avoid.** codegraph's own benchmark is exactly this shape: on questions where a file-reading agent needed 28–43 tool calls and up to 19 file reads, the agent with the graph answered from one to four `codegraph_explore` calls and read zero files.
- **The question is structural.** "What breaks if I change this", "who calls this", "how does the request reach this handler". A pack contains the bytes that would answer it, but nothing that computes the answer — and `grep_repomix_output` finds the string, not the edge.
- **Your stack has boundaries a parser normally stops at.** Route to handler across 15 framework families, `navigates` edges across 7 routers, and Swift ↔ Objective-C and React Native bridge hops.
- **You care about the advertised tool surface.** codegraph defines eight MCP tools and lists **one**. Its stated reasoning is that the other seven are narrower slices of `explore` and that presence itself steers agents into mis-picking. The whole surface costs roughly 1,900 tokens. Repomix's MCP server lists five.
- **Staleness has to be visible, not assumed.** During the debounce window, codegraph prepends a banner naming pending files and tells the agent to read them directly. A pack has no equivalent: it is silently stale from the first edit after it was written.

## 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 {{ site.data.counts.frameworks }} framework integrations that model edges beyond routing — controller → template, model → table, component → component — across {{ site.data.counts.languages }} 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 29 tools at roughly 11.6K tokens, against codegraph's one tool at ~1,900 tokens. 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](/pr-context-benchmark.html) is a median {{ site.data.pr_context_bench.median_savings_pct }}% input-token reduction over {{ site.data.pr_context_bench.pr_count }} merged pull requests in {{ site.data.pr_context_bench.repo_count }} 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](/vs/repomix.html) · [trace-mcp vs codegraph](/vs/codegraph.html).

## 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,900 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

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers, with the same sourcing discipline.
- The head-to-heads: [vs Repomix](/vs/repomix.html) · [vs codegraph](/vs/codegraph.html) · [vs Serena](/vs/serena.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs CodeGraphContext](/vs/codegraphcontext.html) · [vs SocratiCode](/vs/socraticode.html) · [vs jCodeMunch](/vs/jcodemunch.html) · [vs TokenSave](/vs/tokensave.html) · [vs GitNexus](/vs/gitnexus.html) · [vs Context Mode](/vs/context-mode.html) · [vs code-review-graph](/vs/code-review-graph.html) · [vs Narsil-MCP](/vs/narsil-mcp.html)
- [Cut Claude Code token usage](/reduce-claude-code-token-usage.html) — the measured tactics, including the ones that have nothing to do with any of these tools.

---

# ast-grep alternative: trace-mcp vs ast-grep

Source: https://trace-mcp.com/vs/ast-grep.html



**TL;DR.** ast-grep (`ast-grep/ast-grep`, {{ site.data.competitors.ast_grep.stars }} stars, MIT, Rust) is the best structural `grep` most teams have never tried: write a pattern that looks like ordinary code with `$LIKE_THIS` wildcards, and it finds or rewrites every AST node with that shape — fast, multi-core, configured in YAML, runnable in CI. trace-mcp is a different kind of tool: it parses the repo into a persistent dependency graph (symbols, imports, call edges, framework edges across {{ site.data.counts.frameworks }} integrations) and serves it over MCP, so an agent asks "who calls this" and "what breaks if I change it" instead of re-searching files every turn.

If the job is "find every `if (x && x())` and rewrite it", ast-grep wins outright. If the job is "an agent working in this repo for forty turns", the graph wins.

## Head-to-head

| Capability | trace-mcp | ast-grep |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.ast_grep.stars }} |
| License | MIT | MIT |
| Written in | TypeScript | Rust |
| Model | persistent index (SQLite + FTS5) | one-shot structural search |
| Pattern search | ✓ symbol/FTS search (text + graph) | ✓ AST patterns with metavariables |
| Rewriting | ✓ AST codemod, rename, move, extract | ✓ `--rewrite` + YAML rules |
| Cross-file call graph | ✓ bidirectional, graph-based | ✗ per-file pattern matches |
| Impact analysis | ✓ reverse dependency traversal | ✗ |
| Framework-aware edges | ✓ {{ site.data.counts.frameworks }} integrations | ✗ |
| MCP tools advertised (default) | 29 (~11.6K tok); {{ site.data.counts.tools }} on `full` | 0 — CLI, no MCP server in README |
| Works offline, no API keys | ✓ | ✓ |
| CI / lint integration | ✓ SARIF 2.1.0, quality gates | ✓ YAML rules as lint |
| Session memory | ✓ code-linked decisions, staleness-checked | ✗ |
| Security scanning | ✓ OWASP Top-10 taint | ✗ (custom rules possible, not shipped) |

Verified on September 26, 2026 against the ast-grep README at `main` ({{ site.data.competitors.ast_grep.stars }} stars, `ast-grep/ast-grep`) plus the GitHub API for stars, license and language. Language count for ast-grep not stated as a single figure in the README on that date, so the table carries no number rather than a guessed one.

## When to pick ast-grep

Honest version, and it is a real list:

- **Pattern-shaped search and rewrites.** `ast-grep -p '$A && $A()' -l ts -r '$A?.()'` is the canonical example from its own README: isomorphic patterns, metavariable wildcards, rewrite in one pass. Nothing in trace-mcp is that direct for shape-based edits.
- **Lint as YAML.** Custom rules (`rule:` + `pattern:` + `fix:`) turn team conventions into CI checks without writing an ESLint plugin or an AST visitor. trace-mcp's quality gates check its own graph; they are not a lint-rule authoring story.
- **Codemods for breaking library migrations.** The README's pitch to library authors is exactly right: ship a scan/rewrite rule and your users adopt the breaking change mechanically. Our codemod path follows graph edges; theirs follows shapes — and most migrations are shapes.
- **Zero daemon, zero index, multi-core Rust.** No build step, no SQLite file, no watcher. It scans, uses every core, exits. For scripts and pre-commit hooks that shape is strictly better than ours.
- **Ecosystem.** Roughly two orders of magnitude more stars, an online playground, and packages on every installer (npm, pip, cargo, brew, scoop, mise, MacPorts, nix). That matters at 2am.

## When to pick trace-mcp

- **The question is structural, not shaped.** "Who calls this", "what breaks if I change this signature", "which route renders this component" — a pattern can approximate the first and cannot answer the rest. The graph resolves them as one tool call.
- **Multi-turn agent sessions.** ast-grep re-scans per invocation; trace-mcp indexes once and serves scoped answers per query. Across forty turns in a repo that does not fit in context, the index amortises and the scans do not.
- **Framework semantics.** Route → handler, controller → template, model → table across {{ site.data.counts.frameworks }} integrations. No pattern language models these; the graph stores them as edges.
- **The agent acts, then remembers.** AST rename/move/extract with import rewriting, OWASP taint with SARIF output, and decisions linked to symbol IDs with staleness checks at recall — none of which a search tool ships.

## The honest caveat

Two of them. First, **ast-grep's pattern engine is the tool ours is not**: for "every call shaped like X", a pattern is more precise than our symbol search plus graph filter, and cheaper than any graph query. We would rather say that here than have you benchmark it yourself.

Second, **our default tool surface is expensive next to a CLI.** trace-mcp advertises 29 tools at roughly 11.6K tokens on the shipped default path; ast-grep advertises nothing because there is no session to advertise into. A short scripted job genuinely costs less through ast-grep.

**Our security scanning has a ceiling, stated on the [comparisons page](/comparisons.html) rather than only here.** The control-flow graph is line-based, not AST-based, and taint analysis is lexical/regex, not a real dataflow engine. Type-aware pruning cuts false positives; it does not turn this into a dataflow analyser.

## FAQ

**What is the core difference between ast-grep and trace-mcp?**
ast-grep matches structural patterns per invocation; trace-mcp precomputes a persistent graph and serves it over MCP. Pattern matching versus a queryable index.

**Can ast-grep do impact analysis or find callers?**
Not as a traversal. A pattern for the callee name approximates callers until overloads, re-exports or dynamic dispatch defeat the pattern. Transitive impact needs resolved edges, which is the graph's job.

**Does ast-grep have an MCP server?**
Not in its README as read on September 26, 2026. It ships as a CLI with YAML rules; an agent uses it by shelling out.

**Which is better for large-scale codemods?**
ast-grep for shape-based rewrites (isomorphic patterns, YAML lint rules, multi-core). trace-mcp when the rewrite follows edges — rename with import rewriting, moves, signature changes verified against the graph.

**Can I use both?**
Yes — ast-grep for structural search and rewrites in CI and scripts, trace-mcp as the agent's live index for navigation, impact analysis and framework-aware questions.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Serena](/vs/serena.html) · [vs Repomix](/vs/repomix.html) · [vs Continue](/vs/continue.html) · [vs Aider](/vs/aider.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html)
- [PR review context benchmark](/pr-context-benchmark.html) — measured input-token cost of code-review context on 60 merged pull requests.
- [Architecture](/architecture.html) — how the indexing pipeline, storage and LSP enrichment fit together.
- [Get started](/#install) — no configuration required.

---

# Continue alternative: trace-mcp vs Continue

Source: https://trace-mcp.com/vs/continue.html



**TL;DR.** Continue (`continuedev/continue`, {{ site.data.competitors.continue_dev.stars }} stars, Apache-2.0) is a pioneering open-source coding agent that lived where you work: a VS Code extension, a JetBrains plugin, and a CLI — chat with your codebase, edit, apply, repeat, against the model of your choice. trace-mcp is not an agent at all: it is a persistent code graph (tree-sitter parsing across {{ site.data.counts.languages }} languages, {{ site.data.counts.frameworks }} framework integrations, SQLite + FTS5) served over MCP, so whatever agent you run asks scoped structural questions instead of re-reading files.

Read the maintenance notice first: Continue's README states the repository is no longer actively maintained and is read-only after its final 2.0.0 release. What follows compares the architectures honestly anyway — including the part where the agent is the thing you actually see.

## Head-to-head

| Capability | trace-mcp | Continue |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.continue_dev.stars }} |
| License | MIT | Apache-2.0 |
| What it is | code-graph index served over MCP | full coding agent (chat + edit + apply) |
| IDE surface | ✗ (any MCP client consumes it) | ✓ VS Code extension, JetBrains plugin, CLI |
| Model choice | model-agnostic (MCP tools) | ✓ any model via configuration |
| Persistent code graph | ✓ SQLite + FTS5, incremental | ✗ — not verified as a graph on reading date |
| Cross-file call graph | ✓ bidirectional, graph-based | not verified on reading date |
| Impact analysis | ✓ reverse dependency traversal | not verified on reading date |
| Framework-aware edges | ✓ {{ site.data.counts.frameworks }} integrations | not verified on reading date |
| MCP tools advertised (default) | 29 (~11.6K tok); {{ site.data.counts.tools }} on `full` | not verified on reading date |
| Refactoring write path | ✓ AST rename, move, extract, codemod | ✓ agent edits via IDE/CLI |
| Security scanning | ✓ OWASP Top-10 taint, SARIF 2.1.0 | ✗ (not its lane) |
| Session memory | ✓ code-linked decisions, staleness-checked | configuration-dependent, not verified |
| Maintenance status | actively maintained | README states read-only, final 2.0.0 |
| Works offline, no API keys | ✓ | model-dependent |

Verified on September 26, 2026 against the Continue README at `main` ({{ site.data.competitors.continue_dev.stars }} stars, `continuedev/continue`) plus the GitHub API for stars, license and language. MCP client details and indexing internals were not stated in the README sections read on that date, so those cells read "not verified" rather than a guess.

## When to pick Continue

- **You want the agent, not the index.** Chat in the sidebar, diff-and-apply in the editor, terminal CLI when you live there. trace-mcp has no chat UI, no inline edit loop, no IDE presence — it is infrastructure your agent calls.
- **Model freedom matters.** Continue's whole pitch is bring-your-own-model with configuration per host. Our tools are model-agnostic by construction (MCP), but we do not pick, route or configure your model.
- **You live in JetBrains or VS Code.** A native extension with an apply button beats any MCP round-trip for the edit half of the loop.
- **History and community.** Roughly two orders of magnitude more stars, thousands of contributors, and years as the reference open-source agent. That is real even with the maintenance notice attached.

## When to pick trace-mcp

- **Your agent re-reads the same repo every turn.** Whole-file context scales with repo size; graph queries scale with the answer. On a multi-turn session in a large codebase, the index amortises and the file reads do not.
- **The questions are structural.** Callers, callees, impact, route → handler, controller → template, model → table. An agent without a graph improvises these from text; with the graph it calls one tool.
- **You switch agents.** The graph outlives any single agent host — VS Code today, CLI tomorrow, a different harness next quarter. The index stays; only the client changes.
- **Work continues past reading.** AST refactoring with import rewriting, dead-code removal, OWASP taint with SARIF, quality gates, complexity hotspots. Continue edits through the agent loop; trace-mcp verifies through the graph.

## The honest caveat

The maintenance notice cuts both ways and we state it plainly: recommending "run both" against a read-only agent repository is a stranger recommendation than on our other pages. If you already run Continue 2.0.0 and it works, the graph composes with it. If you are choosing an agent today, choose a maintained one — and the graph still composes with that one instead.

And the standing caveat on our side: **our default tool surface costs ~11.6K tokens before the agent asks anything**, and our security scanning ceiling (line-based CFG, lexical taint, type-aware pruning — not a dataflow engine) is stated on the [comparisons page](/comparisons.html), not hidden here.

## FAQ

**Is Continue a competitor of trace-mcp?**
Not directly. Continue is the agent you talk to; trace-mcp is the index that agent queries. One consumes context, the other produces it.

**Is Continue still maintained?**
Its README states the repository is no longer actively maintained and is read-only after the final 2.0.0 release (telemetry removed, auth pulled out, bugs squashed). Verify against the live README before adopting.

**Can Continue use trace-mcp?**
That is the intended composition — any MCP-capable agent calling scoped graph tools. Continue's current MCP client configuration was not verified on the reading date; check its docs.

**Which has the lower session cost?**
Different budgets. The agent pays per file read; the graph charges ~11.6K tokens up front on the default path and small per-query costs after. Many structural questions in a big repo favour the graph; a couple of edits in a small one do not.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Serena](/vs/serena.html) · [vs Repomix](/vs/repomix.html) · [vs ast-grep](/vs/ast-grep.html) · [vs Aider](/vs/aider.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html)
- [PR review context benchmark](/pr-context-benchmark.html) — measured input-token cost of code-review context on 60 merged pull requests.
- [Architecture](/architecture.html) — how the indexing pipeline, storage and LSP enrichment fit together.
- [Get started](/#install) — no configuration required.

---

# Aider alternative: trace-mcp vs Aider

Source: https://trace-mcp.com/vs/aider.html



**TL;DR.** Aider (`Aider-AI/aider`, {{ site.data.competitors.aider.stars }} stars, Apache-2.0, Python) is the terminal pair programmer everything else gets measured against: `cd` into your project, pick a model (Claude, DeepSeek, OpenAI, or a local one), and it maps your repo, edits, lints, tests and commits with sensible messages — the tightest git-native AI loop in this field. trace-mcp is not a loop at all: it is a persistent graph of the same repo (symbols, imports, call edges, {{ site.data.counts.frameworks }} framework integrations) served over MCP, so an agent resolves structure with one tool call instead of assembling context by hand.

Aider wins the edit; the graph wins the question before the edit.

## Head-to-head

| Capability | trace-mcp | Aider |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.aider.stars }} |
| License | MIT | Apache-2.0 |
| Written in | TypeScript | Python |
| What it is | persistent code graph over MCP | terminal pair programmer |
| Model choice | model-agnostic (MCP tools) | ✓ cloud + local, 100+ claimed setups |
| Repo map / index | ✓ SQLite graph + FTS5 + embeddings | ✓ repo map assembled into the prompt |
| Cross-file call graph | ✓ bidirectional, graph-based | ✗ map ranks context, edges not stored |
| Impact analysis | ✓ reverse dependency traversal | ✗ (model reasons from mapped context) |
| Framework-aware edges | ✓ {{ site.data.counts.frameworks }} integrations | ✗ |
| MCP tools advertised (default) | 29 (~11.6K tok); {{ site.data.counts.tools }} on `full` | 0 — none advertised in README |
| Git integration | ✓ change-aware reindex | ✓ auto-commit, diff, undo, watch mode |
| Lint + test loop | ✓ quality gates, SARIF 2.1.0 | ✓ auto-lint/test with fix retries |
| Languages (AST parsing) | {{ site.data.counts.languages }} (tree-sitter) | 100+ claimed |
| Security scanning | ✓ OWASP Top-10 taint | ✗ |
| Session memory | ✓ code-linked decisions, staleness-checked | chat history, not code-linked |
| Works offline, no API keys | ✓ | model-dependent (local models possible) |

Verified on September 26, 2026 against the Aider README at `main` ({{ site.data.competitors.aider.stars }} stars, `Aider-AI/aider`) plus the GitHub API for stars, license and language. Aider's language figure is its README's own "100+" claim, quoted as a claim rather than re-measured.

## When to pick Aider

Honest version, and it is a long list — Aider is genuinely excellent:

- **The git-native loop.** Automatic commits with sensible messages, familiar diff/undo, watch mode from your IDE, lint and test retries after every change. Our change-awareness reindexes; Aider's *is* the workflow.
- **Model freedom.** Claude, DeepSeek, OpenAI, Gemini, local models — Aider connects to almost anything and publishes [LLM leaderboards](https://aider.chat/docs/leaderboards/) so you can watch the ranking move. We are model-agnostic by a different route (MCP tools any model calls) but we do not benchmark models.
- **Repo map that just works.** For the "make it work in my large project" problem, a ranked map in the prompt is a proven answer with years of tuning behind it. A graph answers different questions; it does not automatically answer "give the model the right context" better on every repo shape.
- **Proven in the field.** Roughly 280× our stars, thousands of forks, the tool every benchmark names. Voice-to-code, images and web pages as context, copy/paste web-chat mode for locked-down models — the feature list is long because the user base is large enough to have asked for all of it.
- **Zero index to think about.** No daemon, no SQLite file, no watcher config. The map is built per session and discarded; nothing goes stale because nothing persists.

## When to pick trace-mcp

- **Structure as data, not as context.** Callers, callees, transitive impact, route → handler, controller → template, model → table — stored edges answered in one call, rather than map text the model must re-derive the same edges from.
- **Persistence across sessions.** Aider's map is rebuilt per session; our graph (with code-linked decisions, verified non-stale at recall) survives restarts, branches and handoffs between agents.
- **Framework depth.** {{ site.data.counts.frameworks }} integrations that model what web frameworks actually connect. A repo map knows the files; the graph knows the wiring.
- **Past the edit.** AST rename/move/extract with import rewriting, verified dead-code removal, OWASP taint with SARIF, CI quality gates. Aider edits through the model; trace-mcp verifies through the graph.
- **Any agent, not one loop.** The graph serves Claude Code, Cursor, Codex, JetBrains agents and whatever ships next quarter through the same MCP surface. Nothing about it is terminal-shaped.

## The honest caveat

Aider's repo map is the single best "just give the model context" mechanism in this field, and a graph does not obsolete it: on repos that fit comfortably in context, map-in-prompt is simpler and often cheaper than our ~11.6K-token default surface plus per-query costs. Saying the graph always wins would be precisely the kind of claim this site exists to refuse.

And our standing ceiling, stated on the [comparisons page](/comparisons.html): line-based CFG, lexical taint with type-aware pruning — not a dataflow engine, and out of scope to become one.

## FAQ

**What is the core difference between Aider and trace-mcp?**
Aider runs the pair-programming loop (map → edit → lint/test → commit) in your terminal against any model. trace-mcp maintains the persistent graph any agent queries for structural answers. Loop versus index.

**Is Aider's repo map the same as a code graph?**
No. The map is ranked context assembled per prompt; the graph is stored edges queried per question. The map scales with context; the graph scales with the answer.

**Does Aider have an MCP server?**
None advertised in its README as read on September 26, 2026. Its surfaces are the terminal, git, IDE watch mode, voice, images and web pages.

**Which supports more languages?**
Aider claims 100+; we parse {{ site.data.counts.languages }} via tree-sitter. Verify your stack, not the headline.

**Can I use both?**
Yes — Aider driving edit-test-commit while the graph answers impact-before and callers-after without loading whole files.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Serena](/vs/serena.html) · [vs Repomix](/vs/repomix.html) · [vs ast-grep](/vs/ast-grep.html) · [vs Continue](/vs/continue.html) · [vs codebase-memory-mcp](/vs/codebase-memory-mcp.html) · [vs codegraph](/vs/codegraph.html)
- [PR review context benchmark](/pr-context-benchmark.html) — measured input-token cost of code-review context on 60 merged pull requests.
- [Architecture](/architecture.html) — how the indexing pipeline, storage and LSP enrichment fit together.
- [Get started](/#install) — no configuration required.

---

# Cody alternative: trace-mcp vs Sourcegraph Cody

Source: https://trace-mcp.com/vs/cody.html



**TL;DR.** Cody was Sourcegraph's AI coding assistant — chat, completions and edits with context pulled from your whole codebase through their Search API, local and remote. Read the status notice first: Cody Free, Pro and Enterprise Starter were discontinued on July 23, 2025, the `sourcegraph/cody` repository itself returns 404, and what remains is Cody Enterprise for existing enterprise customers (plus an archived public snapshot at {{ site.data.competitors.cody.stars }} stars) while Sourcegraph's individual-developer energy moved to Amp. trace-mcp is the opposite bet: a persistent code graph (tree-sitter across {{ site.data.counts.languages }} languages, {{ site.data.counts.frameworks }} framework integrations, SQLite + FTS5) on your own machine — no account, no key, no per-seat bill, no code leaving the workstation.

If your organisation already pays for Sourcegraph and wants one vendor indexing every repo, Cody Enterprise is the zero-setup answer. If you want the index to live with the code, read on.

## Head-to-head

| Capability | trace-mcp | Cody |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.cody.stars }} (archived snapshot) |
| License | MIT | Apache-2.0 (snapshot); commercial Enterprise |
| Written in | TypeScript | TypeScript (snapshot) |
| What it is | persistent local graph over MCP | cloud assistant on hosted code search |
| Where the index lives | your machine (SQLite) | Sourcegraph Cloud or self-hosted |
| Needs account / key | ✗ | ✓ Enterprise plan |
| Remote multi-repo search | ✓ cross-repo subprojects (local) | ✓ local + remote via Search API |
| Framework-aware edges | ✓ {{ site.data.counts.frameworks }} integrations | not verified on reading date |
| Impact analysis | ✓ reverse dependency traversal | not verified on reading date |
| MCP tools advertised (default) | 29 (~11.6K tok); {{ site.data.counts.tools }} on `full` | not verified on reading date |
| Refactoring write path | ✓ AST rename, move, extract, codemod | ✓ agent edits; batch changes for migrations |
| Security scanning | ✓ OWASP Top-10 taint, SARIF 2.1.0 | ✗ (not its lane) |
| Session memory | ✓ code-linked decisions, staleness-checked | conversation-scoped, not verified as code-linked |
| Works offline | ✓ | ✗ by design |
| Availability | actively maintained | Enterprise-only; repo 404 as of 2026-09-26 |

Verified on September 26, 2026: `sourcegraph/cody` returns 404 on both web and API; stars and language from the archived `sourcegraph/cody-public-snapshot` via the GitHub API; plan status from Sourcegraph docs, changelog and Wikipedia (Free/Pro/Starter discontinued July 23, 2025; Amp spin-off December 2025). Cody's MCP surface and framework depth were not verifiable from the sources read on that date, so those cells read "not verified" rather than a guess.

## When to pick Cody

- **One vendor indexing every repo in the org.** Local and remote codebases through a single Search API, with enterprise access controls deciding what the assistant may see. A local-first tool indexes what is on your disk; Cody answers over what the company owns.
- **Zero infrastructure of your own.** No index to build, no daemon to run, no SQLite files to keep fresh — Sourcegraph operates it. The per-seat price is the trade, and at enterprise scale it is often the cheaper trade.
- **Migrations at org scale.** Agentic batch changes across hundreds of repositories is Sourcegraph's home turf — code search was built for exactly that before the assistant existed.
- **IDE presence.** VS Code, JetBrains, Visual Studio and web, with completions in the editor rather than a tool call away from it.

## When to pick trace-mcp

- **The code cannot leave the machine.** No account, no key, no cloud round-trip, no per-seat meter. Regulated codebases and NDAs decide this one before any feature table.
- **Framework semantics.** Route → handler, controller → template, model → table across {{ site.data.counts.frameworks }} integrations — stored edges, not search results the model must re-derive.
- **Persistence across sessions and agents.** The graph and its code-linked decisions survive restarts and outlive any single assistant host; Cody's context is conversation-scoped.
- **Past reading.** AST refactoring with import rewriting, verified dead-code removal, OWASP taint with SARIF, CI quality gates.
- **Offline.** Planes, data centres without egress, laptops on hotel wifi — the index is already there.

## The honest caveat

Cody Enterprise at org scale is the single thing on this site a local tool cannot do: search and assist across every repository a company owns, with access controls, operated by someone else. If that is the job, this page is not going to talk you out of it.

And the standing caveat on our side: **our default tool surface costs ~11.6K tokens before the agent asks anything**, and our security scanning ceiling (line-based CFG, lexical taint, type-aware pruning — not a dataflow engine) is stated on the [comparisons page](/comparisons.html), not hidden here.

## FAQ

**Is Sourcegraph Cody still available?**
Only as Cody Enterprise for existing enterprise customers. Free, Pro and Starter ended July 23, 2025; the repo is a 404 with an archived snapshot; Amp carries the individual-developer effort. Check current pricing before adopting.

**What is the core difference between Cody and trace-mcp?**
Hosted search-plus-assistant versus a persistent local index. Cody pulls context from Sourcegraph infrastructure; trace-mcp stores the graph on your machine and serves it over MCP.

**When is Cody the better pick?**
Org-wide remote search, enterprise controls, zero own infrastructure, batch migrations — with someone else operating it.

**Does Cody work offline?**
No, by design. Ours does, entirely — {{ site.data.counts.languages }} tree-sitter languages with no toolchain and no network.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Serena](/vs/serena.html) · [vs Repomix](/vs/repomix.html) · [vs ast-grep](/vs/ast-grep.html) · [vs Aider](/vs/aider.html) · [vs ripwire](/vs/ripwire.html) · [vs IDE context](/vs/ide-context.html)
- [PR review context benchmark](/pr-context-benchmark.html) — measured input-token cost of code-review context on 60 merged pull requests.
- [Architecture](/architecture.html) — how the indexing pipeline, storage and LSP enrichment fit together.
- [Get started](/#install) — no configuration required.

---

# ripwire alternative: trace-mcp vs ripwire

Source: https://trace-mcp.com/vs/ripwire.html



**TL;DR.** ripwire (`redhat-et/ripwire`, {{ site.data.competitors.ripwire.stars }} stars, Apache-2.0, C++) calls itself the ripgrep of AI context and earns the name: one self-contained offline binary, no API key, no embeddings, no index server, no daemon — a ranked map (signatures at a claimed 74.7% fewer bytes than bodies, callers, blast radius, tests-to-run, quality deltas) rendered per invocation, with the MCP server deliberately demoted to an optional second interface because "its verb schemas sit in your agent's context every session". trace-mcp is the mirror image: a persistent graph in SQLite + FTS5 served over MCP as the core product, with {{ site.data.counts.frameworks }} framework integrations, AST refactoring and code-linked memory across sessions.

The honest summary is that ripwire is the best-argued page in this field — published evals with the losses included — and the gap between the two tools is narrower than on any other page here.

## Head-to-head

| Capability | trace-mcp | ripwire |
|---|:---:|:---:|
| **GitHub stars** | {{ site.data.competitors.trace_mcp.stars }} | {{ site.data.competitors.ripwire.stars }} |
| License | MIT | Apache-2.0 |
| Written in | TypeScript | C++ (C++23) |
| Model | persistent index (SQLite + FTS5) | per-invocation ranked map |
| Dependencies at runtime | Node.js | zero (single binary) |
| Daemon / index server | embedded daemon + watcher | ✗ none |
| Call graph | ✓ bidirectional, graph-based | ✓ ranked, deterministic, per-edge uncertainty labels |
| Impact / blast radius | ✓ reverse dependency traversal | ✓ blast radius + tests-to-run |
| Framework-aware edges | ✓ {{ site.data.counts.frameworks }} integrations | ✗ not stated in README on reading date |
| MCP tools advertised (default) | 29 (~11.6K tok); {{ site.data.counts.tools }} on `full` | optional second interface; CLI-first |
| Languages (parsed) | {{ site.data.counts.languages }} (tree-sitter) | 25 named in README |
| Published evals with losses | ✓ PR benchmark with blind judge | ✓ LocBench slice + 48-question duel, defeats named |
| Refactoring write tools | ✓ AST rename, move, extract, codemod | ✗ map + verdicts, no write path stated |
| Security / quality | ✓ OWASP Top-10 taint, SARIF 2.1.0 | ✓ quality deltas, test gates (McCabe/Halstead lineage) |
| Session memory | ✓ code-linked decisions, staleness-checked | `--recall` over notes; code-linking not stated |
| Works offline, no API keys | ✓ | ✓ |

Verified on September 26, 2026 against the ripwire README at `main` ({{ site.data.competitors.ripwire.stars }} stars, `redhat-et/ripwire`, v0.6.3) plus the GitHub API for stars, license and language. ripwire's benchmark figures (74.7% signature bytes, 0.25 s index, LocBench 58.3% vs 40.0%, 27–7–14 duel) are its own published claims, quoted as claims — not reproduced here.

## When to pick ripwire

Honest version, and it is the strongest "theirs" section on this site:

- **Zero-dependency single binary.** No Node, no daemon, no index server, no watcher — one process that maps a repo in a claimed quarter-second and exits. Our embedded daemon and SQLite files are strictly more machinery.
- **The CLI pipe is cheaper than any MCP surface.** No schemas in context, no 11.6K-token advertised surface — the agent pays per answer, never per session. ripwire says this explicitly in its own README, and it is right.
- **Published evals with the losses.** A LocBench slice (58.3% vs 40.0% best alternative), a 48-question duel against a graph-database MCP server (won 27, lost 7, tied 14 — defeats named one by one), counterexamples published against itself, and a drift-check script that fails if the README disagrees with its own tables. Nobody else in this field documents losing; that is a reason to trust the wins.
- **Per-edge honesty labels.** Uncertain calls drawn dashed, floors labelled floors, truncations disclosed, token budgets on the answer. Our resolution tiers are the same instinct; their per-edge rendering of it is better presentation than ours.
- **Verdict-style outputs for orchestrators.** Quality delta, test gate, edit check — answers a lane can hand back instead of transcripts to re-read.
- **The map visual.** A self-contained HTML graph coloured by complexity or churn, thresholds fixed so colours mean the same thing on every repo. We ship a desktop app; they ship a file.

## When to pick trace-mcp

- **Persistence across sessions and agents.** ripwire renders per invocation; our SQLite index is incremental, watched, and shared — with decisions linked to symbol IDs and verified non-stale at recall rather than notes recalled by relevance.
- **Framework semantics.** Route → handler, controller → template, model → table across {{ site.data.counts.frameworks }} integrations. ripwire's README states no framework mapping on the reading date — syntax and calls, not wiring.
- **The agent acts through the graph.** AST rename/move/extract/codemod with import rewriting and syntax verification, verified dead-code removal — ripwire states no write path.
- **Any MCP client.** The graph serves Claude Code, Cursor, Codex and whatever ships next quarter through one surface; ripwire's MCP server is the optional interface, the CLI pipe the primary one.
- **Full-text + embeddings + graph in one query path.** FTS5 with local ONNX embeddings composed with traversals, rather than a ranked map per call.

## The honest caveat

ripwire's duel section measures against "the leading graph-database code-context MCP server" without naming it in what we read — we do not know whether that server is us, and this page claims nothing about it either way. Their figures are quoted as their claims, with the methodology pointer (EVALS.md) attached so you can check rather than trust.

And our standing ceiling, stated on the [comparisons page](/comparisons.html): line-based CFG, lexical taint with type-aware pruning — not a dataflow engine, and out of scope to become one. Against a peer whose quality lens cites fifty years of replicated results, that ceiling deserves stating plainly.

## FAQ

**What is the core difference between ripwire and trace-mcp?**
Per-call ranked map versus persistent stored index. ripwire renders orientation per invocation over a pipe; trace-mcp keeps the graph in SQLite and serves it over MCP across turns.

**Does ripwire have a call graph and impact analysis?**
Yes — ranked deterministic call graph with per-edge uncertainty labels, blast radius, tests-to-run and quality deltas. Closest overlap with us on this site; the difference is persistence and framework depth.

**What does ripwire do that trace-mcp does not?**
Zero-dep binary, CLI pipe with no session surface cost, evals with published losses, per-edge honesty rendering, verdict outputs for orchestrators, HTML map export.

**What does trace-mcp do that ripwire does not?**
Cross-session persistent index, {{ site.data.counts.frameworks }} framework edges, AST write path with import rewriting, code-linked memory with staleness checks.

**Can I use both?**
Yes — ripwire CLI for cheap per-call orientation, trace-mcp graph for cross-session structure, framework edges and verified refactoring.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Serena](/vs/serena.html) · [vs Repomix](/vs/repomix.html) · [vs Cody](/vs/cody.html) · [vs ast-grep](/vs/ast-grep.html) · [vs Aider](/vs/aider.html) · [vs IDE context](/vs/ide-context.html)
- [PR review context benchmark](/pr-context-benchmark.html) — measured input-token cost of code-review context on 60 merged pull requests.
- [Architecture](/architecture.html) — how the indexing pipeline, storage and LSP enrichment fit together.
- [Get started](/#install) — no configuration required.

---

# IDE context alternative: trace-mcp vs Cursor rules and Copilot instructions

Source: https://trace-mcp.com/vs/ide-context.html



**TL;DR.** Cursor rules (`.cursor/rules` with `description`/`globs`/`alwaysApply`, plus team rules and `AGENTS.md`) and Copilot instructions (the repo-wide copilot-instructions.md file in .github, plus path-specific .instructions.md files under .github/instructions) are the same idea in two IDEs: markdown guidance, versioned with the repo, telling the agent how to work here. trace-mcp is a different layer underneath: a persistent graph of what the code *is* — symbols, imports, call edges, {{ site.data.counts.frameworks }} framework integrations — served over MCP to any agent. Rules steer the session; the graph answers the structural questions inside it.

This is a conceptual comparison — there is no single repository on the other side, so there is no star count and no version. Facts below are from Cursor docs and GitHub docs as read on September 26, 2026.

## Head-to-head

| Capability | trace-mcp | IDE rules (Cursor / Copilot) |
|---|:---:|:---:|
| What it is | computed code graph over MCP | authored markdown guidance for one agent |
| Who writes it | the indexer (from your code) | you (conventions, intent, taste) |
| Answers who-calls-this | ✓ one tool call, stored edges | ✗ can instruct the agent to check; holds no edges |
| Impact analysis | ✓ reverse dependency traversal | ✗ |
| Framework-aware edges | ✓ {{ site.data.counts.frameworks }} integrations | ✗ |
| Per-file scoping | n/a (queries scope themselves) | ✓ globs (`**/*.py`), path-specific instruction files |
| Team enforcement | n/a | ✓ team rules, enforced or optional |
| MCP tools advertised (default) | 29 (~11.6K tok); {{ site.data.counts.tools }} on `full` | n/a — rules are prompt text; MCP servers attach per host |
| Persists across sessions | ✓ SQLite index + code-linked memory | ✓ files persist; agent re-reads them per session |
| Works across agents | ✓ any MCP client | partial — AGENTS.md travels; `.mdc` and team rules do not |
| Refactoring write path | ✓ AST rename, move, extract, codemod | ✗ (the agent edits; rules only constrain it) |
| Security scanning | ✓ OWASP Top-10 taint, SARIF 2.1.0 | ✗ |
| Setup cost | index build, then instant queries | ~zero — a markdown file |

Verified on September 26, 2026 against Cursor rules docs (`cursor.com/docs/rules`, `cursor.com/docs/context/rules`) and GitHub Copilot custom-instructions docs plus the VS Code agent-customization page. Cursor rule mechanics (`.mdc` frontmatter, four rule types, Always/Intelligent/Files/Manual application) and Copilot mechanics (repo-wide file, path-specific `.instructions.md`, organisation level) are as those pages state; anything beyond them is marked as guidance, not quoted fact.

## When to pick IDE rules

Honest version — and most teams should do all of this regardless of the graph:

- **Conventions live in versioned markdown.** "Use named exports", "migrations need up *and* down", "never alter a column in place" — the Cursor docs' own examples. No index will ever contain your team's judgement; write it down where the agent reads it.
- **Scoping is free and precise.** Globs attach guidance to exactly the files it governs; path-specific instruction files do the same for Copilot. Scoped text beats a global preamble on every session budget.
- **Team-wide enforcement.** Team rules with enforced-vs-optional, organisation-level Copilot instructions — governance without a new tool to operate.
- **Zero new machinery.** A markdown file needs no daemon, no index build, no MCP client. The cheapest context is the kind you already have.
- **Portability where it exists.** `AGENTS.md` (and `CLAUDE.md`) travel across agents — Cursor reads them, and so does everything Claude-shaped. Rules written there outlive any single IDE.

## When to pick trace-mcp

- **Guidance cannot hold edges.** "Check callers before editing this" is good guidance; the resolved caller list is a graph answer. Rules point at the work, the graph does it.
- **The question is transitive.** "Everything affected by changing this signature, filtered to route handlers" is not expressible as an instruction file — it is a traversal over stored edges.
- **Framework wiring.** Route → handler, controller → template, model → table across {{ site.data.counts.frameworks }} integrations. No rule file models these; the graph stores them.
- **Across agents and sessions.** The index and its code-linked decisions survive IDE switches, CLI sessions and CI runs; rules are re-read per session and `.mdc` files do not travel outside Cursor.
- **Verified action.** AST refactoring with import rewriting, dead-code removal, OWASP taint with SARIF — the agent edits either way, but through the graph it verifies against resolved structure.

## The honest caveat

Rules win on cost and on content no tool can derive: a 200-line markdown file versioned in git beats any index for "how we work here", and at ~zero tokens of machinery it is the first thing every team should write — before us, not instead of us. The graph is the second layer, not the first.

And our standing ceiling, stated on the [comparisons page](/comparisons.html): line-based CFG, lexical taint with type-aware pruning — not a dataflow engine, and out of scope to become one.

## FAQ

**What is the difference between IDE rules and a code graph?**
Authored guidance versus derived structure. Rules tell the agent how to behave here; the graph answers what the code does. One you write, the other the indexer computes.

**Do Cursor rules or Copilot instructions answer who-calls-this?**
No. They can demand the agent check, but they hold no edges — the agent still searches. The graph stores the edges, so the question is one call.

**Can trace-mcp replace my Cursor rules?**
No. Rules carry team judgement the code cannot contain; the graph carries facts the rules cannot contain. Keep the rules; add the graph underneath.

**Where does each one live?**
Rules live with the repo and IDE (`.cursor/rules`, team dashboard, the Copilot instructions files, `AGENTS.md`); the graph lives beside the repo as SQLite, served over MCP to any agent.

## Next steps

- Learn how a persistent code graph reduces token costs on every turn: [Code graph MCP server](/code-graph-mcp.html).
- Full field: [how trace-mcp compares](/comparisons.html) against 20+ code-graph and memory MCP servers.
- The other head-to-heads: [vs Serena](/vs/serena.html) · [vs Repomix](/vs/repomix.html) · [vs Cody](/vs/cody.html) · [vs ripwire](/vs/ripwire.html) · [vs ast-grep](/vs/ast-grep.html) · [vs Aider](/vs/aider.html)
- [Cut Claude Code token usage](/reduce-claude-code-token-usage.html) — rules-style tactics plus measured graph tactics.
- [Architecture](/architecture.html) — how the indexing pipeline, storage and LSP enrichment fit together.
- [Get started](/#install) — no configuration required.

---

# How to reduce Claude Code token usage

Source: https://trace-mcp.com/reduce-claude-code-token-usage.html



Token cost in Claude Code is not mostly the code you show it. It is the code it reads **looking for** the code it needs, plus everything it re-reads on later turns because the earlier result scrolled out of reach.

Below are seven tactics ordered by how much they moved the number in our own measurements, with the numbers we actually have and honest gaps where we do not have any. Several of them have nothing to do with trace-mcp; those come first, because they are free.

## 1. Stop paying for exploration twice

The dominant cost on a repository too large to fit in context is *search*, not reading. An agent asked "where is rate limiting handled" will open a dozen candidate files before it finds the one that matters, and every one of those reads stays in the transcript for the rest of the session.

Two cheap habits fix most of it:

- **Name the file when you know it.** "Fix the retry backoff in `src/http/client.ts`" costs one read. "Fix the retry backoff" costs an exploration.
- **Ask for structure before content.** Signatures and line ranges are a fraction of a file's tokens, and they are usually enough to pick the one symbol worth reading in full.

## 2. Read symbols, not files

Reading a 500-line file to change five lines pays for 495 lines you did not need — and pays again on the next turn if the result gets re-read. The pattern that works is outline → one symbol → edit.

This is what trace-mcp's `get_outline` and `get_symbol` exist for: the first returns signatures with line numbers, the second returns exactly one function or class. Claude Code's native `Read` supports `offset`/`limit` and will do the same job once you know the range, which is precisely what the outline gives you.

## 3. Audit your MCP tool surface — including ours

This is the tactic most people never check, and it can dominate everything else.

Every MCP server you connect injects its tool schemas into the context **at session start, before you ask anything**. Three servers with large surfaces can cost tens of thousands of tokens on every single session, whether or not you call any of them.

Measured on our own server, August 29, 2026: trace-mcp's shipped default is the `minimal` (29 tools) preset — ~9.8K tokens of `tools/list` plus ~1.75K tokens of server instructions, **~11.6K in total**, which is the number to budget against because a client pays both. (`full` ({{ site.data.counts.tools }} tools) is ~49.9K + ~2.1K if you opt into it.) That is still not cheap, and we say so on our own [comparisons page](/comparisons.html) — the leanest peers in this category advertise ~1.9K and ~7K tokens by shipping a small default surface with the rest opt-in.

What to do about it:

- Run `tools/list` against each server you have connected and count the tokens. Most people have never looked.
- Disconnect servers you are not using in this project. A server connected "just in case" is a fixed tax.
- Use a preset or allowlist where the server offers one. trace-mcp ships `minimal` (29 tools), `standard` (61 tools) and `full` ({{ site.data.counts.tools }} tools), plus `tools.include` / `tools.exclude` in config (see the full [tool index](/tools-index.html)).
- **Previously noted here as broken, now fixed:** presets used to take effect only when the daemon was bypassed (`TRACE_MCP_NO_DAEMON=1`) and were silently ignored on the default daemon-backed path. That bug is shipped and closed — the preset is honoured on both paths, and `TRACE_MCP_NO_DAEMON=1` is no longer needed as a workaround. Measured on the default path: `standard` serves ~18.8K tokens of `tools/list` plus ~1.75K of server instructions (~20.5K), against ~49.9K + ~2.1K for `full`.
- **One caveat that is still live:** set these in the global `~/.trace/.config.json`. `tools.preset` is honoured from a project-local `.trace/.config.json` too, but `tools.description_verbosity` / `tools.instructions_verbosity` are not — set those globally until that is fixed.

## 4. Pick the output format per tool, not globally

Encoding matters, but not uniformly. Our measurements (`scripts/bench-toon.ts`, `gpt-tokenizer` with the cl100k_base encoding, against a snapshot of this repo's own index — 1,501 files, 9,467 symbols):

| Payload shape | Format change | Measured |
|---|---|---:|
| Flat, same scalar fields per row (`query_decisions`) | JSON → TOON | **+31.4%** |
| Flat symbol records (`get_outline`) | JSON → TOON | **+28.8%** |
| Flat item records (`search`) | JSON → TOON | **+16.4%** |
| Nested object per row (`find_usages`) | JSON → TOON | **−17.5%** |
| Inner array per row (`search_text`) | JSON → TOON | **−25.5%** |
| Repeated long paths (`search_text`) | flat → grouped by file | **+20.8%** |

The rule underneath: compact tabular encodings win when every row has the same scalar columns, and lose the moment a row contains a nested object or an inner array. Full method and the breakeven curve are on the [TOON savings page](/toon-savings.html).

Every number in this section is measured by trace-mcp on trace-mcp. The one measurement taken on code we do not own is the [PR review context benchmark](/pr-context-benchmark.html) — {{ site.data.pr_context_bench.pr_count }} merged pull requests across {{ site.data.pr_context_bench.repo_count }} open-source repositories — and to see what any of this is worth on your own sessions rather than on ours, [session analytics](/analytics.html) reports the same figures from your local agent logs.

## 5. Prefer one structural query over many reads

"What breaks if I change this function" answered by reading files is an open-ended crawl: find the definition, grep for the name, open each hit, follow each of those. Answered from a dependency graph it is one call that returns the affected symbols and the tests covering them.

The same applies to "who calls this", "which tests cover this", and "what does this module import". These are graph traversals. If your tooling can compute them, the token cost is the answer's size rather than the search's size — and the search is the expensive part.

## 6. Compact, don't clear

Clearing the context feels like saving tokens and usually is not: the agent re-derives what it lost, and re-derivation costs more than the transcript did. Compaction — or simply writing a short summary of conclusions and starting fresh from it — keeps the findings while dropping the raw tool output that produced them.

## 7. Index once, query many times

The reason a code index pays off is amortisation. Building it costs something once; every query afterwards is cheap and scoped. A packing tool that concatenates your repository into a prompt pays its full cost on **every** refresh, which is fine for a one-shot question and expensive across a long session.

That is the trade in one line: if your session is a single question about a small repository, pack it. If it is many turns against a repository too large to fit in context, index it. We wrote up the specifics against the main packing tool in [trace-mcp vs Repomix](/vs/repomix.html).

## What we claim, and what we have measured

### The number moved on 5 September 2026, and here is why

Until that date this site and the README claimed **~40–50% fewer tokens on average**. That figure was not a measurement. It descended from a counter in `src/savings.ts` that scored every tool call *before the tool ran*: `RAW_COST_ESTIMATES[tool] × 0.15`, a constant. Thousands of calls, zero variance — 5,123 `search_text` calls each booked exactly 2,550 tokens saved. We found it ourselves, in [TRA-880](https://github.com/nikolai-vysotskyi/trace-mcp/pull/915), and the counter now measures the real response instead.

The figure we publish in its place is **{{ site.data.response_tokens.reduction_pct }}%**, over {{ site.data.response_tokens.calls_weighted }} recorded calls of {{ site.data.response_tokens.tools_with_baseline }} tools — 97.2% of everything the store has recorded — with each tool's response counted in `o200k_base` tokens on the wire. Read the caveats before quoting it:

Measured at trace-mcp **{{ site.data.response_tokens.measured_build.version }} (`{{ site.data.response_tokens.measured_build.commit }}`)** on {{ site.data.response_tokens.measured_at | date: "%-d %B %Y" }}{% if site.data.measurements.response_tokens.historical %} — a result from that build, not a claim about the current one{% endif %}. Its [preregistration](/perf/prereg-response-tokens/) publishes it as a **miss** — and, since the tail was measured (TRA-945), on the headline half: the coverage bar is now cleared, the 25% reduction bar is not. The bar was declared unadjustable before the data and has not been moved.

- **The measured half is the response. The baseline half is still an estimate.** "What a `Read`/`Grep` would have cost instead" is hand-written in `RAW_COST_ESTIMATES` and has never been validated. Until it is, this is a measured numerator over an estimated denominator.
- **One machine's usage mix**, not the field — the call weighting comes from a single maintainer store (`benchmarks/response-tokens/call-volume.json`, with provenance).
- **{{ site.data.response_tokens.tools_costing_more }} of the {{ site.data.response_tokens.tools_with_baseline }} tools with a baseline return *more* tokens than it credits them** — `list_projects` at 10.5x is the worst, then `get_dead_code`, `get_call_graph`, `get_complexity_report`, `check_claudemd_drift`, `get_feature_context`, `search`, `get_outline`, `find_usages`, `get_changed_symbols`. The old counter booked a positive number for them anyway. The per-tool table is published in full: [tool response token cost](/perf/response-tokens/).
- **Two more replace no file read at all** (`register_edit`, `reindex`), so they are credited nothing and counted as overhead: {{ site.data.response_tokens.overhead_calls }} calls, {{ site.data.response_tokens.overhead_tokens }} tokens. With them on the spend side the all-in figure is **{{ site.data.response_tokens.reduction_pct_incl_overhead }}%**, which is the one to plan a session budget against.
- It still varies enormously with repository size and session shape; on a small repo that fits in context it is roughly zero.

The one figure here that is neither ours nor an estimate is the [PR review context benchmark](/pr-context-benchmark.html) — {{ site.data.pr_context_bench.median_savings_pct }}% median over {{ site.data.pr_context_bench.pr_count }} merged pull requests in {{ site.data.pr_context_bench.repo_count }} repositories we do not maintain, SHAs pinned and losing cases published. The numbers on this page that come with a script and a tokenizer are the ones in section 4; those you can reproduce.

We still do not have a published, independently reproducible *end-to-end session* benchmark, and at least one competitor does. We would rather write that here than quietly imply otherwise.

## FAQ

**What actually uses the most tokens in Claude Code?**
Repeated full-file reads during exploration, the MCP tool schemas advertised at session start, and long transcripts carrying every earlier tool result forward — in that order on large repositories.

**Do MCP servers increase or decrease token usage?**
Both. Each pays a fixed up-front schema cost and then saves per query if its answers are narrower than the reads they replace. A large surface with few calls per session is a net loss. Measure it with `tools/list`.

**Does asking for an outline instead of reading the file really help?**
Yes, when you only need structure. Outline first, then read the specific symbol or line range — instead of reading 500 lines to edit five.

**Does output format affect token cost?**
Measurably, per payload shape. TOON beat JSON by 31.4% on `query_decisions` and 28.8% on `get_outline`, and lost by 17.5% and 25.5% on `find_usages` and `search_text`. It is a per-tool decision.

**Is clearing context the same as saving tokens?**
No — clearing forces re-derivation, which usually costs more. Compact, or hand off a short written summary.

## Next steps

- [Tools reference](/tools-reference.html) — every trace-mcp tool, including the outline/symbol/impact ones above.
- [Tool index](/tools-index.html) — alphabetical index of all {{ site.data.counts.tools }} tools with availability breakdown.
- [System prompt routing via tweakcc](/tweakcc.html) — patch Claude Code's system prompts to enforce tool routing toward trace-mcp instead of native file reads.
- [TOON savings](/toon-savings.html) — the full measurement method behind section 4.
- [Configuration](/configuration.html) — presets and `tools.include` / `tools.exclude`.
- [Get started](/#install) — no configuration required.

---

# trace-mcp Configuration

Source: https://trace-mcp.com/configuration.html


Configuration is optional — trace-mcp works out of the box for standard projects.

This page is the reference for the file itself: where it lives, how the layers
merge, and what the keys you reach for actually do. Several sections of it are
big enough to have their own page — the [quality gates](quality-gates.md)
thresholds, the [MCP tracing](telemetry.md) span exporter, the memory knobs that
bound the [daemon](daemon-memory.md), and the [tweakcc](tweakcc.md) enforcement
tier that `trace-mcp init` writes here on your behalf.

For the exhaustive list — every key the schema accepts, with its type, allowed
values and real default, generated from the schema itself — see the
[config index](config-index.md).

---

## How config works

All trace state lives in `~/.trace/` (with automatic backwards compatibility and fallback from legacy `~/.trace-mcp/`):

```
~/.trace/
  .config.json              # global config + per-project sections
  registry.json             # registered projects
  index/
    my-app-a1b2c3d4e5f6.db  # per-project databases
```

### Pruning of projects

Starting the server in a directory auto-registers it, so both `registry.json` and the
`projects[...]` map in `.config.json` grow on their own — and both are read on every
server start. The first session that causes a registration says so: the `initialize`
instructions carry a one-off notice naming the directory and `trace-mcp remove <path>`,
and `trace-mcp list` marks such entries `[auto-added on MCP connect]`. An hourly sweep
bounds them:

- a root that no longer exists (after a 7-day grace, so an unmounted drive keeps its
  registration) and one-shot agent-run workdirs are dropped;
- at most **100 auto-registered projects** are kept, least recently indexed first;
- at most **100 config sections that no registry entry claims** are kept, oldest first —
  and only sections that still look exactly as trace-mcp generated them. A section you
  edited by hand (any extra key, or a comment inside it) is never evicted, however old.

Projects you registered yourself with `trace add` or `trace init` are exempt from the
caps and are only removed by `trace remove` / `trace-mcp doctor --fix`. Eviction only
deregisters — your directory and its index database are left alone, so an evicted
project is re-registered the next time you open it.

### Excluding throwaway checkouts from auto-registration

Short-lived checkouts — CI gates, git worktrees off a bare mirror, `/tmp` clones —
otherwise auto-register as persistent projects, cold-index from scratch, and linger as
"Missing folder" once deleted. Two knobs in the global config control this:

```jsonc
{
  "auto_register": {
    "mode": "always", // "always" | "never" | "ask" ("ask" currently behaves as "never")
    "exclude": [      // globs matched against the resolved root
      "~/.gate/worktrees/**",
      "/tmp/**",
      "/private/tmp/**",
      "$TMPDIR/**"
    ]
  }
}
```

- `exclude` extends the built-in one-shot patterns. An excluded root is never written
  to `registry.json` — its index lives in the ephemeral index dir and is collected by
  age. When the checkout shares a git remote with an already-indexed project (including
  bare-mirror worktrees, which share no common dir), read-only lookups route to that
  canonical index instead of building a redundant one.
- Supported glob dialect is `*`, `**`, `?`, and `[...]` character classes (including
  `[!...]` negation). `{a,b}` brace expansion is **not** supported — a pattern using
  braces never matches. Write patterns as absolute paths (after `~` / `$VAR` expansion):
  a relative pattern such as `gate/**` matches at *any* depth system-wide, so prefer
  `~/gate/**`. On macOS list both `/tmp/**` and `/private/tmp/**` (`/tmp` is a symlink;
  matching resolves both sides best-effort, but an explicit pair never depends on it).
- `mode: "never"` disables every implicit registration; the daemon answers new roots
  with an honest "not indexed" error instead of a cold index. Deliberate
  `trace-mcp add` / `trace-mcp init` always still works.
- `TRACE_MCP_AUTO_REGISTER_MODE` and `TRACE_MCP_AUTO_REGISTER_EXCLUDE` (comma-separated
  globs) override the file — useful for gates that cannot edit the global config.
  `TRACE_MCP_REPO_ROOT` redirects the session root for both `serve` and the shim's
  proxy path.

Removing one checkout of a same-remote pair (`trace-mcp remove <clone>`) unregisters
only that checkout: a database still claimed by another registered project (or a live
process) is kept, and the output says so.

Checkouts that share a git remote share one index database only while they sit on the
same commit. A checkout on a different commit registers onto its own database instead,
so its branch-only files never land in the canonical checkout's index. A checkout that
diverges *after* sharing (or was registered before this guard) is served from the
owner's index read-only — no indexing, no file watcher — until its commit matches the
owner's again.

### Config merge order

1. **Global defaults** — `~/.trace/.config.json` (or `~/.trace-mcp/.config.json` fallback)
2. **Per-project section** — `~/.trace/.config.json → projects["/path/to/project"]` (created by `trace add`)
3. **Local override** — `.trace.json` (or legacy `.trace-mcp.json`) in the project directory
4. **Zod schema defaults** — fallback values

### Global config example

`~/.trace/.config.json`:
```jsonc
{
  // Global defaults (apply to all projects)
  "ai": {
    "enabled": true
    // provider defaults to "onnx" — local embeddings, no API keys
  },
  "security": {
    "max_file_size_bytes": 524288
  },

  // Per-project settings (created by `trace add`)
  "projects": {
    "/Users/me/projects/my-app": {
      "root": ".",
      "include": ["app/**/*.php", "routes/**/*.php", "src/**/*.{ts,vue}"],
      "exclude": ["vendor/**", "node_modules/**"]
    },
    "/Users/me/projects/api": {
      "root": ".",
      "include": ["src/**/*.ts"],
      "exclude": ["node_modules/**", "dist/**"]
    }
  }
}
```

### Per-project config file (optional)

You can place a config file at `.trace/.config.json` in your project root to override settings without editing the global config:

```jsonc
// /path/to/project/.trace/.config.json
{
  "include": ["src/**/*.ts", "lib/**/*.ts"],
  "exclude": ["node_modules/**", "dist/**", "coverage/**"],
  "ignore": {
    "directories": ["generated", "proto"],
    "patterns": ["**/fixtures/**", "**/*.generated.ts"],
    // Respect the project's root .gitignore when walking (default: true).
    // Set false to index git-ignored trees too — vendored and generated code
    // then competes with your own in every search result.
    "gitignore": true
  }
}
```

Alternative locations (checked in order): `.trace/.config.json`, `.trace.json`, `.trace-mcp/.config.json`, `.trace-mcp.json`, `.trace-mcp`, `.config/trace.json`, `.config/trace-mcp.json`, `package.json` (under `"trace-mcp"` key). The `trace-mcp`-spelled names keep working permanently — nothing is removed.

---

## Migration from trace-mcp to trace

**The project is `trace-mcp`; the command is `trace`.** The rename lives at exactly that boundary — the CLI verb, the MCP server key written into client configs, and the local state directory shorten to `trace`, and nothing else does: not the npm package, not this repo, not the domain, not the registry entry. The reason is ergonomics, not efficiency — the same shape as `rg` for ripgrep or `kubectl` for kubernetes. The measured token saving from the shorter tool prefix (`mcp__trace__<tool>` vs. `mcp__trace-mcp__<tool>`) is real but small: 66–366 tokens per turn depending on tokenizer and preset, 0.74–1.23% of a tool list that already costs 8k–45k tokens.

**The npm package keeps its name.** It is `trace-mcp` and stays `trace-mcp`: `trace` on npm is an unrelated package by another author, so `npm install -g trace` would install someone else's code. Install with `npm install -g trace-mcp` or `npx -y trace-mcp@latest`.

| | Before | After |
|---|---|---|
| npm package | `trace-mcp` | `trace-mcp` (unchanged) |
| Command | `trace-mcp <cmd>` | `trace <cmd>` — `trace-mcp` kept as an alias |
| MCP server key in client configs | `trace-mcp` | `trace` |
| State directory | `~/.trace-mcp/` | `~/.trace/`, falling back to `~/.trace-mcp/` |
| Project config | `.trace-mcp.json` | `.trace.json`, then `.trace-mcp.json` |
| Plugin / registry ids | `trace-mcp` | `trace-mcp` (unchanged) |

`trace init` and `trace upgrade` rename an existing `mcpServers["trace-mcp"]` entry to `mcpServers["trace"]` in every client they can write to, preserving whatever else you configured on that entry. Nothing is deleted, and an entry you leave spelled `trace-mcp` keeps connecting — it just costs the longer tool prefix. Existing indexes are not rebuilt.

---

## .traceignore

Place a `.traceignore` file in your project root to exclude files and directories from indexing. It uses the same syntax as `.gitignore`:

```gitignore
# Skip generated code
generated/
**/generated/**

# Skip protobuf definitions
proto/

# Skip test fixtures
tests/fixtures/

# Skip specific file patterns
*.generated.ts
*.pb.go

# Negation — re-include something
!proto/important.proto
```

### Difference from .gitignore

| | `.gitignore` | `.traceignore` |
|---|---|---|
| **Effect** | Files are indexed for the dependency graph, but source content is hidden from AI output | Files are **completely skipped** — not indexed at all |
| **Use case** | Secrets, credentials, env files | Generated code, vendored deps, large data files |

### Built-in skip directories

These directories are always skipped (no configuration needed):

`node_modules`, `.git`, `dist`, `build`, `.next`, `__pycache__`, `.venv`, `vendor`, `.trace-mcp`, `coverage`, `.turbo`

You can add **more** directory names to skip via `.traceignore` or the `ignore.directories` config key — both only *add* to the skip list, they don't remove anything from it.

`trace-mcp add` / `trace-mcp index` print a "Skipped top-level folders" line after indexing listing every top-level directory that got skipped this way, so a folder missing from the index isn't a silent surprise.

### Getting a skipped folder indexed

Two different things can leave a folder out of the index — check which one applies:

1. **The folder name collides with a built-in skip dir** (e.g. you have your own `vendor/` or `build/` with real source in it). There's currently no per-project way to un-skip a built-in name — rename the folder, or [open an issue](https://github.com/nikolai-vysotskyi/trace-mcp/issues) if this collision is common enough to warrant a config override.
2. **The folder just isn't a built-in skip dir, but nothing in `include` matches its files.** The default `include` covers every extension a registered language plugin claims, *except* the pure data formats — JSON, XML (`.xml`, `.svg`, `.csproj`, ...) and INI (`.ini`, `.conf`, `.properties`, ...) — which are left out because lockfiles and fixtures would swamp the index. Add an explicit pattern for those:

   ```jsonc
   // .trace/.config.json
   {
     "include": ["schemas/**/*.json"]
   }
   ```

   `include` in a per-project config file **replaces** the built-in list rather than adding to it (config merge is shallow) — copy the defaults from [`src/config.ts`](https://github.com/nikolai-vysotskyi/trace-mcp/blob/master/src/config.ts) alongside your addition if you still want the rest of the project indexed.

---

## Options

| Option | Type | Default | Description |
|---|---|---|---|
| `root` | `string` | `"."` | Project root directory |
| `include` | `string[]` | Auto-detected | Glob patterns for files to index |
| `exclude` | `string[]` | Common exclusions | Glob patterns to skip |
| `follow_symlinks` | `boolean` | `false` | Follow directory symlinks during file discovery. Leave off unless you know the tree is free of symlink cycles — enabling it on a tree with a cycle (e.g. Ansible Molecule's `roles/<role>/molecule/<scenario>/roles/<role> -> ../../../` layout) can silently truncate traversal. Symlinked *files* are always skipped regardless of this setting. |
| `ignore.directories` | `string[]` | `[]` | Extra directory names to skip (added to built-in list) |
| `ignore.patterns` | `string[]` | `[]` | Extra gitignore-style patterns to exclude from indexing |
| `plugins` | `string[]` | `[]` | Paths to custom plugins — see [development](development.md#adding-a-new-integration-plugin) for the plugin interface |
| `security.secret_patterns` | `string[]` | Common patterns | Regex patterns for secret filtering |
| `security.max_file_size_bytes` | `number` | `524288` | Max file size to index (bytes) |

### Framework-specific options

```jsonc
{
  "frameworks": {
    "laravel": {
      "artisan": {
        "enabled": true,    // Enable artisan integration
        "timeout": 10000    // Command timeout in ms
      },
      "graceful_degradation": true  // Continue if artisan fails
    }
  }
}
```

---

## AI configuration

AI features enable semantic search (vector embeddings) and optional LLM-powered summarization. trace-mcp supports three embedding providers, with a **zero-config local option** as the default.

### Provider overview

| Provider | Embeddings | LLM (summarization) | Requires | Setup |
|---|---|---|---|---|
| **`onnx`** (default) | ✓ local, offline | ✗ | `@huggingface/transformers` (optional dep) | Zero-config — model auto-downloads (~23 MB) on first use |
| **`ollama`** | ✓ via Ollama | ✓ via Ollama | Running Ollama instance | Install Ollama + pull models |
| **`lmstudio`** | ✓ via LM Studio | ✓ via LM Studio | LM Studio server running | OpenAI-compatible, no API key |
| **`openai`** | ✓ | ✓ | API key | `api_key` or `OPENAI_API_KEY` env |
| **`anthropic`** | ✗ (no embeddings API) | ✓ | API key | `api_key` or `ANTHROPIC_API_KEY` env |
| **`gemini`** | ✓ | ✓ | API key | Google Generative Language API (consumer) — `api_key` (AIza…) or `GEMINI_API_KEY` env |
| **`vertex`** | ✓ | ✓ | OAuth token + GCP project | Google Vertex AI (GCP) — `api_key` = access token, plus `vertex_project` + `vertex_location` |
| **`voyage`** | ✓ (code-tuned) | ✗ | API key | Voyage AI embeddings only — pair with another provider for inference |
| **`mistral`** / **`groq`** / **`together`** / **`deepseek`** / **`xai`** | ✓ | ✓ | API key | OpenAI-compatible endpoints — per-provider `*_API_KEY` env |

### Minimal setup — local embeddings (no API keys)

```jsonc
{
  "ai": {
    "enabled": true
    // provider defaults to "onnx"
    // model defaults to Xenova/all-MiniLM-L6-v2 (384 dims, Apache 2.0)
    // auto-downloads ~23 MB on first embed_repo or semantic search
  }
}
```

This enables semantic/hybrid `search` and `query_by_intent` with zero configuration. No API keys, no external services, works fully offline after first model download.

### Full setup — Ollama (embeddings + LLM summarization)

```jsonc
{
  "ai": {
    "enabled": true,
    "provider": "ollama",
    "base_url": "http://localhost:11434",
    "inference_model": "gemma4:e4b",
    "fast_model": "gemma4:e4b",
    "embedding_model": "qwen3-embedding:0.6b",
    "embedding_dimensions": 1024,
    "summarize_on_index": true,
    "summarize_batch_size": 20,
    "summarize_kinds": ["class", "function", "method", "interface", "trait", "enum", "type"],
    "concurrency": 4
  }
}
```

> **Ollama embedding dimensions — match your model.** Ollama embedding models
> vary in output dimensionality (`nomic-embed-text` → 768, `qwen3-embedding:0.6b`
> → 1024, `mxbai-embed-large` → 1024, etc.). When `ai.embedding_dimensions` is
> **omitted**, trace-mcp auto-detects the real dimension by probing the model on
> first use, so you don't have to set it. When you **do** set it, the value MUST
> equal the model's real dimension — a wrong value makes every vector insert fail
> with a dimension mismatch, and `embed_repo` then returns `status: "error"`
> (`dimension_mismatch`) rather than a silent 0-coverage "completed". If you
> switch to a model with a different dimension, either update
> `embedding_dimensions` to match (or remove it) and re-run
> `embed_repo({ force: true })`.

### Full setup — OpenAI

```jsonc
{
  "ai": {
    "enabled": true,
    "provider": "openai",
    "api_key": "sk-...",
    "inference_model": "gpt-4o-mini",
    "embedding_model": "text-embedding-3-small",
    "embedding_dimensions": 1536,
    "summarize_on_index": true
  }
}
```

### Full setup — Google Gemini (consumer API)

Uses the Google Generative Language API (`generativelanguage.googleapis.com`) with a simple `AIza…` API key from [ai.google.dev](https://ai.google.dev). For GCP-governed workloads, use the `vertex` provider instead.

```jsonc
{
  "ai": {
    "enabled": true,
    "provider": "gemini",
    "api_key": "AIza...",
    "inference_model": "gemini-2.5-flash",
    "embedding_model": "text-embedding-004",
    "embedding_dimensions": 768
  }
}
```

### Full setup — Google Vertex AI (GCP)

Uses Vertex AI with a short-lived OAuth2 access token (~1h TTL). Generate via `gcloud auth print-access-token` — you're responsible for refreshing it.

```jsonc
{
  "ai": {
    "enabled": true,
    "provider": "vertex",
    "api_key": "ya29....",                // `gcloud auth print-access-token`
    "vertex_project": "my-gcp-project",
    "vertex_location": "us-central1",
    "inference_model": "gemini-2.5-flash",
    "embedding_model": "text-embedding-005",
    "embedding_dimensions": 768
  }
}
```

Environment variables: `GOOGLE_ACCESS_TOKEN`, `GOOGLE_CLOUD_PROJECT`, `GOOGLE_CLOUD_LOCATION` are honored when the config fields are unset.

### Full setup — Voyage AI (embeddings only)

Voyage specializes in retrieval-grade embeddings. `voyage-code-3` is tuned for source code and is the recommended default for this project. Voyage has no inference API — keep `features.inference` disabled, or layer Voyage embeddings on top of Anthropic/OpenAI/Ollama for summarization by switching providers per-capability in your own setup.

```jsonc
{
  "ai": {
    "enabled": true,
    "provider": "voyage",
    "api_key": "pa-...",                   // or VOYAGE_API_KEY env
    "embedding_model": "voyage-code-3",
    "embedding_dimensions": 1024,
    "features": { "embedding": true, "inference": false, "fast_inference": false }
  }
}
```

### All options

| Option | Default | Description |
|---|---|---|
| `ai.enabled` | `false` | Enable AI features |
| `ai.provider` | `"onnx"` | `onnx`, `ollama`, `lmstudio`, `openai`, `anthropic`, `gemini`, `vertex`, `voyage`, `mistral`, `groq`, `together`, `deepseek`, `xai` |
| `ai.base_url` | — | Custom API endpoint (providers that honor it) |
| `ai.api_key` | — | API key, or OAuth access token for `vertex`. Env fallbacks: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `GOOGLE_ACCESS_TOKEN`, `VOYAGE_API_KEY`, etc. |
| `ai.vertex_project` | — | Vertex only — GCP project ID (or `GOOGLE_CLOUD_PROJECT` env) |
| `ai.vertex_location` | `us-central1` | Vertex only — GCP region (or `GOOGLE_CLOUD_LOCATION` env) |
| `ai.inference_model` | — | LLM for explanations and reviews (ollama/openai only) |
| `ai.fast_model` | — | Faster LLM for lightweight tasks (ollama/openai only) |
| `ai.embedding_model` | auto per provider | `"Xenova/all-MiniLM-L6-v2"` (onnx), `"qwen3-embedding:0.6b"` (ollama), `"text-embedding-3-small"` (openai) |
| `ai.embedding_dimensions` | auto per provider | `384` (onnx), `768` (ollama), `1536` (openai) |
| `ai.summarize_on_index` | `false` | Auto-summarize symbols after indexing (requires ollama/openai with LLM model) |
| `ai.summarize_batch_size` | `20` | Symbols per summarization batch |
| `ai.summarize_kinds` | `["class", "function", ...]` | Symbol kinds to summarize |
| `ai.summarize_max_tokens` | `100` | Output-token budget per symbol summary — raise (e.g. `1024`) for reasoning models that otherwise return empty summaries (GH#1423) |
| `ai.rerank_max_tokens` | `200` | Output-token budget per rerank call — same reasoning-model caveat; an empty rerank response degrades every semantic search to RRF order while still paying full rerank latency. Scaled up automatically as `max(base, n*6+32)` for large candidate lists (GH#1442) |
| `ai.rerank_max_candidates` | `100` | Max documents sent to the LLM per rerank call — the RRF-fused head is kept, the tail fills back in RRF order so large limits still return full rows (GH#1442) |
| `ai.concurrency` | `1` | Max parallel requests to AI provider (1–32) |
| `ai.reranker_model` | — | Model for search result reranking (ollama/openai only) |

> **When the embedding endpoint is unreachable:** connection-level failures
> (`ECONNREFUSED`/`ENOTFOUND` — e.g. LM Studio or Ollama not running) fail fast
> without retries and log exactly one warn summary per daemon process
> ("Embeddings unavailable — …, search is FTS-only"). The circuit breaker trips
> on the first such failure and then pauses for 10 minutes. Other failures
> (HTTP 5xx, timeouts, mid-run disconnects after successful batches) keep the
> retry + `Embedding batch failed` error path — those are real regressions. The
> pause is stored in the project DB, so it survives a daemon restart instead of
> re-attempting the whole backlog on every start. While it is open,
> `get_index_health` reports `embedding: { enabled, totalSymbols, embedded,
> coveragePct, queued, pausedUntil, lastError }` and adds a warning — semantic
> and hybrid search results are incomplete until the provider is reachable.
> `embed_repo` ignores the pause and retries immediately.
>
> Vector coverage is reported whenever symbols exist — not only while a pause
> is open (TRA-1904). `ai.enabled` defaults to `false`, so a project that
> never configured AI reports `enabled: false, coveragePct: 0` with an
> FTS-only warning instead of an absent block; an undrained backlog with no
> recorded failure is reported as `degraded` with a backfill hint.

> **`ai.enabled` takes effect per project start.** A project already open in the
> daemon keeps the config it was started with, so flipping `ai.enabled` off stops
> embedding for that project only after it restarts.

> **ONNX provider details:** Uses `@huggingface/transformers` (installed as optional dependency). The default model `Xenova/all-MiniLM-L6-v2` is Apache 2.0 licensed, produces 384-dimensional L2-normalized mean-pooled vectors, and weighs ~23 MB. The model is cached locally after first download. You can use any ONNX-compatible model from HuggingFace by setting `embedding_model`.

> **Ollama parallelism:** When setting `concurrency` > 1, you must also configure Ollama to handle parallel requests. The desktop app UI does not expose this setting — use one of these methods:
>
> **Option 1 — Environment variable for the desktop app (macOS):**
> ```bash
> launchctl setenv OLLAMA_NUM_PARALLEL 4
> ```
> Then quit and reopen the Ollama app. The variable persists until logout.
>
> **Option 2 — Run from terminal instead of the desktop app:**
> ```bash
> OLLAMA_NUM_PARALLEL=4 ollama serve
> ```
>
> **Option 3 — Persist via shell profile** (add to `~/.zshrc`):
> ```bash
> export OLLAMA_NUM_PARALLEL=4
> ```
> Then `source ~/.zshrc` and restart Ollama.
>
> Set `OLLAMA_NUM_PARALLEL` to match your `ai.concurrency` value. Higher parallelism uses more VRAM/RAM — start with 2–4 and increase if your hardware allows.

---

## LSP enrichment

trace-mcp can optionally use Language Server Protocol (LSP) servers to enrich call graph edges with **compiler-grade type resolution**. This resolves dynamic dispatch, interface polymorphism, generics, and other cases that tree-sitter AST analysis alone cannot handle.

**Disabled by default** — opt-in via configuration. When enabled, LSP runs as a post-indexing enrichment pass (Pass 3) after the standard tree-sitter indexing completes. If an LSP server is not installed or fails to start, indexing continues normally without LSP edges.

```jsonc
{
  "lsp": {
    "enabled": true,              // default: false — must opt-in
    "auto_detect": true,          // default: true — auto-detect available LSP servers
    "max_concurrent_servers": 2,  // default: 2 — limit parallel LSP processes
    "enrichment_timeout_ms": 120000, // default: 120000 — overall enrichment timeout
    "batch_size": 100,            // default: 100 — symbols per batch
    "servers": {                  // optional: override auto-detected server commands
      "typescript": {
        "command": "npx",
        "args": ["typescript-language-server", "--stdio"],
        "timeout_ms": 30000
      }
    }
  }
}
```

| Option | Default | Description |
|---|---|---|
| `lsp.enabled` | `false` | Enable LSP enrichment pass |
| `lsp.auto_detect` | `true` | Auto-detect available LSP servers based on project files |
| `lsp.max_concurrent_servers` | `2` | Maximum number of LSP servers running simultaneously |
| `lsp.enrichment_timeout_ms` | `120000` | Overall timeout for the entire LSP enrichment pass |
| `lsp.batch_size` | `100` | Number of symbols to process per batch |
| `lsp.servers.<lang>.command` | — | Override the LSP server command for a language |
| `lsp.servers.<lang>.args` | `[]` | Arguments for the LSP server command |
| `lsp.servers.<lang>.timeout_ms` | `30000` | Per-request timeout for this server |
| `lsp.servers.<lang>.initializationOptions` | — | Custom LSP initialization options |

### Auto-detected servers

| Language | Server | Detection |
|---|---|---|
| TypeScript/JavaScript | `typescript-language-server` | `tsconfig.json` or `package.json` exists |
| Python | `pyright-langserver` | `pyproject.toml`, `requirements.txt`, or `setup.py` exists |
| Go | `gopls` | `go.mod` exists |
| Rust | `rust-analyzer` | `Cargo.toml` exists |

Servers are only started if the corresponding language has files in the index AND the server binary is available on PATH.

---

## Tool exposure & agent behavior

The `tools.*` section controls what the MCP server injects into every session — tool set, instruction verbosity, and optional agent behavior rules.

```jsonc
{
  "tools": {
    "preset": "standard",                // "full" | "standard" | "minimal" | "review" | "architecture" | "dev" | "security" | "design" | "perf" | "router"
    "description_verbosity": "full",     // "full" | "minimal" | "none"
    "instructions_verbosity": "full",    // "full" | "minimal" | "none" — controls the tool-routing block
    "client_profile": "auto",            // "auto" | "off" | "claude-code" | "codex" | "cursor" | "vscode" | "generic"
    "agent_behavior": "off",             // "strict" | "minimal" | "off" — see below
    "meta_fields": true,                 // true | false | ["_hints", "_budget_warning", ...]
    "compact_schemas": false             // strip advanced params from tool schemas (saves tokens)
  }
}
```

| Option | Default | Description |
|---|---|---|
| `tools.preset` | `"minimal"` | Tool preset — the number is the upper bound on the tool surface; framework-gated tools only appear when the framework is detected. `minimal` (29 tools, default), `standard` (61 tools — covers >99% of real-world tool calls per session-log mining), `review` (33 tools), `architecture` (42 tools), `dev` (44 tools), `security` (36 tools), `design` (26 tools), `perf` (35 tools), `router` (10 tools — see [The router preset](#the-router-preset)), or `full` (every registered tool, opt-in). A preset is a *deferral*, not a restriction: everything outside it is registered but hidden, and `load_tools` pulls any of it in mid-session. `tools.exclude` remains a hard restriction that `load_tools` cannot undo. |
| `tools.include` | — | Whitelist specific tools by name |
| `tools.exclude` | — | Blacklist specific tools by name |
| `tools.description_verbosity` | `"full"` | Per-tool description length. `minimal` = first sentence. `none` = empty |
| `tools.instructions_verbosity` | `"full"` | Server-level instructions (the tool-routing block). `full` ~2K tokens, `minimal` ~200 |
| `tools.client_profile` | `"auto"` | Tailors the advertised surface to the connected host — see [Client profiles](#client-profiles). `auto` detects it from the `initialize` handshake, a profile name pins it, `off` disables the layer. Env override: `TRACE_MCP_CLIENT_PROFILE` |
| `tools.agent_behavior` | `"off"` | Behavior rules appended to instructions — see [Agent behavior rules](#agent-behavior-rules) |
| `tools.meta_fields` | `true` | Meta fields in responses (`_hints`, `_budget_warning`, etc.). Set `false` or list to narrow |
| `tools.compact_schemas` | `false` | Strip advanced/optional params from tool schemas. Cuts schema size ~42% (measured 2026-08-29) |

### Progressive tool disclosure

A preset used to be permanent: a tool outside it was never registered, so the
session that saved schema tokens also lost the tool for the rest of its life.
That made the small presets a bad trade, and most sessions ran `full` and paid
the whole surface up front.

Since v3.3 a preset is a *deferral*. Tools outside it are registered but
disabled — absent from `tools/list`, so you don't pay their schemas — and the
always-available `load_tools` pulls any of them in mid-session:

```
load_tools()                                  # list what this session deferred
load_tools({ tools: ["taint_analysis"] })     # load one
load_tools({ preset: "architecture" })        # load a preset's worth
load_tools({ preset: "full" })                # load everything deferred
```

Configs written before v3.3 pinned `"preset": "full"` — that was the default at
the time, not a choice, and it kept those installs paying for the whole surface
long after the default moved. Upgrading rewrites that one value to the shipped
default, once and without asking, and records that it did so; set `full` (or any
other preset) yourself afterwards and no later upgrade will touch it. To go back
to the old behaviour, set `"preset": "full"` or run `load_tools({ preset: "full" })`.

Loading emits `notifications/tools/list_changed`, and clients that honour it
(Claude Code among them) re-read the larger surface and can call the new tools
directly. Clients that ignore the notification are not stuck: `load_tools`
returns each loaded tool's full JSON schema in its response, and the loaded tool
is immediately reachable through `batch` — `batch({ calls: [{ tool, args }] })`
— which is in every preset.

`batch` dispatches by name against the whole registry, deferred tools included,
so a deferred tool is callable through it *without* loading it first. That is
deliberate (it is what the `router` preset below is built on), and the price is
one round-trip's worth of schema you never see: you have to know the tool's
arguments, or read them from `load_tools`. `tools.exclude` is not reachable this
way — the exclusion is checked on the inner call names too, on both the local
and the daemon-backed path.

What escalation cannot do is widen `tools.exclude`. Exclusion stays a hard
restriction; `load_tools` reports those names under `blocked` and leaves them
off. If you want a tool gone, exclude it — don't rely on the preset.

A preset name that doesn't resolve — a typo, or a preset added in a version
newer than the one installed — falls back to `minimal` and logs a warning naming
the available presets. Before v3.12 it fell back to `full`, which turned a typo
in a flag set to save tokens into a 36.3k-token surface instead of a 7.8k one.
Failing toward the cheap surface costs at most one `load_tools` round-trip.

Measured `tools/list` cost of each preset on this repo (serialized chars, then
o200k tokens, 2026-09-01; `router` added 2026-09-02): `router` 7.1k / 1.6k,
`design` 21.9k / 5.0k, `perf` 32.3k / 7.5k, `minimal`
34.0k / 7.8k, `review` 37.3k / 8.6k, `security` 41.5k / 9.6k, `architecture`
44.3k / 10.2k, `dev` 54.5k / 12.6k, `standard` 64.6k / 14.9k, `full` 157.7k /
36.3k. Against `full`, that is a 67% cut on the widest role preset (`dev`) and
86% on the narrowest (`design`) — framework-gated tools are excluded, so a
project that detects the matching framework pays more.
`load_tools` itself is 0.9k of that — the price of making the other 123k optional.

### The router preset

`"preset": "router"` advertises **no** code-intelligence tools at all — only the
session meta-tools that are never gated, `load_tools` and `batch` among them. Ten
tools, 1.6k tokens, 95.6% below `full` and 79.2% below the `minimal` default.

It is usable rather than crippled because the two halves cover each other:
`load_tools()` names the ~150 deferred tools (names only — the schemas are what
you are not paying for), and `batch` calls any of them directly. So the session
pays for a catalog instead of a surface, and there is no escalation round-trip
unless you want the schemas.

```jsonc
{ "tools": { "preset": "router" } }      // or: trace-mcp --preset router
```

It is **opt-in and will not become the default.** On a host that already defers
tool schemas itself — Claude Code's ToolSearch, which keeps only the 15
`ALWAYS_LOAD_TOOLS` eagerly loaded — `router` saves ~2.9k tokens and takes away
exactly the first-five-minutes tools that stamp exists to protect. On a host
without such a mechanism it saves ~6.2k per session, every session. Take it if
your client has no tool deferral of its own, or if you are running many short
sessions where the surface is most of what you pay. For what other MCP
servers charge for the same surface, see [how trace-mcp
compares](/comparisons.html).

### Client profiles

The preset decides *how much* capability a session advertises. The client
profile decides what that particular host does not need to be told about.

The connected client names itself in the `initialize` handshake, so trace-mcp
knows whether it is talking to Claude Code, Codex, Cursor, VS Code, or something
it has never seen. Two things follow from that:

- **Tools the host already has are not advertised.** A CLI coding agent arrives
  with its own content search; offering ours alongside it costs schema tokens
  and gives the model two ways to do one thing. Suppression lists are short and
  deliberately conservative — `search_text` and `discover_hermes_sessions` today.
- **The instructions name the host's own tools.** The routing block is written
  for a host it cannot see, so it says "`read`, `content-match`, `glob` mean
  whatever yours are called". Once the handshake identifies the host it says
  `Read`/`Grep`/`Glob` on Claude Code and `shell` (cat/rg/find) with
  `apply_patch` on Codex.

The profile composes *after* the preset — it only removes names from whatever
the preset already advertised — and it never removes capability. A suppressed
tool stays callable by name, `load_tools({ tools: ["search_text"] })` puts it
back on `tools/list`, and `"client_profile": "off"` (or
`TRACE_MCP_CLIENT_PROFILE=off`) disables the layer entirely. An unrecognised
host resolves to `generic`, which suppresses nothing.

Measured on a live `initialize` + `tools/list` round-trip against the built
server, default `minimal` preset (serialized chars, 2026-08-30):

| Client | instructions | `tools/list` | advertised | handshake total |
|---|---|---|---|---|
| `generic` (or `client_profile: "off"`) | 7,669 | 36,523 | 28 | 44,192 |
| `claude-code` | 7,933 | 34,621 | 27 | 42,554 (−3.7%) |
| `codex` | 7,927 | 34,621 | 27 | 42,548 (−3.7%) |
| `cursor` | 7,928 | 34,621 | 27 | 42,549 (−3.7%) |

The instructions grow slightly because the profile appends one line naming what
it hid and how to get it back — without it a suppressed tool is invisible, since
`load_tools()` lists what the *preset* deferred and a suppressed tool is inside
the preset.

Every `tools.*` option works from a project-local config file (`.trace/.config.json`) as well as the global one — none of them are global-only. The tool surface is built once per MCP session, so a change takes effect on the next session (restart the MCP client); the daemon does not need restarting.

### Agent behavior rules

`tools.agent_behavior` appends generic discipline rules (anti-sycophancy, anti-fabrication, goal-driven execution, 2-strike session hygiene, no drive-by refactors) to the server instructions. These are client-agnostic — every MCP-compatible client (Claude Code, Cursor, Codex, Windsurf, …) receives them.

| Value | What ships | When to use |
|---|---|---|
| `"off"` *(default)* | Nothing | Default — you already manage agent behavior elsewhere (CLAUDE.md, [tweakcc](tweakcc.md)), or don't want opinionated rules |
| `"minimal"` | One rule: never fabricate paths/symbols/APIs — call `search`/`get_symbol`/run the command | Minimal nudge tied to trace-mcp tool use, no personality prescription |
| `"strict"` | 8 rules: no flattery, disagree on wrong premises, never fabricate, stop when confused, goal-driven execution, verify before reporting "done", 2-strike rule, surgical changes only | Max-tier default — aligns agent behavior across a team |

**Auto-set by `trace-mcp init`:** picking the **Max** enforcement level writes `"agent_behavior": "strict"` to your global config. Picking Base/Standard writes `"off"`. Re-run `init` to change tiers — the value updates idempotently.

**Why it lives in MCP instructions (not CLAUDE.md or tweakcc):**
- Cross-client — Cursor/Codex/Windsurf users get the same behavior without CC-specific setup.
- Auto-updates on `npm upgrade trace-mcp` — no re-init required to pull new rule wording.
- Single source of truth alongside the tool-routing block.

If you want to override in one project without affecting others, put `"agent_behavior": "off"` (or any other value) in that project's `.trace/.config.json` — per-project config takes precedence over global.

### 4-tier resolution system

Every edge in the call graph carries a `resolution_tier` indicating how it was resolved:

| Tier | Source | Confidence |
|---|---|---|
| `scip_resolved` | Offline SCIP index ingestion (opt-in) | Compiler-grade (highest) |
| `lsp_resolved` | LSP call hierarchy | Compiler-grade |
| `ast_resolved` | Tree-sitter + module resolution | Static AST (default) |
| `ast_inferred` | Heuristic inference from imports | Medium |
| `text_matched` | Name/text similarity matching | Lowest |

The `get_call_graph` tool reports a `resolution_tiers` summary showing the distribution across all edges, so you can see how much of the graph has compiler-grade confidence.

---

## Topology & subprojects

trace-mcp includes a **topology layer** for cross-service analysis and a **subproject layer** for linking dependency graphs across subprojects within a project.

A **subproject** is any working repository that is part of your project's ecosystem: microservices, frontends, backends, shared libraries, CLI tools, etc. Each directory with its own root marker (`package.json`, `composer.json`, `go.mod`, etc.) is a subproject. A project contains one or more subprojects; the project itself is not a subproject. Subprojects can live inside the project directory (e.g. `project/frontend/`) or outside it (added manually via `subproject add`).

Both topology and subprojects are **enabled by default** — every indexed project auto-detects its subprojects.

```jsonc
{
  "topology": {
    "enabled": true,           // default: true — enable topology + subproject tools
    "auto_discover": true,     // default: true — auto-detect and register subprojects on indexing
    "auto_detect": true,       // default: true — auto-detect from Docker Compose
    "repos": [],               // additional repo paths to include in topology
    "contract_globs": []       // explicit contract file patterns (e.g. ["api/openapi.yaml"])
  }
}
```

| Option | Default | Description |
|---|---|---|
| `topology.enabled` | `true` | Enable topology and subproject tools |
| `topology.auto_discover` | `true` | Auto-detect and register subprojects on every index |
| `topology.auto_detect` | `true` | Auto-detect subprojects from Docker Compose / workspace structure |
| `topology.repos` | `[]` | Additional repo paths to include in the topology graph |
| `topology.contract

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.