Stop babysitting your coding agents: a coordinator + workers pattern
If you run several AI coding sessions at once, one per repo or topic, you probably know the feeling: tab-hopping, re-reading each session's output, losing the thread. The issue usually isn't discipline. It's that nothing
If you run several AI coding sessions at once, one per repo or topic, you probably know the feeling: tab-hopping, re-reading each session's output, losing the thread. The issue usually isn't discipline. It's that nothing coordinates the sessions.
Here is a small pattern that fixes most of it.
1. Talk to one agent, not four
Pick one session as the coordinator. It starts the worker sessions (one per repo or topic) with clear instructions, checks on their state, and gives you one consolidated summary. You read one thing instead of four.
2. Make state live outside the model
A new session doesn't remember the last one. Continuity has to live in files: a state file, a repo with a CLAUDE.md or similar instructions file, a memory store. The first step of every session, coordinator or worker, is: read the saved state. Never assume context that isn't written down.
A minimal state file has three parts:
- Done: what was completed.
- Exact next step: unambiguous, so the next session doesn't have to rediscover anything.
- Blocked: what failed and what was already tried.
3. Checkpoint per unit of work, not per session
Update the state file every time a unit of work finishes, not at the end of the session. If a session dies (quota, network, anything), you lose minutes, not hours.
4. Give stop rules, not "work until you run out"
"Work until the quota runs out" invites an agent to keep "improving" things you never asked for. Try this instead:
Do ONLY the task marked TODAY. Once its definition of done is met and you've verified it once, update the state file and stop. Don't start another task.
For longer tasks, use a triple limit. Stop at whichever comes first:
- The definition of done is met.
- 60 minutes have passed.
- Three failed attempts on the same problem. Mark it BLOCKED and stop, don't keep pushing.
Success is hitting the goal in the fewest steps, not working for the longest time.
5. Match the model to the task
Don't use your most expensive model for everything. Keep it for the hard parts (architecture, tricky debugging) and let a cheaper model handle routine work: repetitive code, file updates, checkpoints. This choice usually saves more than any prompt tweak.
A checklist for your first scheduled worker
- A state file with 1 to 3 tasks for the day, each with a definition of done.
- A daily trigger at a fixed hour (at night, if you don't use the account then).
- A rule: if requirements haven't changed since the last run, do nothing.
- A checkpoint after each finished unit.
- A cheap model by default, the expensive one only when marked as needed.
Nothing here depends on a specific tool. The point is a thin coordination layer, so you stop being the glue between your own agents.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.