Session Management
What survives a close, a restart and a crash in Daintree: the agent resume journal, terminal scrollback serialization, drafts, and warm versus cold project state.
Three things called a session
"Session" means three different things in Daintree, at three different scopes. Most confusion about what comes back after you close something is really confusion about which of the three you were looking at.
| Scope | What it is | What brings it back |
|---|---|---|
| A terminal's agent session | One resumable conversation with one agent, identified by a session id the agent's CLI owns. | The resume journal: a record written every time the terminal closes. |
| A terminal's scrollback | The visible output the terminal had on screen, serialized to a .restore file. | Replay on reopen, marked with a separator banner. |
| A project's renderer state | The live Chromium view behind a project, warm in memory or cold and rebuilt on demand. | The warm view cache, or a cold reload from the saved layout on disk. |
Above all three sits the app's crash-recovery snapshot, which is what a bad exit falls back to. See Crash Recovery for that layer.
What survives what
The whole subject in one table. Process is the agent's OS process, view is the panel and its scrollback, and conversation is whether the agent can pick the thread back up from the resume journal.
| What you do | Process | View | Conversation |
|---|---|---|---|
| Switch worktree | Keeps running | Restored on return | Nothing stopped, so nothing to resume |
| Switch project | Keeps running. Eviction affects the view, not the PTY | Warm views reattach, cold ones rebuild | Nothing stopped, so nothing to resume |
| Free memory, or idle auto-close | Killed | Gone, with a hibernation banner on reopen | Resumable, if a session id was captured |
| Close a panel | Runs for 20 seconds in the trash, then killed | Restorable during those 20 seconds | Resumable once the record is written, at removal or expiry |
| Delete a worktree | Killed, unless you uncheck Close all terminals | On a rescue card, if terminals survived | The record is scoped to a directory that no longer exists, so it cannot relaunch |
| Quit and reopen Daintree | Killed | Layout restored. Scrollback too, under the size limits | Resumable, if a session id was captured |
| System sleep and wake | Keeps running, PTYs pause and resume | Unchanged | Nothing stopped, so nothing to resume |
| Crash | Killed | Layout restored from the crash backup. Scrollback is not | Resumable, if a session id was captured before the crash |
Where the detail lives
- Persistence and Restore for what is written to disk and read back: panel layout, terminal scrollback, drafts, window state, where it is stored, and how to turn it off.
- Resume Agents and History for the agent conversation journal: what writes a record, what a record holds, every place you can resume from, session ids, bookmarks, and retention.
- Project Memory for warm and cold projects, eviction and freeze, reclaiming memory, auto-closing idle projects, and what happens across system sleep.
When the exit was not clean
Everything above assumes a close Daintree saw coming. For one it didn't, the crash-loop guard takes over: three unclean exits inside a 30-minute sliding window boots the app in safe mode and quarantines the panels that look like the cause, which breaks the loop; five stops auto-relaunch entirely. The window decays on its own, so once the most recent unclean exit ages out the next launch comes up normally.
This is where an assigned-at-launch session id earns its keep. The crash path recovers the panel layout from its backup, but not the scrollback, and the conversation is only resumable if the agent's id was known before the crash rather than read off a teardown that never ran. Not every CLI works that way, so what you get back varies by agent. See Crash Recovery for the full picture.