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:

bash
grok sessions

You can also filter:

bash
grok sessions routing

What 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 -c to continue the latest session
  • grok -s to open a specific saved session

Exporting A Session

CLI:

bash
grok export abc123
grok export session-id@branch-id -o notes.md

TUI:

  • /export exports 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:

bash
grok replay abc123
grok replay session-id@branch-id --filter tool

Replay 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:

bash
grok session rename abc123 "routing cleanup"
grok session delete abc123

These commands work on a matched saved session, not on arbitrary files.

Handoffs

In the TUI, use:

text
/handoff

What it does:

  • saves a Markdown handoff file in .grok/
  • makes it easy to pause work cleanly

The default file pattern is:

text
.grok/handoff-<timestamp>.md

Resume the latest handoff with:

text
/resume-work

That 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:

text
/share

Behavior:

  • 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_ID
  • CF_API_TOKEN

If those are missing, local export is the normal fallback.

Search Inside The Current Session

Use:

text
/search

or:

text
/search tool call failure

The 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:

  • Recall looks sparse until you have saved work
  • Gate stays empty until a run stages an artifact
  • checkpoint restore has nothing to do until a checkpoint exists
  • /share, /export, and /replay need an active or named graph-backed branch

Was this page helpful? Report issues on GitHub.