ADocumentation Index
Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
Use this file to discover all available pages before exploring further.
Session is the mutable execution context inside a Workspace. The Arm is shared. A session is the posture the Arm holds for one agent as it runs commands.
In Mirage, a session has two parallel pieces:
- mutable in-memory execution state such as cwd, env, functions, and exit code
- a read-only observer stream at
/.sessions/<utc-yyyy-mm-dd>/<session_id>.jsonlthat records what the session did
What A Session Stores
| Field | Meaning |
|---|---|
session_id | Stable identifier for the session |
cwd | Current working directory |
env | Environment variables |
functions | Shell functions defined in that session |
last_exit_code | Exit status from the previous command |
created_at | Creation timestamp |
Unix Analogy
| Unix shell session | Mirage Session |
|---|---|
| Current directory | Session.cwd |
| Environment vars | Session.env |
| Shell functions | Session.functions |
$? | Session.last_exit_code |
| Open a terminal | ws.create_session() |
| Reattach to a terminal | ws.get_session(id) |
What A Session Does Not Own
A session does not own mounts, cache, or command registrations. It also does not execute commands by itself. TheWorkspace owns the execution machinery. The session just carries the mutable state that execution reads and updates.
Isolation And Sharing
Sessions are isolated by default:- one session can
cd /datawithout changing another session - one session can
export DEBUG=1without leaking that value elsewhere - one session can define shell functions that do not appear in another session
session_id, not permanently bound to one agent identity. If two agents intentionally use the same session id, they share the same cwd, env, and shell state.
Default Session
EveryWorkspace starts with a default session, so single-agent use cases work without any setup:
Lifecycle
Observer Stream
Each session is mirrored into a JSONL file at:- in the filename, such as
/.sessions/2026-04-29/default.jsonl - in each JSONL record under the
sessionfield