Manage sessions in Grok Build
Manage sessions in Grok Build
Grok Build saves every conversation to disk under ~/.grok/sessions/, keyed by working directory — prompts, responses, tool calls, and file snapshots. The same sessions work in the TUI, headless mode, and ACP.
Resume a session
In the TUI, /resume opens a picker for the current workspace; the welcome screen lists recent sessions too.
grok --resume <session-id> # specific session
grok --resume # most recent for this directory
grok -c # shorthand: continue most recent
In headless mode, read the session ID from JSON output and pass it to -r:
grok -p "Start the refactor" --output-format json | jq -r '.sessionId'
-s, --session-id names a new session with a UUID you supply; it does not resume. To branch a resumed session instead of continuing it, add --fork-session.
Fork and rewind
/fork [directive] branches the current session into a peer that starts from a copy of the conversation. Pass --worktree or --no-worktree to choose whether the fork runs in an isolated git checkout — see Use Grok Build worktrees.
/rewind (or Esc Esc while idle) lists a rewind point per prompt. Selecting one restores files to that state and truncates the conversation. Rewind writes to disk — reverted changes are lost unless they were committed to git.
Todos vs background tasks
On the agent screen, Ctrl+T opens the todo pane (pending / in progress / completed / cancelled). Todos travel with the session when you resume. They are separate from background tasks (Ctrl+G / /tasks), which track running commands and monitors.
Housekeeping
| Command | What it does |
|---|---|
/sessions |
Switch, rename, or close active sessions |
/rename <name> |
Rename the current session (/title alias) |
grok sessions list |
List recent sessions for this directory |
grok sessions search <query> |
Search titles and prompts |
grok sessions delete <id> |
Permanently delete a session |
grok export [file] |
Export a transcript as Markdown (--clipboard to copy) |
For reclaiming context window space, use /compact — covered in Compact a long Grok Build session. Check usage with /context or /session-info.