The Problem
AI agents spend before they reason.
Every file read, tool response, search result and previous turn can become model input. Unbounded context turns ordinary work into unnecessary tokens, latency and drift.
The Mechanism
LeanCTX controls the context path.
Make context operations explicit. Measurable. Versioned.
Select
Give the agent what matters. Choose which information should become active context.
Compress
Keep structure. Remove waste. Represent large payloads at the fidelity the task requires.
Reuse
Stop processing the same information repeatedly. Reuse context already known to the project.
Recover
Keep exact source available when detail is required. Optimization without irreversible loss.
Measure
Every optimization needs a baseline. Connect context behavior to cost and outcome.
Integration
One engine. Three ways in.
Adopt the context path at the integration depth that fits the agent you already have.
Attach
Give an existing coding agent a local context engine with zero-code setup. Proxy or MCP server.
Wrap
Route tool reads, search and model calls through one measurable context boundary.
Embed
Build context selection and receipts directly into your agent runtime with the native SDK.
Proof Doctrine
Measure. Compare. Verify.
A performance improvement only counts when the workload remains comparable and the declared quality threshold is met.
Baseline
Unmanaged context
$1.00
Reference workload · indexed cost
Treatment
LeanCTX context path
$0.17
Same workload · accepted quality
Verified
Observed reduction
−79–86%
Cost and context overhead · controlled conditions
Controlled five-turn coding-agent workloads · Real API calls · Declared methodology · Quality floor enforced
Technical Thesis
Context shapes performance.
The model can only reason over what the agent sends it. The quality, size and timing of that context affect cost, latency and ultimately task performance.
Performance Profiles
Performance you can version.
A versioned context-performance configuration with documented behavior. Test. Promote. Deploy across agents.
Existing Agents
Your coding agent stays your coding agent.
Keep the workflow you already use. LeanCTX optimizes the context underneath it.
Claude Code
Anthropic's terminal-native coding agent.
Codex
OpenAI's cloud-based coding agent.
Cursor
IDE-integrated AI assistance.
Custom
Your own agent runtime via SDK.
Don't replace your agent. Tune it.
SDK
Build context-efficient agents by default.
LeanCTX gives your agent a structured runtime for context selection, reuse, compression, recovery and measurement.
from leanctx import LeanCTX
ctx = LeanCTX(project=".")
agent = ctx.wrap(my_agent)
result = agent.run(task)
receipt = ctx.receipt()
# receipt.cost_delta → -84.3%Enterprise
Make agent performance an infrastructure capability.
Standardize how AI agents consume context across teams, frameworks and model providers.
Cost / Quality / Latency
Every agent task produces a measurable context path with metrics and evidence.
Profiles / Budgets / Policy
Deploy versioned performance profiles. Set context budgets across teams.
Receipts / History / Audit
Every task produces a verifiable receipt. Compare performance over time.
Local / VPC / On-Prem
Context data never leaves your infrastructure. Deploy where compliance demands.
Trust
The engine stays open.
LeanCTX Runtime is open source. Inspect the code. Run it locally. Verify the claims.
Runtime
AvailableOpen-source context engine. Local, fast, model-agnostic.
SDK
AvailableEmbed context performance into custom agents.
Benchmark
PreviewCompare baseline and treatment on the same workload.
Profiles
PreviewReuse tested context configurations.
Context Kits
PreviewReusable context capabilities for specific workflows.
Optimization
ResearchContinuous evaluation and promotion of context strategies.
Context Performance Infrastructure