/tree, /fork, and /clone, recall earlier project history with history://, and choose where sessions are stored.
Atomic saves every conversation as an append-only tree in a local SQLite database (~/.atomic/workflows/journal.sqlite by default), so you can jump back to any earlier turn without losing prior work.
Worktree snapshots
Save and restore Git checkout state alongside session history.
Resume on any machine
Share PostgreSQL session storage across hosts and rebuild dependencies with
.atomic/blueprint.yaml.Manage context and compaction
Keep long sessions within limits with memory compaction or branch summaries.
Session storage and file format
Switch between local SQLite, JSONL, and PostgreSQL for conversations, or inspect the session file format and SDK session storage.
Use session commands
Start, resume, fork, export, or import sessions from the command line:SESSION_ID: an exact session ID or unique 8-character hexadecimal prefix.CUSTOM_ID: a custom project session ID.EXPORT_FILE: the path to an exported.jsonlsession file.OUT: optional output HTML path. Defaults toatomic-session-<name>.htmlin the current directory, where<name>is the input file’s name without.jsonl.
Resume and delete sessions
Runatomic -c to pick up your most recent conversation in the current folder. A session with messages, a name, or a summary takes priority over a newer empty session. If every saved session is empty, Atomic opens the newest one; if none exist, it starts a new session.
To pick a specific session, run /resume or atomic -r, or pass atomic --session <id|prefix>. If you switch sessions before quitting, the resume command printed on exit points to the session you switched to.
Every session stays bound to its original working directory so tools, @path references, and project settings resolve there:
Key resume rules:
- IDs and 8-hex prefixes:
--sessionand--forkcheck for an exact, case-sensitive ID match first. Otherwise, a case-insensitive 8-character hex prefix (for example019f6a2e) matches UUID-backed sessions (current project first, then all projects), listing collisions if more than one matches. Other hex-and-hyphen fragments (such as 6 or 12 characters) are rejected as malformed. - Custom IDs and flag rules:
--session-id <id>opens an existing project session with that exact ID or creates a new one (printing a notice on stderr). IDs use ASCII letters, digits,.,_, and-, starting and ending with a letter or digit. Combining--forkwith--session-idnames the forked session and fails if that ID already exists. Conflicting session flags exit1. Combining--importwith--no-sessioninspects the export without saving it. - Snapshots on resume: When a session has worktree snapshots,
atomic --session <id>from another directory reopens it directly—reusing a matching local checkout or restoring files into~/.atomic/agent/worktree-snapshots/with a one-line notice. Inspect snapshots with/session snapshot(Inspecting snapshots). - Missing working directory: If the recorded directory no longer exists and Atomic can’t restore it from a snapshot, open the session from the directory you want to use. In interactive mode, choose Continue (use the current folder without changing the saved path), Fork (start a separate session here), or Cancel. Non-interactive runs (
-p, RPC) and SDK calls report a missing-directory error instead of prompting. - Fast resume: Compacted sessions open from the latest compaction boundary instead of loading full history upfront. Commands that inspect older turns (
/tree,/fork,/clone,/export,/share, and/session) page older history on demand. SetATOMIC_REDUCED_MOTION=1for a static loading indicator. - Draft preservation: Text typed before a startup picker or prompt appears waits as a draft and never auto-confirms pickers or
Fork this session? [y/N]. - Tool restoration: Resuming restores the session’s saved tool selection plus newly available extension tools. Tools you disabled between turns stay off (including MCP tools whose server connects later),
--tools +name,-nameadjusts the restored set, and uninstalled tools appear under Missing in/tools.
Resume interrupted work
When you reopen an interactive session (--session, -c, -r, or /resume) after an unexpected exit or switch, Atomic renders the transcript first and visibly recovers pending work:
- Running background subagents relaunch and reconnect to Intercom. Paused, quit, completed, and failed children stay as they were, and forked sessions never relaunch original children (see Run control).
- Undelivered user or peer messages replay in a turn (
Replaying N interrupted deliveries). Messages from gone peers post one notice without starting a turn, and messages that can’t deliver yet wait until the next resume. - Unseen background task results render as cards without starting a turn, followed by a recovery summary line.
- Non-interactive runs (
atomic -p) leave interrupted work pending until the next interactive resume.
Show your own loading indicator
When opening, switching, forking, importing, or reloading a session, Atomic emits loading updates on its event streams: onesession_load_started, zero or more session_load_progress updates, and one terminal session_load_finished or session_load_failed. Use loadId to distinguish overlapping loads, target to see what is loading, and render message as-is. When historyEntries is present, it is the number of saved entries Atomic plans to read, not how many it has already read.
TypeScript SDK: runtime.subscribe() follows the active session across swaps and emits initial open updates. To observe an initial open live—including failures before a session exists—subscribe with subscribeToSessionLoads(listener) before creating the runtime. On an existing session, session.subscribe() also receives reload events:
id, its load events carry that same id, followed by the normal command response:
atomic --mode json --session my-task emits the same events (without an id) before the session header. Read one JSON line at a time and check type instead of assuming the header is line 1.
Clear your indicator on either terminal event (session_load_finished or session_load_failed), or when the connection closes unexpectedly. cancelled: true means the load stopped without opening its target; session_load_failed includes a reason while the SDK, RPC, and CLI still report their normal errors.
Search and manage sessions in the picker
Each row in the Resume picker shows the session name or opening message, age, message count, folder (in all-folders scope), and summary. Filter sessions using three query modes:- Word tokens (default): Space-separated words match with logical AND (case-insensitive). Each word checks for a substring match across name, title, ID, detail, summary, message text, and folder, falling back to fuzzy matching on metadata fields only.
- Exact phrases: Wrap words in double quotes (
"auth token refresh") for case-insensitive phrase matching with normalized whitespace. An unclosed quote falls back to word tokens. - Regular expressions: Prefix a query with
re:(for examplere:error\s+50[23]) for case-insensitive JavaScript regex matching. An invalid regex returns no matches.
Ctrl+S to cycle sort modes: Threaded (default; groups forks under their parent by recent activity), Recent (flat list by modification time), and Relevance (name matches, then text matches, then fuzzy matches).
The following keys control the session picker:
Automatic session summaries
After the agent goes idle, Atomic generates a one-line summary using the active model for saved interactive and RPC sessions (skipping--no-session, -p, JSON mode, internal sessions, and sessions with fewer than 4 entries on the active branch).
Summaries read up to 4,000 tokens of recent conversation, cap the saved line at 160 characters (truncated with …), count toward session usage, cancel on new input or exit, and retire after a later branch summary. If the account is out of quota or hits the retry limit, Atomic skips that summary while keeping the session resumable. To disable summaries, set "sessionSummary": { "enabled": false } in settings.json.
Internal and subagent sessions
Sessions marked internal stay hidden from/resume, atomic -r, -c, and history://sessions, while remaining openable by exact session ID. Every subagent session is internal (whether fresh or forked) and lives in the same session store as its parent session regardless of working directory or worktree:
history://sessions/<id>reads a subagent’s session from any session sharing that store, including after resuming on another machine. Add?project=<dir>if the subagent ran in another folder./tasksandsubagent({ action: "status" })read transcripts from the parent session’s store.- If an 8-hex prefix matches both a regular session and internal sessions,
--sessionand--forkchoose the regular session.
Name sessions
Set a display name inside Atomic with/name <name>, view the current name with bare /name, or pass --name (-n) from the shell:
Ctrl+R on that session in /resume and submit an empty value.
Branch with /tree
Every entry in a session links to its parent, forming a tree. Run /tree to jump back to any earlier turn and try another approach without erasing the original path:
/tree to filter entries with the inline search bar:
Selecting an entry in
/tree behaves as follows:
- Selecting a user or extension message: Moves your active position to its parent and loads its text into the editor so you can edit and branch. Selecting the first user message resets to an empty conversation with that prompt loaded.
- Selecting an assistant, tool, or compaction entry: Moves your active position to that entry with an empty editor so you can continue from there.
- Navigation saves immediately, so quitting and resuming keeps your chosen branch. Pressing
Escduring branch-summary generation cancels it and reopens/tree.
Compare /tree, /fork, and /clone
The following table compares Atomic’s three branching commands:
/fork and /clone start a new session from the active path, including its worktree snapshots. atomic --fork <id|prefix> and choosing Fork on a missing directory copy every branch in the same store. Forking across different stores carries only the current context window; to copy every branch between stores, use atomic storage export and atomic storage import.
Shared-history forks
In SQLite and PostgreSQL stores, a fork shares prior history with the original session instead of duplicating every row, so forking a long session is as fast as forking a short one. The fork still behaves like an independent copy: later edits or deleting the original never affect the fork, and exports always write complete copies. JSONL and in-memory stores always copy. See Shared-history forks.Summarize abandoned branches
When/tree leaves a branch, Atomic can optionally summarize the abandoned branch (no summary, default summary, or custom focus instructions). Set "branchSummary": { "skipPrompt": true } in settings.json to skip the prompt and default to no summary. See Summarize branches.
Recall earlier work
From any session or subagent, Atomic can read and search past project sessions through read-onlyhistory:// URLs across SQLite, PostgreSQL, JSONL, memory, and custom stores:
Key
history:// rules:
- Project isolation: Reading or searching a session from another project fails with a project-isolation error unless
?project=<dir>or?project=allis passed explicitly. - What is searched: History search scans the newest 25 sessions per page, skips the current session unless you target
history://sessions/<id>directly, and caps output at 10 matches per session. It omits non-conversation metadata (thinking blocks, model changes, usage records, labels, context edits, internal extension state, and worktree snapshots). After compaction, the boundary message prints the exact session URL and range to recover earlier details (Use memory compaction). - Clean terminal text: Reads and searches strip terminal color and escape codes from tool output automatically without modifying saved sessions, while leaving user and assistant text unchanged.
- Output caps and continuations: Every
history://call caps output at 40,000 bytes and scans at most 250,000 entries, stopping with acontinue withURL when either limit is reached (multi-session list continuations expire after 60 seconds). Multi-line regex patterns match across up to 16,384 characters or 256 entries. - Offline SQLite search: Run a read-only regex search against a local SQLite session file from your shell without taking writer locks:
atomic storage search-session <sqlite-file> <session-id> <pattern> [cursor]. See CLI reference.
Slow history searches
When ahistory:// read or search runs longer than 10 seconds (for example against a large or remote PostgreSQL database), Atomic moves it to the background automatically, shows a live status line such as Search(history-3) · continues in background, and delivers a completion notice when finished:
- No time limit: Background history tasks run until they finish, hit the 40,000-byte output cap or 250,000-entry scan cap (returning a
continue withURL), are stopped withkill, or the session closes or reloads. - Separate concurrency pool: A session runs up to 4 active history tasks at once (separate from the 64 background shell commands) and retains the 16 most recently finished history results for late waits.
wait options and kill({ id }), see Background history searches and Background tasks reference.
Session storage
Atomic saves sessions automatically in~/.atomic/workflows/journal.sqlite by default. See Session storage to switch session storage options, share PostgreSQL across machines, or migrate sessions between stores, and see Worktree snapshots for repository snapshots.
Keep these session storage behaviors in mind:
- Sessions from older releases: With the default SQLite store, legacy JSONL sessions in
~/.atomic/agent/sessionsstill appear in/resumeand--continue. Opening one imports a copy into SQLite and leaves the original file untouched. - Project settings: Project session storage settings apply after you trust the project. New sessions use the project store, while resumed sessions remain in their original store.
- Importing exports:
--import <file>or/import <path.jsonl>imports a JSONL export, upgrades older formats automatically, and refuses duplicate session IDs. - Temporary runs (
--no-session): Nothing is written to a resumable store. If Atomic releases an idle subagent from memory during a--no-sessionrun, its history stays in a temporary file deleted on exit.
Choose a store
Setsessions.storage for session storage only, or top-level storage for session storage and Intercom together, in settings.json:
A higher-precedence selection replaces any lower one as a whole object without merging fields (see Which selection wins). Relative paths in settings resolve against the storage home, whereas relative paths in
--session-dir, --session-store, and ATOMIC_CODING_AGENT_SESSION_DIR resolve against your current directory.
Session storage flags follow these rules:
--session-storecan’t be combined with--session-diror--no-session, andATOMIC_CODING_AGENT_SESSION_DIRcan’t be combined withATOMIC_SESSIONS_STORAGE,--storage, or--storage-file.--session-prefixapplies only with--session-storeon a local SQLite file (matching[A-Za-z_][A-Za-z0-9_]*, never starting withsqlite_). For PostgreSQL, use a lowercase prefix up to 24 characters instorage.prefixoratomic storage join --prefix.- Invalid storage configuration or unreachable stores always fail with an error rather than falling back to memory.
Troubleshoot sessions
Check these fixes if opening, resuming, or reading a session fails:- Session is already open (
exit 75): Another live Atomic process holds that session. Close the other window, wait for it to exit, or branch from it withatomic --fork <id|prefix>. - Ambiguous 8-hex prefix: Pass the full session ID shown in the collision list.
- Project-isolation error when reading
history://: The target session belongs to another folder. Pass?project=<dir>or?project=allexplicitly if you want to read across projects. - Missing directory when resuming: Change into the directory where you want to work and run
atomic --session <id|prefix>, then pick Continue or Fork at the prompt.
Next steps
- For programmatic store selection,
SessionStoreimplementations, and store-closing rules in Node.js and TypeScript, see SDK session storage. - For JSONL schemas, entry types, and
SessionManagermethods, see Session file format. - For capturing and restoring repository state with sessions, see Worktree snapshots.