Skip to content
#

Grok Build

Save Grok Build sessions with the SpecStory CLI.

#

Before you start

Install Grok Build and the SpecStory CLI. Grok Build needs SpecStory CLI 2.14.0 or later, and sessions created with Grok Build 1.0.34 or later. Open your project folder in a terminal and run specstory check grok.

#

Run with SpecStory

specstory run grok

Use Grok as usual. SpecStory saves the conversation in .specstory/history/. Cloud sync can run when you are logged in; add --no-cloud-sync to keep the session local.

#

Export existing sessions

specstory list grok
specstory sync grok

# Export a single session
specstory sync grok -s <session-id>

SpecStory reads Grok's session history from ~/.grok/sessions/ and matches it to your project. You can export conversations even if you did not start them through SpecStory. Grok groups sessions by the directory they started in, and the match must be exact: run these commands from the folder where you started Grok, not a parent or a subfolder.

Subagent sessions are not exported on their own; the parent conversation records each subagent call. Images in your prompts and Grok's encrypted reasoning are not included in the saved Markdown.

If you set GROK_HOME, Grok stores sessions under $GROK_HOME/sessions/ instead. Set the same variable for SpecStory so it reads the same place.

#

Capture in the background

specstory watch grok

Leave this running while using Grok directly. Stop watching with Ctrl+C.

#

Find and resume a session

Run specstory search to find saved work or specstory resume to choose a previous session. Grok continues one of its own sessions in place with grok --resume, and can receive a session from another agent as reconstructed conversation text. In a reconstructed session, the other agent's thinking and tool activity become ordinary text in the conversation. See search and resume for the picker and supported handoffs.

#

Troubleshooting

If Grok is not detected, check that grok is on your PATH. If your CLI does not list Grok Build in specstory run --help, update SpecStory. To launch Grok from another location, set grok_cmd in your config or pass specstory run grok -c "/absolute/path/to/grok"; use an absolute path, because Grok's command setting does not expand a leading ~. If no sessions appear, run the commands from the folder where you started Grok and confirm that its local history still exists.

See the CLI reference for custom commands, configuration, and debug logging.