CoolFace
Datasetpublic

arsentev-ai/context-ucurve-coding-agents

Context U-curve: 36 coding-agent runs under six context-clearing policies How often should an LLM coding agent's context be cleared? This dataset holds every run behind the report "Clear Every Third Task: A Measured U-Curve in the Context Economy of Coding Agents" (Evgenii Arsentev, 2026; corrected version 1.2, DOI 10.5281/zenodo.22759217; version 1.0: DOI 10.5281/zenodo.22699668). A fixed suite of twelve programming tasks was run under six session-length policies — a fresh… See the full description on the dataset page: https://huggingface.co/datasets/arsentev-ai/context-ucurve-coding-agents.

sourceHugging Facecc-by-4.0updated 6d agoView on Hugging Face
0likes73downloads
Dataset Card

Context U-curve: 36 coding-agent runs under six context-clearing policies

How often should an LLM coding agent's context be cleared? This dataset holds every run behind the report "Clear Every Third Task: A Measured U-Curve in the Context Economy of Coding Agents" (Evgenii Arsentev, 2026; corrected version 1.2, DOI 10.5281/zenodo.22759217; version 1.0: DOI 10.5281/zenodo.22699668).

A fixed suite of twelve programming tasks was run under six session-length policies — a fresh session every 1, 2, 3, 4, 6 and 12 tasks — with six replicates each, holding the model, the tasks and their order constant. 36 runs, and no test failure in any run. 4086 is the total number of tests over the whole experiment, not a per-condition figure; per-condition totals are in the table below. The tests are written by the agent itself as part of each task, so their number varies from run to run (97 to 127).

Correction (15 September 2026)

The modeled_cost_usd column is kept as originally released and reflects incorrect prices: $3.00 and $15.00 per million input and output tokens, cache reads at $0.30 and every cache write at the 5-minute rate of $3.75. The model, claude-sonnet-5, is listed at $2.00 and $10.00, with cache reads at $0.20, and every cache write in these runs is a 1-hour write ($4.00). Corrected per-run costs are in runs_ucurve_costs_v1.2.json in Zenodo record version 1.2 (DOI 10.5281/zenodo.22759217). Token counters, model calls, wall-clock times and test results are unchanged. The summary table below uses the corrected costs.

Summary by policy

tasks per sessionrunsmean modeled cost, USD (corrected)mean cache writesmean cache readstests passed
162.17253k3.62M701/701
261.85170k3.58M697/697
361.62131k3.16M687/687
461.70123k3.47M699/699
661.68106k3.80M661/661
1261.7888k4.45M641/641

Cost is not monotone in session length and is lowest at every third task. Clearing after every task costs 33.5% more (p = 0.0022; 0.011 after Holm adjustment). Never clearing costs 9.7% more in the point estimate, which is not significant (p = 0.046; 0.14 after adjustment). Clearing every three, four or six tasks is indistinguishable. Cache writes fall with longer sessions while context carried per call rises; their product, cache reads, is U-shaped. Full statistics (exact permutation tests) are in the report.

Fields

One row per run. Counters only — no prompts, no model output, no file paths, no project names.

fieldmeaning
run_idhash of the run directory name
taskspersessionpolicy: a fresh session every N tasks (12 = never cleared)
replicatereplicate number 1–6
sessionssessions the run used
model_callsAPI calls made by the agent
inputtokens / outputtokensuncached input and model output tokens
cachewritetokens / cachereadtokensprompt-cache writes and reads
total_tokenssum of the four token counters
modeledcostusdmodeled cost as originally released, at incorrect prices (see Correction)
wallclockswall-clock duration of the run
teststotal / testspassed / tests_failedverification suite result after the run

Tooling

The run-efficiency metric from this study is implemented in contextburn (pip install contextburn, MCP server ai.arsentev/contextburn).

Citation

bibtex
@techreport{arsentev2026ucurve,
  author = {Arsentev, Evgenii},
  title  = {Clear Every Third Task: A Measured U-Curve in the Context Economy of Coding Agents},
  year   = {2026},
  institution = {ARSENTEV.AI},
  note   = {Version 1.2},
  doi    = {10.5281/zenodo.22759217}
}

Author: Evgenii Arsentev · ORCID 0000-0002-9120-7298 · arsentev.ai/research

Mirrors and related records

Kaggle copy of this dataset: https://www.kaggle.com/datasets/arsentevai/context-u-curve-of-coding-agents-36-runs

OSF project with the report PDF and the data: https://osf.io/5qtwy/ (DOI 10.17605/OSF.IO/5QTWY)

Demo of contextburn over these runs: DOI 10.5281/zenodo.22713920, https://www.youtube.com/watch?v=ep7LXFernwQ, https://archive.org/details/contextburn-demo-context-ucurve-2026

Podcast episode about this measurement: https://arsentev.ai/podcast/when-to-clear-agent-context

All reports, datasets and DOIs: https://arsentev.ai/research