Me, and the AI thingy.

Building a harness for a coding agent

Context-window hygiene: why a bigger window makes your agent dumber

Sample post. This exists only so you can preview the typography, code blocks, tags, and series navigation. Delete it once the first real article is copied across from the private repo.

Everyone treats the context window as free real estate. Fill it with the whole repo, every doc, the last three conversations. Surely more context means a smarter agent?

It doesn’t. Past a point, more context makes the agent worse: it loses the thread, averages over contradictory instructions, and confidently pattern-matches on the nearest irrelevant thing.

The mechanism

Here’s the shape of the problem in one snippet:

// Don't carry state in the conversation. Infer it from what's on disk.
const done = await glob('artifacts/*.done');
const next = plan.filter((step) => !done.includes(step.id));

State that lives in files can’t rot the way state stuffed into a prompt does.

What to do instead

  1. Keep the working set small on purpose.
  2. Let the filesystem be the memory.
  3. Section your notes so each entry stays minimal.

That’s the whole idea. The rest of this series builds the machinery around it.

Got a reaction, a correction, or a better idea? Reply by email.