All projects

Context P&L

A command-line tool and GitHub Action that price each component of an agent's context: quality gained per 1,000 tokens, with confidence intervals and a CI gate.

Status
Design (not built)as of
Claim

No measured result yet.

What will be measured. On two open-source agents: the share of always-loaded context tokens whose marginal value cannot be told apart from zero, and what those tokens cost per 1,000 sessions. Each figure will carry a paired-bootstrap 95% interval, a run date and a pinned model snapshot. If the effects sit inside the intervals, this page will lead with the interval instead.

Run it

Not runnable yet.

How it works

  1. Declare

    List the context as components in a config file: system-prompt sections, SKILL.md bundles, tool schemas, retrieved chunks, memory, few-shot examples.

  2. Ablate

    Run an eval suite with each component left out in turn, plus sampled Shapley.

  3. Attribute

    Give each component its change in quality, cost and latency.

  4. Price

    Price tokens by prefix position, cache hit rate and cache lifetime, using the providers' price pages on a stamped date.

  5. Bound

    Put a paired-bootstrap 95% interval on every figure.

  6. Report

    Write a profit-and-loss table, a JSON file, a README badge and a pull-request comment. The gate flags a pull request that adds a component with no positive value.

Design diagram. Nothing in it is built yet.

Quality comes from programmatic checks, or from a pinned judge whose model family differs from the system under test. Leave-one-out is reported as the baseline beside Shapley. Each ledger row records the model snapshot ID, the temperature and the run date, and no reported number comes from a model alias.

Built on

Prior art

Closest existing tools

Overlap

Attributing value to parts of a prompt is not new: ProCut already does it, and token-aware tooling exists. What this design adds is an interval on every figure, cache-aware pricing, and a pull-request gate.

Every link in this section was opened on 11 November 2026.

Main risk

At an affordable eval budget, most components may be indistinguishable from noise. If that happens, the result is the interval you need before pruning anything, and Shapley drops out of the claim.

Skills this project is designed to show

Context engineering, Evaluation frameworks, Agent skills, Cost optimization.

No public repository yet. It will be linked here when one exists.