Learning resourcesReviewed · xAI

Grok Sessions Guide

Grok's Sessions guide helps developers continue and manage coding-assistant conversations, but rewinding can discard uncommitted file changes. It covers saved sessions, headless continuation, forks, context compaction and persistent task lists.

Researched 14 Nov 2026

In short.

Grok's Sessions guide explains conversation management for developers using its coding assistant, but rewind changes files on disk and can lose uncommitted work. Grok automatically saves prompts, responses, tool calls and file snapshots under ~/.grok/sessions/, organized by working directory. The guide provides commands for terminal and automated use, while installation requirements, pricing, security protections and release compatibility remain unknown. No commands were executed or behavior tested.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete Sessions documentation page at [https://docs.x.ai/build/features/sessions.md], covering resuming, forking, rewinding, compacting, todos and housekeeping. Linked Worktrees and background-task pages are excluded. The page provides no license, pricing or release-version notice. No commands were executed, and runtime behavior, file restoration, isolation, persistence and compatibility were not tested.

The overview

identity

Sessions is an xAI documentation page about managing Grok coding-assistant conversations [https://docs.x.ai/build/features/sessions.md]. It describes session behavior across the terminal user interface, headless mode and ACP. The page does not explain ACP or identify an applicable Grok release.

assessment

The guide is useful for developers returning to unfinished tasks, exploring another approach or connecting several automated invocations. It gives concrete commands and distinguishes creating a session from resuming one. Its coverage leaves installation, operational reliability and compatibility with a particular release unknown.

users

Beginners can use the terminal session picker and persistent todo pane to return to ongoing work. Experienced developers can use session IDs, JSON output and forks to organize longer tasks or automation. Readers need familiarity with terminal commands to follow the command-line examples; the page provides no installation walkthrough.

capabilities

The documented features include resuming conversations, branching them, restoring an earlier prompt's file state and compressing conversation history to reclaim context space. Todos retain pending, in progress, completed and cancelled states across session resumes. Ctrl+T opens the todo pane on the agent screen.

Housekeeping commands include /sessions to switch, rename or close active sessions; /rename <title>, also available as /title; grok sessions list; grok sessions search <query>; and grok sessions delete <id>, which permanently deletes a session. grok export <id> [file] exports a Markdown transcript, with --clipboard available for copying it.

Using it

requirements

Following the command-line examples requires access to the grok command in a working directory. The JSON extraction example also uses jq. Supported operating systems, installation steps, authentication, account requirements and required plans are not stated.

The page discusses repository worktrees and preserving changes through Git commits, but the linked worktree documentation is outside this page's scope. Detailed prerequisites for that feature are unknown.

mechanism

Grok automatically persists prompts, responses, tool calls and file snapshots under ~/.grok/sessions/, keyed by working directory. A fork begins with a copy of the conversation. The --worktree and --no-worktree options determine whether it uses an isolated repository copy.

Rewind offers a point for each prompt, restores files to that point and truncates the conversation accordingly. Compaction compresses conversation history, optionally taking instructions about what to preserve; automatic compaction also occurs as context fills. /context and /session-info expose usage information.

setup

In the terminal interface, /resume opens recent sessions for the current workspace, and the welcome screen also lists them. From the command line, grok --resume <session-id> resumes a specified session. grok --resume and grok -c continue the most recent session for the current directory.

For headless continuation, the guide says to obtain the session ID from JSON output and pass it to -r. The -s or --session-id option assigns a supplied UUID to a new session; it does not resume an existing one. Adding --fork-session branches a resumed session, while /fork [directive] branches the current conversation.

example

The documented headless example is: grok -p "Start the refactor" --output-format json | jq -r '.sessionId'. It requests a refactor and extracts the sessionId field from the JSON output. The resulting identifier can be passed to -r in a subsequent invocation to continue the conversation.

This is a documentation example. No refactor was performed, and the output format, continuation behavior and resulting file changes were not tested.

Assessment & evidence

limitations

Rewind modifies files on disk, and the page warns that reverted changes are lost unless committed to Git. /rewind or Esc Esc while idle opens the rewind picker. The page does not define snapshot exclusions, restoration edge cases or recovery after an unsuccessful rewind.

Automatic persistence includes prompts and file snapshots, so stored sessions may contain sensitive project information. Encryption, access controls, retention, cloud handling and deletion guarantees beyond the stated permanent-delete command are unknown. The information preserved or lost during compaction is also unspecified.

reasoning

Directory-based session discovery and persistent todo states suggest a practical fit for work resumed over several sittings. Session IDs provide a documented way to connect automated invocations. These are suitability inferences from the described features; they do not establish successful task completion, reliable restoration or measurable productivity gains.

The worktree option matters when branches may edit files concurrently: the guide identifies isolated repository copies as the means of preventing parallel sessions from overwriting one another's files.

alternatives

Within Grok, resume continues an existing conversation, fork explores another direction, rewind returns files and conversation to an earlier prompt, and compact addresses context-window pressure. These operations serve different needs and have different effects on files and history.

Todos describe planned work and progress; background tasks track long-running commands and monitors. The linked background-task page is outside scope. No other products are compared, so relative pricing, capability and reliability are unknown.

evidence

The evidence is the complete Sessions page at [https://docs.x.ai/build/features/sessions.md]. It supports the command descriptions and stated behavior in this report. It contains no execution results, restoration demonstrations, benchmarks or independent reliability evidence.

Access & freshness

costs

The page gives no prices, subscription requirements, usage charges or storage limits. The cost of using Grok and any charges associated with resuming, forking or compacting sessions are unknown. It provides no measurements of savings from context compaction.

rights

The page contains no license or redistribution notice for the documentation or software. Rights governing exported transcripts, captured file content and generated responses are not established here. The export command documents a capability without specifying ownership or reuse terms.

freshness

The documentation snapshot was captured at 2026-11-14T19:35:56.526Z. The page states no publication date, last-update date or applicable Grok version. The capture timestamp does not establish compatibility with a particular installed release or whether the live documentation has subsequently changed.

actions

Use /resume for interactive continuation or retain the JSON sessionId for headless continuation. Keep the distinction between --resume and --session-id clear when constructing commands. Choose worktree isolation when parallel forks need separate repository files.

Commit changes you need to preserve before using rewind. Before adopting session persistence for sensitive work, establish the applicable storage protections and retention behavior. Confirm installation requirements, release compatibility and pricing separately; this page does not establish them.

Evidence for this report

selected-page.txtselected · checked 2026-11-14