
Resume a Grok Build session
Pick up an earlier Grok Build conversation — prompts, responses, tool calls, and file snapshots — so you do not re-explain the task after a laptop sleep or a CI step. Official Sessions stores every session under ~/.grok/sessions/ keyed by working directory, and the CLI Reference lists --resume / -r and -c / --continue for the shell. Install the CLI with the install script from the Grok Build overview if it is not already on your PATH.
What you need
The Grok Build CLI signed in (grok login), a project directory that matches the session’s workspace, and either a known session id or a willingness to continue the most recent one for that directory. Neighboring jobs include Fork a Grok Build session when you want a peer branch instead of continuing, Use Grok Build worktrees when the resume should run in an isolated checkout (grok -w -r <id>), and Compact a long Grok Build session when context is full. More Build jobs live on the Build hub.
Resume from the shell
- Change into the same repo (or pass
--cwd) so Grok finds sessions for that workspace:
cd /path/to/your-project
grok version
- Continue the most recent session for this directory:
grok -c
# equivalent:
grok --resume
- Or resume a specific id (list ids with
grok sessions listfirst):
grok sessions list
grok --resume <session-id>
# short flag:
grok -r <session-id>
- In the TUI, run
/resumeto open a picker of recent sessions for the current workspace; the welcome screen lists them too. Use/sessionsto switch, rename, or close active sessions while you work.
Headless and fork notes
For scripts, capture the session id from JSON output on the first run, then pass it to -r on later steps:
SESSION=$(grok -p "Start the refactor" --output-format json | jq -r '.sessionId')
grok -r "$SESSION" -p "Continue with the failing test"
-s / --session-id only names a new session UUID — it does not resume. To branch instead of continuing, add --fork-session (see the fork sibling). Todos saved on the agent screen (Ctrl+T) return with the resumed session.
Pitfalls
Resuming from a different working directory looks empty because sessions are keyed by workspace path. Using --session-id when you meant --resume creates a fresh conversation and drops the old thread. Expecting rewind (/rewind) to be the same as resume is wrong — rewind restores files and truncates history to a prior prompt. Deleting with grok sessions delete <id> is permanent; export with grok export first if you need a Markdown transcript.