Skip to content
Documentation

Measure & evaluate

Keep the measurement inspectable.

Local evidence can explain recorded representation changes without promising a business outcome.

AvailableReviewed September 2026

Know which ledger you mean

The context ledger tracks retained context pressure and supports eviction/pruning. The savings evidence records representation changes and associated measurement information.

They are related to different questions. Removing a context entry is not an accounting adjustment to a provider bill.

Inspect the local report

lean-ctx savings --format json

Read the fields and measurement scope in your installed runtime. A recorded token estimate is not a measured provider charge.

Each entry names the agent that produced it. In releases after 3.11.4 an MCP server serving one client records <client>:<bus agent id> (for example claude-code:mcp-1274-…), hook and CLI processes record their host (claude, codex, cursor), and LEAN_CTX_AGENT_ID overrides both. Earlier entries carry local. Corrections — a full re-read that cancels a compressed read’s savings — are booked only when no edit of the file follows; see token measurements.

Each entry also names the model its value was priced for. In releases after 3.11.4 that is the model the agent actually runs: LEAN_CTX_MODEL first, then [cost.models] for the client or [cost] default_model, then Codex’s own configured model (Codex does not pass through the proxy), then the model the LeanCTX proxy measured most. The price comes from the price list the proxy keeps on disk, otherwise from the built-in table; when only a related model’s price is known, the entry still names the real model. Up to 3.11.4, entries from LeanCTX tools carried the price table’s key instead (any current Opus read as claude-opus-4.5, priced as such); the cockpit shows those as “not recorded”.

Verify what can be verified

Integrity checks establish properties of the retained evidence, such as consistency or tamper detection under the relevant format. They do not establish that a baseline was fair, that no context was missed or that a task succeeded.

Keep the original source and evaluation conditions alongside any report you intend to share.

Compare complete tasks

Include all relevant reads, recovery calls, retries and provider usage. Declare the tokenizer and any pricing model. Do not add read-side and request-side reductions without checking for overlap.

Use observability for an evidence workflow and token measurements for interpreting the numbers.

Sources & versions5 references Reviewed
Core checkout
0ce2207ee4
Reviewed runtime
3.10.2
SDK release
1.1.0

Separate baselines for source, CLI/configuration and SDK contracts. Review does not certify every platform or integration.

Versions & compatibility