Skip to main content
Atomic saves every conversation as an append-only tree in a local SQLite database (~/.atomic/workflows/journal.sqlite by default). You can resume past work, jump back to earlier turns, and branch without losing history.

Worktree snapshots

Automatically save and restore Git checkout state alongside session history.

Resume on any machine

Share PostgreSQL storage and rebuild dependencies with environment blueprints.

Compaction and branch summaries

Clear or compact long context windows with memory compaction or summarize branches with branch summaries.

Storage and file format

Choose local SQLite, JSONL, or PostgreSQL, or inspect the session file format and SDK storage.

Session commands

Start, resume, fork, export, or import sessions from the command line:
Atomic fixes broken history links and duplicate entry IDs automatically and tells you what it changed. An entry whose earlier link is broken is placed after the entry recorded just before it. If it is the first entry, it starts a branch. Import gives each repeated entry after the first a new ID, so later messages still follow the right entry. Atomic does not edit a separate source file. If a matching session in storage is already damaged, importing repairs that copy too. Opening a damaged session without importing it shows a warning and leaves the saved history unchanged. Inside an interactive session, use these slash commands (see Slash commands for the complete list):

Resuming and deleting sessions

Run atomic -c to pick up your most recent conversation in the current directory. A session with messages, a name, or a summary takes precedence over a newer empty session. If all saved sessions are empty, Atomic opens the newest one; if there are none, it starts a new session. To open a specific session, run /resume or atomic -r to open the Resume picker, or use atomic --session <id> with an exact ID or unique 8-hex UUID prefix. If you switch sessions before quitting, the resume command Atomic prints points to the session you switched to. Every session binds to its original working directory so tools, @path references, and project settings resolve there:
  • Session IDs and prefix matching. --session and --fork check for an exact, case-sensitive session ID match first. If none matches, an 8-character hexadecimal prefix (case-insensitive, such as 019f6a2e) matches UUID-backed sessions only, never custom non-UUID IDs. Atomic checks the current project first, then all projects, and lists matching sessions on a collision. Any other hex-and-hyphen fragment (such as 6 or 12 characters, or 019f6a2e-1234) is rejected as malformed.
  • Custom IDs and flag conflicts. --session-id <id> opens an existing project-local session with that exact ID in the current directory, or creates a new one (printing a notice on stderr) if none exists. IDs use ASCII letters, digits, ., _, and -, starting and ending with a letter or digit. Combining --fork with --session-id <id> names the new forked session and fails if that ID already exists. --fork cannot be combined with --session, --continue, --resume, or --no-session; --session-id cannot be combined with --session, --continue, or --resume; --import cannot be combined with --session, --fork, --session-id, --continue, or --resume (combining --import with --no-session inspects the file without saving it). Conflicting flags exit with code 1.
  • Snapshots on resume. When a session recorded 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 is gone and Atomic cannot restore a checkout from a snapshot, start atomic --session <id> from the directory you want to use, or select the session with /resume. At the interactive prompt, choose Continue to use the current directory without changing the saved path, Fork to create a separate session in the current directory, or Cancel to leave the session alone. Non-interactive modes (-p, RPC) and programmatic session switches report a missing-directory error rather than prompting.
  • Fast resume. Compacted sessions open from the latest compaction boundary instead of loading the entire history upfront. Commands that inspect earlier entries (/tree, /fork, /clone, /export, /share, and /session) page older history on demand. /session shows totals immediately and fills in per-model cost and cache stats once that scan finishes. When opening a session takes a little longer, Atomic shows what’s loading; set ATOMIC_REDUCED_MOTION=1 for a still indicator.
  • Draft preservation. Text typed before a startup picker or prompt appears waits as a draft without confirming pickers or Fork this session? [y/N].
  • Tool restoration. Plain resume restores the session’s recorded tool selection along with newly available extension tools. Tools you turned off between turns stay off, including ones that register after the session starts, such as MCP tools whose server connects later (a tool turned off before any turn declared it comes back); --tools +name,-name adjusts the restored set, and previously used tools that are no longer installed appear under Missing in /tools.

