Grok WorldGrok Build CLI field station

GROK BUILD CLI / 16

Search, inspect, and export Grok sessions

Session history is sensitive operational state; titles, prompts, paths, outputs, and credentials can survive beyond the terminal.

CHANNELSESSION OPERATIONS / INTERMEDIATE / 10 MIN
SOURCES CHECKED2026-10-21
ORIGINOFFICIAL DOCS / PRIMARY

Find the exact session

Use grok sessions list for recent entries or sessions search with a query and --limit. Search output may expose titles and repository context, so review captured logs before sharing.

Resume by an unambiguous session ID. Grok Build 1.0.67 also matches --resume against session titles in the current directory, but UUID-shaped values always mean IDs and an ambiguous title fails, so scripts should keep using IDs. Use --fork-session when the original lineage must remain unchanged.

grok sessions search "migration" --limit 10
grok --resume SESSION_ID --fork-session

Export through an explicit artifact

grok export takes a session ID and an optional Markdown output path that must not already exist; without a path it writes to stdout, and --clipboard copies the export instead. Choose a file when the artifact needs review, redaction, and versioned transfer.

Inside the TUI, /export exports the conversation and /transcript opens it in the configured pager. These are interactive controls, not shell subcommands.

  • Treat transcripts as potentially secret-bearing.
  • Prefer a local reviewed file to an immediate share link.
  • Record the session ID and export time with the artifact.

Separate cleanup from continuation

grok sessions delete permanently removes a local session. Do not use deletion as a way to hide an inconvenient result or free a name; first verify retention obligations and the exact ID.

Before deleting or sharing a costly session, grok usage SESSION_ID prints its persisted token and cost usage (session totals plus every recorded turn); add a turn number to inspect one turn.

After resuming, compare repository branch and working tree with the transcript’s assumptions. Saved context does not freeze Git state.

grok usage SESSION_ID
grok usage SESSION_ID 3