AID-7Recommended
Keep one task per session
Give each agent session one task, and start a fresh session for the next one.
How to do it
Long sessions fill the context with old files and failed attempts, and quality drops. Clear or restart the session between tasks. Carry over only a short summary or the plan file. When the agent has failed to fix the same thing twice, restart with a better prompt instead of a third correction. Keep what the next session needs in the repository, as Save lessons in the repository instead of chat says.
How to check
Session logs or pull requests each cover one task, with no unrelated changes mixed in.
Sources
Related rules
- AID-45 Save lessons in the repository instead of chat in AI-assisted development
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-assisted-development/working-in-small-steps/one-task-per-session">Agent Wranglers AI-assisted development playbook</a>. In code you write, add a comment next to it with the same link.