§02 · Sessions, Context Windows & Turns

Session

Also called Conversation · Thread

One continuous run with an agent, from an empty context to the moment you clear it, close it, or hand its work off.

A session is a single stretch of work with an agent, held together by one growing transcript. It begins with an empty context window (apart from the system prompt and any project files the harness loads), accumulates every turn you and the agent take, and ends when you clear it, close it, or it gets folded into a fresh one by compaction. Everything inside a session is visible to the model; everything outside it is not.

Sessions have a shape. Early on the agent is sharp, with a small context and clear instructions. As the transcript grows with file reads, test output and half-abandoned plans, the same model gets vaguer and starts contradicting itself. The cheapest fix for many 'it got worse' moments is not a better prompt but a new session with a tight brief.

So plan sessions as units of work. One task per session where you can; a clean handoff between sessions when a task is bigger than one; and a written record of anything the next session must know, because the transcript itself will not follow you. Resuming an old session is handy for picking up exactly where you stopped, but it picks up all of the clutter too.

In the tools
  • Claude Code/clear starts a new session in place; claude --continue and claude --resume reopen earlier ones from disk.
  • CodexEach cloud task runs as its own session in an isolated container; the CLI keeps a local transcript per run.
In conversation

Should I keep this session going for the API work too, or start over?

Start over. You've been in this session for three hours and it's mostly test output now. Write the plan to a file and open a fresh one.

Related terms
Learn it in the school
Words are the easy part

Course 01 puts every one of these terms to work: you install Claude Code, run the loop, and ship a real project — permission modes, compaction, hooks and all.

Start Course 01 →