Sessions And Continuity
Grok Code is built around saved work. If you use it for more than one turn, you will eventually need to understand sessions, branches, replay, export, handoff, and rollback.
Session vs Branch
- a session is a saved run
- a branch is one path through that run
This matters because export, replay, and resume can target either:
- the active branch
- a specific
session@branch
Listing Saved Sessions
Use:
grok sessionsYou can also filter:
grok sessions routingWhat you will see:
- session id prefix
- title
- message count
- backend and model
- last updated time
Resuming In The TUI
The easiest way is:
- open
Recall - inspect the available sessions and branches
- resume the branch you want
Useful commands:
/recall/resume
When starting the TUI, you can also use the root CLI flags:
grok -cto continue the latest sessiongrok -sto open a specific saved session
Exporting A Session
CLI:
grok export abc123
grok export session-id@branch-id -o notes.mdTUI:
/exportexports the current graph-backed branch
What to know:
- export needs an active or named saved branch
- if the session or branch query is ambiguous, Grok Code stops and asks for a more specific match
Replaying A Session Timeline
Use:
grok replay abc123
grok replay session-id@branch-id --filter toolReplay is useful when you want:
- tool timeline context
- a branch-specific audit trail
- a summary of what happened before you continue
Renaming Or Deleting Sessions
Use:
grok session rename abc123 "routing cleanup"
grok session delete abc123These commands work on a matched saved session, not on arbitrary files.
Handoffs
In the TUI, use:
/handoffWhat it does:
- saves a Markdown handoff file in
.grok/ - makes it easy to pause work cleanly
The default file pattern is:
.grok/handoff-<timestamp>.mdResume the latest handoff with:
/resume-workThat command loads the newest handoff file it finds in .grok/.
Checkpoints
Checkpoints are rollback snapshots of changed files.
Useful commands:
/checkpoint/checkpoint save/checkpoint restore/gate rollback
Important limits:
- checkpoints only work inside a git repository
- there must be changed files to snapshot
- a checkpoint restores saved file contents, not just Git metadata
Gate apply flows can also create rollback checkpoints automatically.
Sharing
Use:
/shareBehavior:
- if cloud sharing is configured, Grok Code uploads Markdown and gives you a URL
- otherwise it saves a local Markdown file in the project directory
Cloud sharing needs:
CF_ACCOUNT_IDCF_API_TOKEN
If those are missing, local export is the normal fallback.
Search Inside The Current Session
Use:
/searchor:
/search tool call failureThe TUI highlights matches and lets you step through them.
When A Continuity Feature Looks Empty
That is usually normal if you have not created the underlying state yet.
Examples:
Recalllooks sparse until you have saved workGatestays empty until a run stages an artifact- checkpoint restore has nothing to do until a checkpoint exists
/share,/export, and/replayneed an active or named graph-backed branch