Context Performance Infrastructure

Performance starts before inference.

LeanCTX is the Context SDK for AI agents. Control how agents select, compress, reuse and measure context before it reaches the model.

Lower context overhead. Lower cost. Quality measured against the same task.

Open sourceLocal-firstModel-agnostic

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.

uncontrolled context stream● unmanaged
repository.map / 42,118 tokens
search.results / 8,442 tokens
prior.turns / 19,004 tokens
task.signal / 1,210 tokens — the only part that matters

The Mechanism

LeanCTX controls the context path.

Make context operations explicit. Measurable. Versioned.

01 / select

Select

Give the agent what matters. Choose which information should become active context.

02 / compress

Compress

Keep structure. Remove waste. Represent large payloads at the fidelity the task requires.

03 / reuse

Reuse

Stop processing the same information repeatedly. Reuse context already known to the project.

04 / recover

Recover

Keep exact source available when detail is required. Optimization without irreversible loss.

05 / measure

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

Attach

Give an existing coding agent a local context engine with zero-code setup. Proxy or MCP server.

wrap

Wrap

Route tool reads, search and model calls through one measurable context boundary.

embed

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

↓ PASS

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

performance profilev1.4.2
context budget64k
read strategyoutline-first
compressionbalanced
reuseenabled
quality floor0.92
status● approved

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.

agent.py
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.

performance

Cost / Quality / Latency

Every agent task produces a measurable context path with metrics and evidence.

control

Profiles / Budgets / Policy

Deploy versioned performance profiles. Set context budgets across teams.

evidence

Receipts / History / Audit

Every task produces a verifiable receipt. Compare performance over time.

deployment

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

Available

Open-source context engine. Local, fast, model-agnostic.

SDK

Available

Embed context performance into custom agents.

Benchmark

Preview

Compare baseline and treatment on the same workload.

Profiles

Preview

Reuse tested context configurations.

Context Kits

Preview

Reusable context capabilities for specific workflows.

Optimization

Research

Continuous evaluation and promotion of context strategies.

Context Performance Infrastructure

Start where performance starts.

Benchmark your agent