Sessions
Every CrabCode launch is a session. /resume to pick one back up, /rewind to roll back any step, /rename, /export, and -c/-r to resume right from the command line.
What it is
Each time you run crabcode, you start a session — the entire conversation history, working directory, model choice, and file-change trail all live inside it.
Sessions are persisted as JSONL; closing the terminal doesn't lose them, and you can pick any back up later. CrabCode groups sessions by "project" — all sessions from the same git repo land in the same group so you can find them quickly.
When this matters
- Terminal closed / machine rebooted — pick up yesterday's work
- A wrong turn five steps back, you want to rewind and retry
- Export a conversation as a doc / share with a teammate
- Dozens of sessions accumulated in one repo, you need to search "the one from last week about auth"
Storage location
Sessions are stored under the config dir's projects/:
~/.crabcode/projects/<sanitized-project-path>/<session-id>.jsonl~/.crabcode/projects/<sanitized-project-path>/<session-id>.jsonl<sanitized-project-path>is the safe filename of the directory you launched CrabCode from<session-id>is a UUID, unique per session- The file is JSONL (one JSON event per line) —
grep/catit directly
Switching working dir = switching project group. Sessions in different project dirs are invisible to each other.
/resume — pick a session to resume
/resume (alias /continue) opens the session picker:
- Lists all sessions in the current project, newest first
- Shows the first user prompt as preview
- Supports fuzzy search (filter by keyword)
- Selecting one reads the history back and continues
With args:
/resume <session-id> # resume by exact ID
/resume <search-term> # open picker pre-filtered by search term/resume <session-id> # resume by exact ID
/resume <search-term> # open picker pre-filtered by search termResume from CLI directly
You don't have to enter the TUI first. Two flags on the command line (src/main.tsx:435-441):
crabcode -c # resume the most recent session in the current dir
crabcode --continue # same (long form)
crabcode -r # open the picker interactively
crabcode -r <session-id> # resume by ID
crabcode -r "fix auth bug" # open picker pre-filteredcrabcode -c # resume the most recent session in the current dir
crabcode --continue # same (long form)
crabcode -r # open the picker interactively
crabcode -r <session-id> # resume by ID
crabcode -r "fix auth bug" # open picker pre-filtered-c / -r shine in scripted workflows: CI picking up where it left off, IDE integrations carrying context across launches.
--fork-session
crabcode -r <id> --fork-sessioncrabcode -r <id> --fork-session--fork-session resumes from the chosen point but spins up a brand-new session id — the original is untouched, and the new session evolves independently from that moment. Useful when you want to take "these results as a starting point" and explore two different branches.
/rewind — roll back any step
/rewind (alias /checkpoint) opens a message selector that lets you jump back to a specific user message. When you pick one, you choose the scope:
| Option | Effect |
|---|---|
both | Roll back conversation + restore code (undo every file change after that point) |
conversation | Roll back conversation only; files stay as they are |
code | Restore files only; conversation history stays |
summarize | Compact the conversation up to that point into a summary, then continue |
summarize_up_to | Compress everything up to the selected position |
nevermind | Cancel |
Code restore is backed by CrabCode's internal file-history — every CrabCode edit snapshots the original first, so rewind writes them back from the snapshot. That makes rewind safe without git as long as the edits were made via CrabCode tools.
/rename — name the session
/rename <name> # set explicitly
/rename # no args → small model auto-names from conversation content/rename <name> # set explicitly
/rename # no args → small model auto-names from conversation contentNamed sessions show their name in the /resume picker, much friendlier than the default "first 50 chars of the first prompt".
/export — export the conversation
/export # opens a dialog to choose filename + path
/export <filename> # writes directly to cwd as <filename>.txt/export # opens a dialog to choose filename + path
/export <filename> # writes directly to cwd as <filename>.txtExport format is plain text — the whole conversation rendered as a readable transcript, including tool calls and outputs. Default filename is <timestamp>-<first-prompt-slug>.txt.
Good for:
- Pasting a debug trail to a colleague
- Archive / retrospective
- Feeding the whole CrabCode dialogue to another model as context
Isolation
- Across accounts: logging into a different account = the previous account's sessions are invisible (each account has its own transcript root)
- Across projects: by default only the current project's sessions are listed; for global search, choose "all projects" from the
/resumepicker - Across devices: storage is local — no automatic cloud sync. Sessions exist only on the machine you saved them on
Troubleshooting
| Symptom | Check |
|---|---|
/resume shows no old sessions | Did the launch dir change? Different sanitized path = different project group |
| Session picker is slow | Too many old sessions piled up; manually archive ~/.crabcode/projects/<old>/ |
/rewind can't find the message you want | Too old, fell out of the compaction window; use /export to find it and replay manually |
| Want multi-device sync | Sync ~/.crabcode/projects/ yourself via git / rsync (at your own risk) |