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 2 of 6
Old history is weight, not memory
builds on: Why long sessions degrade, Cost and usage limits, Project instruction files: purpose and contents
The agent re-reads the whole conversation on every turn: old logs, failed attempts, rejected ideas. That costs tokens every time and pulls it toward the past. A fresh session starts with only the instruction file and what you give it. Very little of a long history matters for the next step. Usually it comes down to a few facts: the goal, what is done, what failed and why, and what comes next. Carry those over and drop the rest.
Terms on this card
- session
- One continuous conversation with the agent. Everything said and done in it stays in its context until you clear it or start a new one.
- tokens
- Small chunks of text, roughly parts of words, that models read and write. Usage and cost are counted in tokens.
- instruction file
- A project file such as CLAUDE.md or AGENTS.md that the agent reads automatically at the start of every session.
- agent
- An AI tool that doesn't just chat. It reads your project's files, edits them and runs commands to carry out a task you give it.
- history
- Git's record of every earlier version of every file it tracked, kept even after a file is later deleted.
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