Grok WorldGrok Build CLI field station
SIGNAL LOCKED
NAV

GROK BUILD CLI / 07

Resume, compact, and recover sessions safely

Grok stores prompts, responses, tool calls, and file snapshots on disk. That makes continuity powerful and retention consequential.

CHANNELSESSION OPERATIONS / INTERMEDIATE / 11 MIN
SOURCES CHECKED2026-07-26
ORIGINOFFICIAL DOCS / PRIMARY

Resume the intended thread

Sessions are keyed by working directory under ~/.grok/sessions. Resume by explicit ID when reproducibility matters, or continue the most recent session for the current directory when the task is unambiguous.

A supplied --session-id creates a named headless session; it is not the same as resuming an existing one. Use --fork-session when you need a new branch of reasoning without changing the original session.

grok --resume <session-id>
grok --resume
grok -c
grok sessions list

Manage context before it manages you

Use /context or /session-info to see pressure on the context window. /compact can compress history while accepting a short instruction about facts, constraints, or decisions that must survive.

Compaction is a lossy summary boundary. Preserve acceptance criteria, unresolved failures, current file state, and verification commands rather than every conversational detour.

/context
/compact Preserve the accepted architecture, failing tests, and remaining verification steps.

Recover with a clear data-loss model

/rewind restores files to a selected prompt snapshot and truncates the conversation. The official guide warns that reverted file changes are lost unless they were committed to git, so inspect status and create a safe checkpoint first.

Export a Markdown transcript when an audit trail or handoff is needed. Session storage can contain prompts, tool output, and snapshots, so apply retention and workstation-access controls appropriate to the repository.

  • Use /rewind only after checking git status.
  • Do not assume session history is a secure secret store.
  • Delete or archive sessions according to team policy.
/rewind
grok export <session-id> session.md