Chapter 7: Context

Subagents as context hygiene

Sending noisy work, such as searching or reading big files, to a subagent, so the reading happens in its window and only a short summary comes back to yours. What you are buying is the clean window, not a specialist.

A search through 30 files shouldn't crowd the agent doing the careful work. But it isn't free: it costs more tokens in total, it may be slower because it starts knowing nothing, and you see only its summary, which can be wrong. Now that windows are big, keep it for work that is truly noisy.

Say it to your agent

“Use a subagent to read src/auth/ and find where sessions expire. Return at most 10 lines: file:line and one sentence each, with no code. Also say what you did not check.”

The workshop

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