A coding agent is a capable junior developer who forgot everything overnight. Sharp on the task in front of it, no memory of the last one. Once I started managing it that way, most of my agent problems turned into management problems I already knew how to handle.
With a human junior, I'd never hand over real work in a one-line Slack message. I'd write down what "done" looks like. With an agent I kept doing exactly that, then acting surprised when it wandered off. The agent was fine. My brief was the problem.
So every spawn now carries the same five sections. Objective: the one thing this run exists to produce. Output path: where the artifact goes, exactly. Write scope: what it may touch and nothing else. Verification: how it proves the work is real before claiming done. Context budget: what to read, what to skip, when to stop. That's the whole contract. It fits on a screen. It exists because the agent starts every task with no memory of the last one, so anything I don't write down, it doesn't know.
Verification is the section I underweighted longest. When a junior says "it's done," that's a claim you still verify, which is why you ask to see the diff. An agent saying "done" is the same claim with more confidence and less shame. So I don't let "done" be a status the agent declares. It's a read I require: show me the file exists, show me the test passed, show me the number.
The other half is matching the task to the harness. Some jobs shouldn't go to a chat subagent at all. Heavy work like dist surgery goes to a supervised executor instead, because I watched two of those blow up in a single day when I sent them to the wrong kind of worker. You wouldn't hand a delicate migration to the junior in their first week either, however sharp they are on small tasks.
The model keeps getting better. The brief is still where the work lives. A strong model with a vague brief gives you a confident junior building the wrong thing very fast. The test I use now: if I couldn't hand this brief to a competent stranger and expect the right output, it isn't ready to hand to an agent.