Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
When and how to start a fresh session card 3 of 6

When to restart, and what to carry

builds on: Why long sessions degrade, Cost and usage limits, Project instruction files: purpose and contents
Start fresh when: 1. **New task**: unrelated to the current one. 2. **Polluted**: a wrong idea keeps coming back after you corrected it. 3. **Stuck**: two clear corrections have not helped. 4. **Nearly full**: the context warning appears, or compaction already ran. 5. **Cost rising**: each message uses noticeably more. Before clearing, write a **handoff note** for this task. Put **lasting rules** in the instruction file.
Terms on this card
context
All the text the agent currently holds: your messages, its replies, files it read and command output. It re-reads this on every turn.
compaction
Automatic summarising of an overly long conversation so it fits the context window. It saves space but can drop important details.
instruction file
A project file such as CLAUDE.md or AGENTS.md that the agent reads automatically at the start of every session.
handoff note
A short summary of the goal, what's done, what failed and why, and the next step. You paste it into a fresh session.
Learn this step by step on Bytewise
Lesson goal: Decide when to clear or restart: a new task, a polluted or stuck conversation, nearly full context, or rising cost. Carry over what matters in a short handoff note or the instruction file instead of the whole history. · the whole lesson