A session is one continuous conversation with an agent, from the first message until you end it or reset. Everything that happens inside it (your instructions, the model's replies, the files it read, the commands it ran) piles up in the same context window and travels along with every request. That accumulating history is what lets the agent remember a decision you made ten turns ago without you repeating it.
The session holds the memory, not the model
The model itself is stateless. It forgets everything the moment a request finishes. The sense of continuity you feel comes entirely from the session replaying the whole conversation back to the model each time. End the session and that history is gone, and the next one starts fresh. This is why "just start a new chat" fixes a confused agent: you are throwing away the accumulated context, not resetting some hidden internal state.
Why session length matters
A session is a mixed blessing:
- Longer sessions carry more shared understanding. The agent has seen your codebase, your preferences, and your earlier corrections.
- Longer sessions also fill the window. Old, finished work crowds out room for the task in front of you and can start to distract the model.
The skill is knowing when a session has earned its keep and when it has turned into noise. Once a conversation has drifted across three unrelated tasks, a fresh session is usually cleaner than steering the cluttered one.
Related terms
Turn
A turn is one round of the agent loop: your input, the model doing its work (possibly several tool calls), and its response. A single turn can span many provider requests.
Read definition →Context
Context is all the text a model can see for a single request: the system prompt, your message, the conversation so far, and any files or tool output the agent has pulled in. It is the only thing the model knows about your specific situation.
Read definition →Context window
The context window is the maximum amount of text, measured in tokens, that a model can consider for a single request. It is a hard ceiling, and it is the main resource you manage when working with an agent.
Read definition →