Interrupted work on resume

When you reopen an interactive session (--session, -c, -r, or /resume) after an abrupt exit or session switch, the transcript renders first and recovery runs visibly:
  • 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. Messages that cannot 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

Atomic always sends loading updates on its event streams when it opens, switches, forks, imports, or reloads a session. Subscribe once and ignore what you don’t need. Each load sends one session_load_started, any available session_load_progress updates, and one final session_load_finished or session_load_failed. Use loadId to keep overlapping loads apart and target to see which session or path is being loaded. Show a progress message as-is. When historyEntries is present, it’s how many saved entries Atomic plans to read, not how many it has already read. TypeScript SDK. runtime.subscribe() follows the active session across swaps. It also sends the initial open updates when you subscribe. To see an initial open live, including one that fails before a session exists, subscribe with subscribeToSessionLoads(listener) before creating it instead. If you already have a session and only need its own events, session.subscribe() also sees its reload.
RPC. Listen on the usual event stream. When a command has an id, its load updates carry that same id, and its usual response still follows:
CLI scripts. atomic --mode json --session my-task sends the same updates, without an id, before the session header. Read one JSON line at a time and look at its type instead of expecting the header on the first line. Clear your indicator on either final event. cancelled: true means the load stopped without opening its target. session_load_failed includes a message explaining why, such as a missing session; the SDK still rejects, RPC returns its usual error response, and the CLI still reports an error and exits as before. If the process stops unexpectedly, clear the indicator when the connection closes.

Session picker search and shortcuts

Each row in the Resume picker shows the session name or first message, age, message count, folder (in all-folders scope), and summary. Type to filter sessions using three query modes:
  • Word tokens (default). Space-separated words match with logical AND (case-insensitive). Each word checks for a literal substring match across name, title, ID, detail, summary, message text, and folder, falling back to fuzzy matching across metadata fields only (never message bodies or IDs).
  • 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: (such as re:error\s+50[23]) for case-insensitive JavaScript regex matching. An invalid regex returns no matches.
Press 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).

Session summaries

Once the agent goes idle, Atomic generates a one-line summary using the session’s active model. Summaries run for saved interactive and RPC sessions and skip --no-session, -p, JSON mode, internal sessions, and sessions with fewer than 4 entries on the active branch. Summary generation feeds up to 4,000 tokens of recent conversation, caps the stored line at 160 characters (truncated with …), counts toward session usage, cancels on new input or exit, and retires on a later branch summary. If the account is out of quota or the server asks for a wait longer than the retry limit, Atomic skips that summary. The session remains available in the picker. To turn off summaries, set "sessionSummary": { "enabled": false }.

Internal and subagent sessions

Sessions marked internal are hidden from /resume, atomic -r, -c, and history://sessions, while remaining openable by exact session ID. Every subagent’s own session is internal—whether fresh or forked (context: "fork"). A subagent’s session always lives in the same session store as the session that launched it, regardless of the subagent’s 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 directory.
  • /tasks and subagent({ action: "status" }) read transcripts from the launching session’s store.
  • When an 8-character ID prefix passed to --session or --fork matches both a regular session and internal sessions, Atomic selects the regular session.

Naming sessions

Set a display name interactively with /name <name>, inspect the current name with bare /name, or set one at startup with --name / -n:
To clear a display name interactively, press Ctrl+R on the session in /resume and submit an empty name.

Branching with /tree

Every session entry links to its parent, forming a tree. Run /tree to jump to any earlier turn and explore a different direction without losing the original path:
Type anywhere in /tree to filter entries through the inline search bar:
  • User or extension message. Moves the active leaf to its parent and loads its text into the editor so you can edit and branch. Selecting the root user message resets to an empty conversation with that prompt.
  • Assistant, tool, or compaction entry. Moves the active leaf to that entry with an empty editor to continue from there.
  • Navigation saves immediately, so quitting or resuming stays on the chosen branch. Pressing Esc during branch-summary generation cancels it and reopens /tree.

Compare /tree, /fork, and /clone

