Skip to main content
A session is one conversation. It survives the process. --continue opens the most recent one and --resume <id> opens a specific one, both with the conversation intact. Sessions are stored in a SQLite database, seri.db, in your profile root. A sessions/ directory of .jsonl files from an older release is imported into it on first use and then only ever read, never written.

Compaction

Past half the model’s context window, seri condenses the older part of the conversation instead of letting the next call fail. The evicted messages become a single recap message with four fields. The summariser is told to quote literal values rather than paraphrase them, because losing an exact filename, string or number is a real failure while a slightly longer summary is not. A cut never splits a tool call from its result. The boundary is only ever placed immediately before a user or assistant message, never before a tool result, because a tool result is always the second half of a pair. Evicting one half while keeping the other is a specific class of provider error, and the boundary rule is what makes it unrepresentable. /compact runs the same thing on demand.

Compacting is not clearing

They are different resets, and the difference matters when you are choosing. /clear starts a new session rather than deleting the old one. Every /clear leaves the previous session’s file on disk with no retention policy, which is accepted rather than a bug. The checkpoint store is a separate matter. It keeps the 20 most recently touched sessions per project, so clearing repeatedly in one long-lived process can eventually retire an earlier session’s undo history even though its conversation file never goes away. See Checkpoints and undo.

The turn budget

--max-turns <n> caps model turns per task, 500 by default, and /max-turns <n> changes it for the rest of the session. Running out is a run that did not finish, so it exits 1. A subagent does not inherit that budget. It gets 25 turns, because three concurrent children on the session’s own cap would multiply tokens without a ceiling.

What is frozen at session start

The system prompt. AGENTS.md, always-on rules, and your memory files are read once and never edited mid-session, which is what lets a provider reuse its cached prefix on every turn. Anything that arrives later arrives as a message in the conversation instead. A rule that fires on a glob works this way, and so does an approved memory write, which enters the prompt the next time you start seri.

Trajectories

seri records each run locally, on by default. A trajectory holds tool calls and their results, checkpoints, denials with their reason, check results, edit outcomes, token usage, retries and how the turn ended. Large values are elided with their original size recorded rather than stored whole. Recordings go into seri.db in your profile root and never leave your machine.
SERI_TRAJECTORY_RETENTION_DAYS only prunes .jsonl recordings left by an older release. Rows in the database are not aged out by it, so recordings there accumulate for as long as recording is on.
The environment wins over what /trajectory stored, so a variable set in your shell keeps winning at the next start. seri says so when you set the toggle against a variable that will override it.