One bounded run of agent interaction, starting empty and accumulating context until cleared or compacted.
A session is one contained run of interaction with an AI agent. It begins empty — no context, no memory of prior sessions — and accumulates messages, tool results, and file content as work progresses. A session ends when it is cleared, closed, or compacted into a fresh session, and all accumulated state is discarded unless explicitly preserved through a handoff artifact or memory file.
The session is what fills the context window. If the context window is the fixed-size box, the session is the material slowly filling it up — each turn adds tokens, tool results, and read files. When the accumulated session becomes too large for the context window, the agent begins losing access to early context and performance degrades.
The tradeoff is between continuity and coherence. A longer session preserves more history and context, but the attention budget becomes diluted and the effective signal per token decreases. Sessions that run too long often exhibit degraded instruction-following on early context. Teams manage this by clearing or compacting sessions proactively rather than pushing through bloat.
Open questions include what the optimal session length is for different task types, how to automatically detect when a session has degraded past the point of usefulness, and whether compaction techniques can reliably preserve necessary context while resetting the context window. Current practice is largely heuristic.