/fork and /clone start a new session from the active path, including its worktree snapshots. atomic --fork <id> and choosing Fork for a missing directory copy every branch in the same store. Forking across different stores carries only the current context window; to move every branch between stores, use atomic storage export and atomic storage import.

Shared-history forks

In SQLite and PostgreSQL stores, a fork shares its prior history with the original session instead of copying 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 to or deletion of the original never affect the fork, and exports always write full copies. JSONL and in-memory stores always copy. See Shared-history forks.

Branch summaries

When /tree switches away from a branch, Atomic can optionally summarize the abandoned branch (no summary, default summary, or custom focus instructions). Set "branchSummary": { "skipPrompt": true } to skip the prompt and default to no summary. See Branch summaries.

Recalling earlier work

From any session or subagent, the agent can read and search past project sessions using read-only history:// URLs across SQLite, PostgreSQL, JSONL, memory, and custom stores:
  • Project isolation. Reading or searching a session ID from another project fails with a project-isolation error unless ?project=<dir> or ?project=all is passed explicitly.
  • What is indexed and omitted. History search scans the newest 25 sessions per page, excludes the current session unless targeted by its own ID URL (history://sessions/<current-id>), and caps output at 10 matches per session. It omits non-conversation metadata—thinking blocks, system/model/thinking-level changes, usage records, labels, context edits, internal extension state, and worktree snapshots. After compaction, the boundary message gives the exact session URL and range to recover earlier details (Memory compaction).
  • Terminal output. History reads and searches ignore color and other terminal formatting codes in tool output, so you can search for the text you saw without matching escape codes. User and assistant text is unchanged. This is automatic and does not rewrite saved sessions.
  • Output caps and continuations. Every history:// call caps output at 40,000 bytes and scans at most 250,000 entries, stopping cleanly with a continue with URL when either limit is hit (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. To run a read-only regex search against a local SQLite session file from the shell without taking writer locks, run atomic storage search-session <sqlite-file> <session-id> <pattern> [cursor] (see CLI reference).

Slow history searches

When a history:// read or search takes longer than 10 seconds (for example against a large or remote PostgreSQL database), Atomic automatically continues it in the background and shows a live status line such as Search(history-3) · continues in background, delivering the result as a completion notice when done.
  • 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 with URL), are stopped, or the session closes or reloads.
  • Separate concurrency pool. A session runs up to 4 active history reads and searches at once (separate from the 64 background shell commands), and keeps the 16 most recently finished history results available for late waits.
For tool wait options, kill({ id }), and how background history searches compare to background shells, see Background history searches and Background tasks reference.

Session storage

Atomic saves sessions automatically in ~/.atomic/workflows/journal.sqlite by default. See Storage to switch backends, share PostgreSQL across machines, or migrate sessions between stores.
  • Sessions from older releases. With the default SQLite store, legacy JSONL sessions in ~/.atomic/agent/sessions still appear in /resume and --continue. Opening one imports a copy into SQLite and leaves the original file untouched.
  • Project settings. A project’s storage settings take effect once you trust the project. New sessions use the project store, while resumed sessions remain in the store they came from.
  • Importing a file. --import <file> or /import <file> imports a JSONL export with its inline worktree snapshots, 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-session run, its history is kept in a temporary file deleted on exit.

Choosing a store

Set sessions.storage for sessions only, or top-level storage for sessions 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 the current directory.
  • --session-store cannot be combined with --session-dir or --no-session, and ATOMIC_CODING_AGENT_SESSION_DIR cannot be combined with ATOMIC_SESSIONS_STORAGE, --storage, or --storage-file.
  • --session-prefix applies only with --session-store on a local SQLite file (matching [A-Za-z_][A-Za-z0-9_]*, never starting with sqlite_). For PostgreSQL, use a lowercase prefix up to 24 characters via storage.prefix or atomic storage join --prefix.
  • Invalid storage configuration or unreachable stores always fail with an error rather than silently falling back to memory.
For programmatic store selection, SessionStore implementations, and store-closing rules in Node.js and TypeScript, see SDK session storage. For JSONL schemas, entry types, and SessionManager methods, see Session file format.