---
title: "Session"
url: https://www.daytona.com/definitions/s/session
---

# Session

A session is a long-running shell in a sandbox that keeps state, such as the working directory and the environment, between calls.

A session is a shell process that stays alive inside a sandbox across many commands. The sandbox daemon creates and manages it. The session keeps its own state, such as the current working directory and the environment variables. Each session runs separately, so one sandbox can hold several at once.

Sessions exist because many tasks need state from earlier steps. In a session, a later command continues from the state that an earlier command left. A change of directory or an exported variable stays in effect for later commands. Long-running commands can run in the background while other commands run in the same session.

Sandbox daemons usually offer three forms of process execution. One-shot commands run once and return their output. Sessions keep shell state between calls. Interactive terminals stream input and output in real time. AI agents often use sessions, because they issue commands step by step and expect each step to build on the last.

## Related terms

- [Code interpreter](https://www.daytona.com/definitions/c/code-interpreter.md)
- [ssh](https://www.daytona.com/definitions/s/ssh.md)
