On this page
Measure & evaluate
Keep the measurement inspectable.
Local evidence can explain recorded representation changes without promising a business outcome.
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 & versions
- 16-signed-savings-ledger.mddocs/reference/16-signed-savings-ledger.mdGitHub
- ledger_cmd.rsrust/src/cli/ledger_cmd.rsGitHub
- 11-analytics-and-insights.mddocs/reference/11-analytics-and-insights.mdReviewed checkout
- agent_identity.rsrust/src/core/agent_identity.rsReviewed checkout
- mod.rsrust/src/core/savings_ledger/mod.rsReviewed checkout
- 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