Codex token efficiency

Reduce repeated context without losing the evidence.

Capsule is designed for the part of Codex usage we can observe: tool results, file reads, project exploration, web payloads, and repeated context. It keeps a compact view in the conversation and an exact local capsule for recovery.

What is measured

Model-visible payload

Character and local token estimates compare the text shown to the model before and after a policy activates.

Exact recovery

Content hashes and capsule IDs verify that a compact view can recover the original local result.

Monotonic safety

If a compact representation would be larger or less safe, Capsule passes through or falls back to the existing projector.

What is not claimed

Capsule cannot see hidden provider reasoning, provider-side caching, subscription limits, or billing counters. A local reduction is not automatically a billing reduction. Every benchmark therefore states its workload, control arm, recovery invariant, and exclusions.

Where the savings come from

WorkloadTechniqueSafety rule
Terminal outputKeep failures, critical lines, and novel evidence; omit repeated boilerplate.Failed or explicit full output passes through.
Files and projectsReturn task-conditioned ranges, symbols, and dependency impact first.Exact expansion remains available.
Web and toolsKeep structured fields, URLs, and references in a bounded view.Real URLs and recovery IDs are required.
Repeated readsReplay unchanged content from a verified hash.Any content change invalidates replay.

Run your own measurement

npm run verify
npm run benchmark:get-content
npm run benchmark:get-content:history

See the full methodology in BENCHMARK.md and the implementation in the MCP source.