Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codetrip

Build Release Go Version License: MIT Claude Code Codex Cursor Copilot macOS Linux Windows

English | 简体中文

One edit. One query. One consistent graph.

Give your coding agent the map—not another search box. Codetrip waits for one complete revision, then returns current source and current graph relations together. The Agent does not need to detect stale edges, reconcile mixed results, or retry until the index settles.

Without Codetrip: search → read → find callers → read → check tests → reconcile
With Codetrip:    brief ParseConfig → one bounded context pack

Codetrip is a local Hybrid Graph-Augmented Code Intelligence Engine. It turns a repository into a typed, queryable code graph so coding agents can understand symbols, trace dependencies, and reason about changes without reconstructing the architecture through repeated grep and file reads.

What is this symbol?       Who calls or implements it?
What will this edit affect?  Is the Agent querying the latest code?

One native executable provides a CLI, an MCP server for Codex, Claude Code, Cursor and Copilot, and a Go library for embedded use. Graph and lexical indexing are local and require no LLM or external service.

Download a single binary · Connect your coding agent · Read the user guide

v0.3.0 flagship: instant context that stays current

Understand a symbol in one query

brief turns source, callers, callees, contracts, implementations, related tests, impact counts, confidence, and resolution evidence into one bounded, deterministic Agent Context Pack.

One brief call replaces repeated Agent search and source-reading steps

$ 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:87

In 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.

Save code, query the new graph

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.

More than file watching

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.

Why Codetrip for coding agents?

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.

Replace Agent tool loops with one query

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 and run

1. Download a single binary

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@latest

2. Index and query

cd /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 project

JSON is the default output for automation. Ambiguous names return candidates and stable node IDs instead of silently selecting the wrong symbol.

3. Connect your coding agent

codetrip mcp setup --dry-run
codetrip mcp setup --watch

The 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 ParseConfig and show what a signature change could affect.

Target one client with codetrip mcp setup codex --watch (or claude, cursor, vscode, or copilot).

One engine, three integration surfaces

  • 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 cmd or 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.

How it works

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
Loading

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.

Language quality, measured—not implied

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.

Scope and trust

  • 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.

Documentation

Development

make release-gate

License

MIT

About

Hybrid graph-augmented code intelligence engine for AI agents — understand symbols, trace execution, review changes, and keep the graph consistent after every edit.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages