Session
One continuous run of work with the agent, with its own accumulated history.
The span during which an agent accumulates context — a conversation, a coding task, a support thread. A session ends when it is closed, the context is cleared, or the window is full.
Quality tends to peak in the middle of a session and degrade as it fills with stale attempts, dead ends and corrected mistakes. Knowing when to start a fresh session is a real skill.
Sessions have a natural lifespan and it is usually shorter than teams assume. Because quality falls as context fills, ending a session deliberately — with a written handoff onto a fresh one — is a technique, not an admission of failure.
Deliberately ending a session
A refactor has been running for two hours and the agent is repeating itself.
Stop, write down the goal, what changed, what failed and the next step, then start fresh with that brief. A new session with a good handoff outperforms a tired session that remembers everything, including its mistakes.
- blogScaling managed agents: decoupling the brain from the hands ↗
Separates model, harness, durable session log and execution sandbox — the architecture that makes long-running agents survive crashes and tool boundaries.
- blogBuilding agents with the Claude Agent SDK ↗
States the agent loop plainly — gather context, take action, verify work, repeat — and shows subagents and compaction as context-isolation tools.
Turn
One user message and the model’s reply.
Context
Everything the model can currently see.
Clearing · Context reset
Deliberately throwing away the context to get a clean head.
Handoff
Passing work to a fresh context, deliberately and with a written brief.
Compaction · Summarisation
Replacing old context with a shorter summary of it.