---
published: true
id: session
title: Session
description: Knowledge captured in João Lopes' learning graph.
tags:
- ai-engineering
- claude-code
- agent-design
locale: en
resource: https://joaolopes.dev.br/knowledge/concepts/en/session/
created: '2026-03-30'
---

# Session
A single continuous interaction between a user and an AI coding agent, from launch to exit.

## Definition
A session begins when the tool is launched in a directory and ends when the user exits. Within a session, the agent maintains a context window that accumulates messages, tool calls, and results. At session start, Claude Code loads all CLAUDE.md files, tool definitions, and memory as the initial context. Sessions are stateless across restarts — closing and reopening starts fresh with no memory of the previous conversation unless external memory systems persist state.

## Source
- [Session (computer science) - Wikipedia](https://en.wikipedia.org/wiki/Session_(computer_science))
- [Claude Code overview](https://code.claude.com/docs/en/overview)

## Related
- [Context Window](/concepts/en/context-window.md)
- [Turn](/concepts/en/turn.md)
- [SessionStart](/concepts/en/session-start.md)
