Cost & Outcomes

Know what happened.See what helped.

Connect context decisions with recorded usage, cost evidence and task outcomes. See what was delivered, what it consumed and whether the work passed its checks.

Source referenceOperation recordEvidence to inspect

The approach

Measure savings. Check the result.

LeanCTX records context operations and token evidence. Use those measurements alongside tests or review to judge whether a workflow works better.

Inspect

Inspect the delivered input.

Use recorded source references, plans and token measurements to inspect supported operations. Available fields depend on the operation and runtime.

Source
Identify the file, reference or plan behind the operation.
Delivery
Inspect recorded output and available token evidence.
Scope
Receipt fields depend on the operation and runtime surface.

Trace & replay

Follow the evidence back.

Trace a receipt to its source or plan and revisit the state still available. Reproducing a model answer also depends on the host, model and request settings.

Linkage
Connect an operation with its recorded source and plan references.
Availability
Missing source or expired state limits what can be revisited.
Reproduction
A context record alone does not guarantee the same model answer.

Usage & economics

Tokens are evidence. Not the whole bill.

Start with measured usage. Keep estimated model cost separate from observed charges and compare equivalent tasks. The captured example shows input reduction for one read, not a promise about total spending.

Input
Tokens before and after the selected preparation.
Cost basis
Identify estimates, observed charges and unavailable values explicitly.
Quality
A separate result established by task checks.
Recorded product output
src/lib/roi.tssignatures · o200k_base
Source
2,566tokens
Prepared view
439tokens
82.9%

less input for this read
2,127 tokens removed

A signature view omits implementation details. This is an input measurement, not a cost or quality result.

Outcome & feedback

A completed call is not a completed task.

Evaluate against a documented baseline and explicit acceptance criteria. A provider response, a caller-reported success and a verified outcome are different evidence. Use accepted results to inform the next context and routing decision.

Baseline
The same task and a documented input configuration.
Outcome
Tests or review criteria that matter for the actual task.
Comparison
Include failed attempts and retries when comparing cost per accepted task.

In your workflow

From one operation to your workflow.

Use the right inspection surface for each question. A dashboard, a source receipt and an evaluation report reveal different parts of the work.

The local dashboard

Open lean-ctx dashboard to inspect the runtime’s available local activity and metrics. Its visibility follows the operations your integration records.

Explore this capability

Cost attribution

Distinguish model usage, cached input, output and repeated attempts. Preserve the basis of estimated or observed cost; an unknown charge is not zero cost.

Explore this capability

An evidence-based feedback loop

Compare equivalent tasks against a documented baseline, including failures and retries. Feed verified outcomes back into later decisions without turning a caller’s success label into proof.

Explore this capability

Questions & answers

Measurement questions.

Do fewer input tokens mean the same percentage off my bill?

No. Model prices, cached-input rates, output tokens and the number of calls also affect cost. The recorded demo measures the input reduction for one file read.

Does a receipt prove answer quality?

A receipt records an operation. Quality needs its own evidence: tests, source checks or a defined human review. Use both when deciding whether a workflow is effective.

Next: Memory & Continuity

Keep what you learned.

Retain the decisions and source references that are worth carrying forward.

Start with LeanCTX

Measure your own workflow.

Choose a representative task and a baseline. Compare the input, then check the outcome against your own criteria.

Local-first. Model-agnostic. Your context.