Test environment

Skip to content
← Token efficiency

03 / 06

Send relevant context, not the whole repo

Choose targeted files, search hits, and short handoffs instead of resending the repository or full chat history by habit, and know when a summary is too lossy.

Step 1 of 4

Default paste is usually the expensive one

Agents often reread src/, lockfiles, old transcripts, and the last failing log in full on every turn. That grows occupancy even when most bytes never affect the edit. Anthropic’s context-window guide is blunt: more context is not automatically better; as token count grows, accuracy can degrade (“context rot”). The same pile also raises billed input.

Before a run, name what the model must see: the brief, the files in the write set, and the exact failing assertion. Everything else is a candidate to leave out until a search or a citation proves it is needed. Do not start by zipping the repo into the prompt.

Sources