Chapter 7: Context

That was feeding it. Keeping it clean starts with what your own tools print.

Context-efficient output

Also called Context-efficient backpressure

Making your tools print only what an agent can use: one tick when a check passes, and the full output only when it fails. The check still runs in full. Only the reading gets shorter.

A test run that prints 200 lines to say "all good" spends window on nothing, then gets read again each turn. Agents also trim noisy output themselves with head, which keeps only the first lines and can cut off the one failure and force a second full run. Let the exit code decide what gets shown, and not the model.

Say it to your agent

“Write scripts/quiet.sh. It runs a command, saves the output to a temp file, prints one ✓ line on exit 0, and otherwise prints the whole file and exits with the same code. Use it for bun test, bun run typecheck and lint, and put it in AGENTS.md.”

The workshop

Name a word, or describe what you mean in everyday language.