One query returns the definition, callers, implementations, tests, and change impact of a symbol—even immediately after the code changes.
Without Codetrip: grep → read → find callers → read → find tests → reconcile
With Codetrip: brief ParseConfig → one complete, bounded context pack
Codetrip turns a repository into a local, typed code graph for Codex, Claude Code, Cursor, and Copilot. Unlike a collection of search results, each response comes from one complete revision: current source and current graph relations are published together, so an agent never has to reconcile new code with stale edges.
- One-query context: definitions, callers, callees, contracts, implementations, related tests, impact, and evidence.
- Fresh after every edit:
--watchatomically refreshes source, symbols, graph relations, and metadata. - Local by default: one binary, no hosted service, no LLM required for indexing, available as MCP, CLI, and Go library.
Download the latest binary for macOS, Linux, or Windows, then run:
cd /path/to/project
codetrip index . --repo project
codetrip brief ParseConfig --repo project --format text
codetrip mcp setup --watchConnect your coding agent · Read the user guide · Review the reproducible benchmarks
brief turns source, callers, callees, contracts, implementations, related
tests, impact counts, confidence, and resolution evidence into one bounded,
deterministic Agent Context Pack.
$ codetrip brief maintenanceServer --repo etcd --format text
maintenanceServer server/etcdserver/api/v3rpc/maintenance.go:71
Type: Struct · go
Contracts
→ IMPLEMENTS MaintenanceServer api/etcdserverpb/rpc.pb.go:7474
→ IMPLEMENTS Downgrader server/etcdserver/api/v3rpc/maintenance.go:55
Incoming
← CALLS NewMaintenanceServer server/etcdserver/api/v3rpc/maintenance.go:87In a controlled 20-task Codex A/B evaluation, starting with brief used
7.0% fewer commands, 5.4% fewer input tokens, and 7.7% fewer output tokens
without observed answer-quality regression. It gives the Agent a precise
starting point; behavioral conclusions can still be verified against source.
Run MCP with --watch and Codetrip follows Agent edits automatically. It
re-analyzes affected files and dependencies, then atomically publishes graph,
symbol, source, vector invalidation, and metadata at one revision. Queries see
a complete old revision or a complete new revision—never a half-updated graph.
Real-repository structural edits—including signature and interface changes, function moves, and new cross-file calls—were refreshed in 1.53 s for runc and 0.33 s for Understand-Anything. Their final graph exports were byte-for-byte identical to clean full indexes. Complex changes can safely expand their analysis scope or fall back to an atomic full rebuild.
Edit code. Save it. Query the latest complete graph.
In a five-run Gin function-rename benchmark, Codetrip's first brief returned
the renamed source and the updated compiler-resolved call edge from the same
revision. It observed zero mixed revisions, zero stale results after
publication, and matched a clean full index in every run.
| Time from save to accurate source + call graph | Codetrip | CodeGraph v1.5.0 | codebase-memory-mcp v0.9.0 |
|---|---|---|---|
| P50 / P95 | 1.169 s / 1.196 s | 0.298 s / 0.389 s | 0.310 s / 0.396 s |
| Product operations needed, P50 | 1 | 4 | 3 |
| Mixed-revision observations across 5 runs | 0 | 17; 13 carried a stale warning | 5 |
| Clean-full equivalence | 5/5 | 5/5 | 5/5 after explicit refresh |
CodeGraph and CBM reached an accurate result sooner in wall-clock time, but their earlier responses combined new on-disk source with old graph relations. Codetrip waited for atomic publication and returned one usable context pack on the first request. In this scenario that means 67%–75% fewer product tool round trips than CBM and CodeGraph, with no Agent-side stale detection, supplemental read, or retry loop.
This is a tool-round-trip result, not a claim of 67%–75% token savings. See the reproducible no-LLM protocol and machine-readable result.
| Typical incremental graph refresh | Codetrip revision-consistent refresh |
|---|---|
| Detects changed files and reparses them | Computes the affected semantic dependency closure |
| Graph and search components may settle independently | Graph, symbol, source, vector invalidation, and metadata publish together |
| Freshness during an update is unspecified | Queries read a complete old revision or wait for the complete new revision |
| Interrupted work may require manual reindexing | Journal recovery and safe atomic full fallback preserve a queryable revision |
Among the major open-source code-graph tools whose public documentation we reviewed, we did not find an equivalent documented multi-index revision and query-freshness guarantee. That is a scoped, verifiable comparison—not a claim that no private or undiscovered system can implement the same design. See the consistency comparison and sources.
flow traces bounded, evidence-backed paths across calls, dispatches,
implementations, overrides, and framework bindings. review maps a Git diff
to changed symbols, reverse impact, related tests, and affected paths.
codetrip flow SendMessageActivity.sendMessage MessageService.sendMessage --repo rocketmq --format compact
codetrip review HEAD~1 --target HEAD --repo rocketmqThe initial flow benchmark covers 12 frozen Java/Kotlin cases in RocketMQ, Exposed, and moko-resources: P25 95.40%, P50 97.59%, and best 99.53% qualified structural-query token reduction with 100% reviewed fact recall and precision and zero wrong paths. It is an initial benchmark, not a Stable language claim. See flow evidence and review contract.
A fast graph is useful. A graph the Agent can trust immediately after an edit is useful enough to change how it works. Codetrip combines typed semantic precision, one-query context, and revision-consistent updates in one local engine.
An initial same-machine comparison used six real repositories, including etcd, Kubernetes and runc. This is directional engineering evidence—not an independent, universal leaderboard:
| What was measured | Codetrip | CodeGraph v1.5.0 | codebase-memory-mcp v0.9.0 | Codetrip Agent-workflow advantage |
|---|---|---|---|---|
| 7 manually reviewed Go/TypeScript semantic fact sets | Exact on all 7 reviewed sets | Strong TS coverage; misses or false edges in several reviewed sets | Fast and broad; less precise relation typing in the sample | More trustworthy typed relations in the reviewed facts |
| Gin rename: operations to accurate live context, P50 | 1 | 4 | 3 | 67%–75% fewer product tool round trips |
| Gin rename: mixed revisions across 5 runs | 0 | 17; 13 carried stale warnings | 5 | No Agent-side stale/retry branch |
| Kubernetes product-level context query, P50 | 52.27 ms with one deterministic brief |
883.85 ms with codegraph_explore |
~26.65 ms for two narrower calls | One bounded context contract |
| Kubernetes add-function-and-call refresh | 13.92 s; one atomic cross-index revision, clean-full-gated | 3.47 s | 22.36 s | Atomic multi-index publication |
| Cold full indexing | Not the current leader | Faster | Fastest in all 6 measured repositories | — |
The output contracts are different, so latency alone is not a quality score. The reviewed facts found Codetrip exact where the other tools sometimes missed cross-file calls, interface implementations, or returned false edges. After a structural Kubernetes edit, Codetrip published a graph with 114,092 nodes and 489,174 edges, zero integrity findings, and the new compiler-resolved call immediately queryable.
Choose Codetrip when your Agent must understand code, edit it, refresh its model, and continue reasoning against one complete revision.
Read the comparison methodology, raw results, limitations, and honest verdict. The benchmark explicitly records where competitors lead; repeat the workloads before treating small differences as significant.
| Goal | Replaces | Codetrip value |
|---|---|---|
| Understand a symbol | grep → read definition → find callers → find implementations → search tests |
brief returns a bounded, evidence-backed context pack in one request. |
| Find source context | guess path → grep → read around every hit |
source combines regex search and context lines. A 20-task A/B test measured 32.8% fewer commands and 29.6% fewer input tokens, with both arms passing 20/20 quality reviews. |
| Assess a change | find references → read callers → repeat → deduplicate |
impact returns confirmed dependents, contracts, entry points, tests, paths, and uncertainty. Reviewed Golden Facts measured 100% precision and 89.9% recall. |
| Review a diff | git diff → map lines to symbols → inspect every dependency |
diff maps hunks to changed symbols and aggregates downstream semantic risk. |
| Trace execution | Repeated cross-file search and source reads | path returns the shortest typed route; traverse performs bounded, relation-filtered BFS with edges and evidence. |
The published no-quality-regression result currently applies to the controlled
brief and source evaluations. impact has a reviewed raw correctness
baseline, but its post-remediation Agent A/B run was invalidated; the remaining
commands have structural value claims rather than unproven end-to-end savings.
See the complete Agent value and command guide for
search, context, rename, check, hybrid, measured claims, and product
comparisons.
Download a dependency-free executable for Linux, macOS, or Windows:
Download Codetrip for your platform →
Or install from source with Go 1.26+ and a C toolchain:
go install github.com/mengshi02/codetrip/cmd/codetrip@latestcd /path/to/project
codetrip index . --repo project
codetrip brief ParseConfig --repo project --format text
codetrip impact ParseConfig --repo project --depth 3 --format tree
codetrip diff HEAD~1 --target HEAD --repo projectJSON is the default output for automation. Ambiguous names return candidates and stable node IDs instead of silently selecting the wrong symbol.
codetrip mcp setup --dry-run
codetrip mcp setup --watchThe setup command detects Codex, Claude Code, Cursor, VS Code/Copilot, and GitHub Copilot CLI while preserving unrelated MCP servers. Restart the client, then ask:
Use Codetrip to explain
ParseConfigand show what a signature change could affect.
Target one client with codetrip mcp setup codex --watch (or claude,
cursor, vscode, or copilot).
- MCP gives coding agents local graph and search tools, plus automatic refresh after edits.
- CLI gives developers and CI deterministic JSON, readable text/tree views, CSV export, and repository management.
- Go library embeds repository-scoped indexing and queries directly into
another tool—without routing through
cmdor an MCP server.
engine, err := codetrip.Open("./.codetrip")
if err != nil {
log.Fatal(err)
}
defer engine.Close()
_, err = engine.IndexRepo(ctx, "/path/to/project",
codetrip.WithRepoName("project"),
codetrip.WithIndexMode(codetrip.IndexModeAuto),
)
brief, err := engine.Brief(ctx, &codetrip.BriefRequest{
Repo: "project", Symbol: "ParseConfig",
})The public API also exposes source and symbol search, context, impact, Git diff analysis, rename planning, structural checks, traversal, shortest paths, vectors, metrics, repository lifecycle, and CSV export.
flowchart LR
R["Repository<br/>source + Git"] --> G["Typed Code Graph<br/>symbols · calls · imports · contracts"]
G --> S["Source & symbol search"]
G --> Q["Graph reasoning & change impact"]
G --> V["Optional vectors & hybrid ranking"]
S --> A["Go library · CLI · MCP"]
Q --> A
V --> A
Each repository has isolated storage. The durable graph is authoritative; search and vector indexes are repository-scoped derived data. Incremental and full builds use recoverable, atomic publication so readers never observe a partially committed revision.
Codetrip parses Go, TypeScript/TSX, JavaScript/JSX, Python, Java, C, C++, C#, Rust, PHP, Swift, and Kotlin. All 12 pass curated semantic fixtures. C++, Go, and TypeScript/TSX have also completed multi-repository precision and source-driven recall reviews and are Stable; other languages retain their published maturity levels.
Cold full indexing has been measured on real repositories including Kubernetes, RocksDB, RocketMQ, FastAPI, and Exposed. See language quality, benchmarks, and the v0.3.0 validation baseline for samples, commits, hardware, and limitations.
- Indexes stay local. External data transfer occurs only if you configure an embedding endpoint or your MCP client sends selected results to its model.
- Dynamic dispatch, reflection, generated code, macros, and runtime loading can reduce static-analysis recall; confidence and fallback candidates stay visible.
- Relationships do not cross repository boundaries yet. Rename creates a plan and never edits source. Codetrip has no Web UI.
- Linux and macOS use the native source-search backend. Windows provides the same query surface through a portable backend and may be slower on large repos.
Read the user guide for every command, MCP schema, embedding setup, CSV validation, storage behavior, and detailed limitations.
- User guide
- Agent value and command guide
- Competitive engineering benchmark
- Semantic quality report
- Real-repository benchmarks
briefAgent A/B evaluationsourceAgent A/B evaluationimpactcorrectness baseline- Changelog · Contributing · Security
make release-gate