Some tasks take hours of agent work or span several sessions: large refactors, migrations, extended research. Long-running agents need extra support.
The Challenges
- Context fills up and must be compacted or reset.
- Progress and decisions can be lost between sessions.
- Errors compound over many steps.
- Costs grow.
Techniques
- Progress files: the agent maintains notes on what's done, what's next and key decisions.
- Version control: frequent commits provide checkpoints and a readable history.
- Structured task lists: track remaining work explicitly.
- Compaction: summarise history while retaining goals, state and open problems.
- Clean handoffs: end each session with a summary that the next session starts from.
Verification Along the Way
Run tests and checks regularly rather than only at the end, so problems are caught early.
Break Up Work
Split large goals into milestones, each independently verifiable.
Oversight
Review progress periodically. Long autonomous runs magnify both productivity and mistakes.