Announcement · KodeGraph · June 2026
KodeGraph makes Kaptain faster at understanding and changing code
Kaptain includes KodeGraph, a model-agnostic code-context layer that helps agents reach the right working set with fewer wasted model tokens. In the clean June 25 comparison, Kaptain + KodeGraph used 78.1% fewer total Codex tokens than Direct Codex while preserving 1.000 gold-file recall.
Why this matters
When an AI assistant works on a real codebase, the expensive part is not one lookup. It is the loop: search, miss, ask again, open more files, then finally get enough context to act. Every extra loop spends tokens, time, and local compute.
Kaptain built KodeGraph into its workflow so models are less likely to token-max while users build real projects. It enriches retrieval before the model reasons, so Kaptain can send fewer wasted tokens and more relevant context into each code workflow.
The primary benchmark now shown here is the clean June 25 comparison: same exact lookup, same 1.000 gold-file recall, lower full Codex token spend with Kaptain + KodeGraph.
Additional KodeGraph runs are used as supporting evidence for retrieval quality and workflow behavior, but the cost claim is anchored to full-session Codex tokens rather than a single isolated payload.
The verdict at a glance
Fewer Codex tokens
June 25 exact lookup: 11,438 total Codex tokens with Kaptain + KodeGraph versus 52,241 for Direct Codex.
Gold-file recall
Both runs reached the gold working set, keeping the comparison focused on cost, speed, and workflow efficiency.
Codex tool calls
Kaptain supplied the needed context up front in the clean benchmark row, versus 2 tool calls for Direct Codex.
Wall time
Kaptain + KodeGraph completed the exact lookup in 5.5 seconds versus 13.1 seconds for Direct Codex.
Retrieval quality
"Quality" here means: when you ask the engine something, does it return the right answer? A score of 1.0 is perfect, so higher is better. KodeGraph is teal; the standard code-graph MCP is slate.
Faster workflows come from better context
This is the question that matters most: if Kaptain is going to help with a codebase, it has to retrieve the right evidence. These tests ask whether the engine can identify callers, estimate change impact, and gather the files needed for a task.
On "who calls this" and change-impact, KodeGraph is ahead in this run. On gathering code for a task, KodeGraph's context and explore paths give the agent a strong working set before the model spends more turns. That is what improves file work: fewer blind searches before the model can read, modify, and verify the relevant code.
Token cost: Kaptain reduces full Codex spend
Tokens are operating cost. They affect user spend, latency, and how far a workflow can scale before it becomes too expensive. The clean June 25 benchmark compares Direct Codex against Kaptain + KodeGraph on the same exact lookup with the same 1.000 gold-file recall.
| Metric | Direct Codex | Kaptain + KodeGraph | Result |
|---|---|---|---|
| Gold-file recall | 1.000 | 1.000 | Same answer quality |
| Total Codex tokens | 52,241 | 11,438 | 78.1% lower |
| Uncached input tokens | 19,444 | 9,377 | 10,067 fewer |
| Output tokens | 413 | 141 | 272 fewer |
| Codex tool calls | 2 | 0 | Kaptain supplied context up front |
| Wall time | 13.1s | 5.5s | Faster completion |
The token data separates payload size from payload value. Kaptain's advantage is workflow-level: fewer avoidable model tokens, fewer tool loops, and a cleaner route to the working set.
The cost advantage in the workflow
Kaptain is local-first, but the bigger user-facing cost is the repeated retrieval loop: every miss can trigger another model turn and another payload. KodeGraph reduces that waste by shaping context around the task before the model starts coding.
Why this makes Kaptain stronger
Beyond the head-to-head metrics, KodeGraph is designed as a model-agnostic context layer. It strengthens Kaptain's own agent workflows and can enrich other connected AI systems with better retrieval context. That gives Kaptain an advantage over generic code-graph tooling where code work actually starts: selecting the right project context before a model spends tokens reasoning over it.
| Capability | KodeGraph | Standard MCP |
|---|---|---|
| Symbol search, callers, callees, impact, explore | ✓ | ✓ |
| Dedicated context tool in MCP surface | ✓ | — |
| Workflow-aware context retrieval | ✓ | — |
| Active-file awareness across a session | ✓ | — |
| Compact responses for small / local models | ✓ | — |
| Broad-folder awareness without runaway deep indexing | ✓ | — |
| 3D project visualization (God's Eye) + REST API | ✓ | CLI only |
| Runs with zero external runtime | in-process | needs Node |
| Model-agnostic context layer | ✓ | — |
| Can enrich other connected AI workflows | ✓ | partial |
What Kaptain users get
KodeGraph matters because it is a native Kaptain capability. That changes the user experience in four practical ways:
- Faster codebase reading. Kaptain can reach the right files sooner, so the agent spends less time wandering through the repository.
- Lower wasted token spend. Better first-pass context means fewer expensive follow-up searches; compact payloads then keep useful context from becoming unnecessary token bulk.
- Model-agnostic leverage. KodeGraph improves the context sent into the workflow before any model reasons over it, making the system more efficient across model choices.
- A stronger Kaptain platform. Code-context intelligence ships as part of Kaptain, so users do not have to assemble separate retrieval tooling to get reliable project context.
Measurement note: June 25, 2026 clean exact-lookup benchmark on the Kaptain codebase. Direct Codex used 52,241 total tokens; Kaptain + KodeGraph used 11,438 total tokens with the same 1.000 gold-file recall.