Sessions
A session is a saved conversation. Raw stores the history and the context that the model uses. The terminal, the dashboard and ACP clients all read and write the same sessions, so you can start a task in one and continue it in another.
Resume a session
Section titled “Resume a session”| Command | Result |
|---|---|
raw --continue "task" |
Resumes the most recent unexpired session for the current workspace. |
raw --resume ID "task" |
Resumes one session in the working directory it was saved with, and prints that directory. |
raw sessions |
Lists sessions in the current workspace, with a cursor for the next page. |
raw sessions --all |
Lists sessions across all workspaces. |
raw sessions show ID |
Prints the newest 20 visible items of a session, formatted with your current display settings. |
raw sessions show ID --before CURSOR |
Prints an older page. |
raw sessions panels ID [PANEL] |
Prints the latest state of the session’s side panels, such as Todo and Files changed. --all includes closed panels, and --json prints JSON. |
Running a task with --continue or --resume loads the current agent, tools, skills, MCP servers, limits and prompt from your config. The session keeps its ID and its committed history.
When a session is resumed with --config or --agent, the explicit value replaces the saved one for that run, and Raw saves the new selection for the next resume. A session whose saved working directory has been removed, or whose selected config file is missing, reports an error. Pass an explicit --config to recover a session whose original config file no longer exists.
With a task, stdout contains only the new answer. Viewing a session with raw sessions show needs no model credential and starts no tools.
Start a new session
Section titled “Start a new session”Each one-shot task starts a new session unless you pass --continue or --resume. In the REPL, /clear closes the current session and starts a new saved one. The old history remains available.
Delete a session
Section titled “Delete a session”raw sessions delete IDThis permanently removes one session that is not currently active. Raw does not export or archive it first. To see storage use, run raw sessions stats. It reports the database, write-ahead log and payload sizes, plus the largest sessions.
Where sessions are stored
Section titled “Where sessions are stored”Sessions are stored in a database that is private to your operating system account:
$XDG_STATE_HOME/raw/sessions.sqlite, or~/.local/state/raw/sessions.sqlitewhenXDG_STATE_HOMEis not set.
Large payloads, such as big tool outputs, are kept as checksum-verified files beside the database in the same state directory.
If Raw finds an older database format that it cannot read, it leaves that file untouched. New sessions are stored in a separate database under raw/stores/, inside the same state root. Raw does not migrate old sessions automatically. A session that exists only in the preserved file is unavailable until that file is handled separately.
Retention
Section titled “Retention”By default, a session expires 30 days after its last committed conversation activity. Reading history, listing sessions and viewing metrics do not extend the period.
To change the period, set sessions.retention_days to a positive integer in the canonical global config file, ~/.config/raw/config.json (or $XDG_CONFIG_HOME/raw/config.json). In the dashboard, the same setting is under Settings → Sessions & storage:
{ "sessions": { "retention_days": 14 }}An alternate file passed with --config cannot set this value. The retention policy applies to the shared session store, so Raw rejects a sessions block in an alternate config.
When a session expires:
- It becomes unavailable immediately.
- Raw permanently deletes its history, its active model context and its payload files during routine cleanup.
Cleanup runs after session commands, and a long-running ACP server checks while idle. A session that a running Raw process still owns, such as a dashboard or ACP host with live work, is kept until that process releases it, even after the cutoff.
Sessions and the dashboard
Section titled “Sessions and the dashboard”The dashboard creates and resumes the same sessions as the terminal. Closing a browser tab does not stop a run. If a session is busy in another process, the dashboard can still read it. It becomes runnable there after that process releases the session.
Messages sent while a turn runs
Section titled “Messages sent while a turn runs”In the dashboard, a message sent while a turn runs in the session waits in the session’s queue. A message sent to an idle session starts a turn as usual. The queue holds at most 20 messages that are waiting, being delivered, paused or blocked.
- Delivery. A running turn takes waiting messages at its next model request: after the turn’s own message, after all tool results of a step, and after the notice that continues a cut answer. Each message is delivered oldest first, as its own user message. A pending approval or question is not answered by the queue. The message waits until that step ends.
- Hooks. Each message goes through the
UserPromptSubmithook. A message the hook refuses is marked blocked, with the hook’s reason, and is not delivered. - Once. A message is delivered at most once. If you Stop while a message is being delivered, it goes back to the queue. The history records a delivered message with the turn that took it.
- Next turn. When a turn completes with messages left, the oldest one starts the next turn, and the rest are delivered at that turn’s first delivery point. Stop, an error, or reaching the step limit pauses every waiting message, and nothing starts until you send again. After a restart, messages of an interrupted turn are paused.
- Interrupt. A message sent with Interrupt and send stops the running turn the way Stop does, then starts the next turn with that message. Completed tool results are kept. A partial answer is dropped, and a pending approval or question is cancelled.
- Receipts. Once a message is delivered, started as a turn or deleted, only its receipt stays. Its text and attachments are released, because the model context keeps its own copy.
The dashboard controls for these messages are described in Dashboard.
- Use
raw --continuefor a quick follow-up in the same project. - Use
raw sessionsto find an older session by its ID. Copy the ID from the footer or the dashboard’s resume command. - Keep a session’s workspace and config stable. A change to the agent, model or tools applies on the next resume, while the history stays the same.