Set up Grok
Capture Grok Build, xAI's coding agent, in your terminal.
Worsley captures Grok Build (the grok command), xAI's coding agent in your terminal, through the Worsley CLI.
Grok in the browser (grok.com) and the Grok apps aren't captured yet.
Sign in to the Worsley CLI
Do this once on each computer where you run Grok Build.
- 1Install the Worsley CLI. It runs on macOS, Windows and Linux and needs Node.js 22.23.4 or later (on a Mac,
brew install nodeworks too). On macOS or Linux, run:
curl -fsSL https://www.worsley.ai/install.sh | shOn Windows, in PowerShell:
irm https://www.worsley.ai/install.ps1 | iexThe installer checks the download against its published checksum, puts the CLI in your home folder (~/.worsley, or %LOCALAPPDATA%\Worsley on Windows) and adds it to your PATH. Open a new terminal window afterward so the worsley command is found. Run the same command again any time to update.
- 1Sign in. The command below prints a link and a short code, then waits.
worsley login- 1Open the link. Log in to Worsley if asked, check that the code on the page matches the one in your terminal and that it names this computer, then select Connect. If you last logged in more than 10 minutes ago, Worsley asks you to log in again first. Opened the page without the code? Type it in.
- 2Back in the terminal, Worsley confirms Signed in as your email. The sign-in is kept in your system's credential store (macOS Keychain, Windows Credential Manager or Secret Service on Linux), never in a plain file. The code expires after 10 minutes; run
worsley loginagain if it does.
Turn on Grok Build capture
- 1Tell Worsley to capture Grok Build. It reads only Grok Build's session folder, ~/.grok/sessions, and nothing else on your computer.
worsley enable grok-buildIf you moved Grok Build's folder with GROK_HOME, Worsley follows it. Kept somewhere else entirely? Pass the folder yourself: worsley enable grok-build --dir <folder>.
- 1Start uploading. Leave this running in a terminal window while you work; it checks for new turns and uploads them as they happen. Press Ctrl+C to stop.
worsley watchPrefer to upload now and then? Run worsley sync instead: it reads what's new, uploads it once, and exits. Nothing is read or uploaded while neither is running.
- 1Use Grok Build as you normally do. Every new session appears in Worsley, usually within a minute.
Support for Grok Build is new: it's built from Grok Build's known session format and hasn't yet been checked against every setup. If a session doesn't appear, or looks wrong, contact support and tell us which version you use.
Check that it's working
- Open History in Worsley. Your session shows up there with the tool's name, usually within a minute of a finished turn.
- In the terminal, run
worsley status. It shows the account this computer is signed in to and anything still waiting to upload.
What's captured
- What you typed and Grok's replies, turn by turn. Shell commands you run with ! aren't prompts and aren't counted.
- The session's model and the title Grok gives it.
- When you rewind a session, the turns you dropped are left out from then on.
- Never read: Grok's thinking, tool calls and their output, plans, and your project's files. Sub-agent sessions are skipped.
If a session doesn't appear
- Browser: check that the Worsley icon isn't showing Not Connected, Reconnect or No Site Access, and reload the tool's tab. More in Extension isn't capturing.
- Terminal: check that
worsley watchorworsley proxywas running while you worked, and runworsley status. If it says the sign-in was revoked or expired, runworsley loginagain. - Still missing after a few minutes? Contact support and tell us which tool and which browser or terminal you used.
Related articles
- Capturing sessions in your terminalWorsley captures the AI sessions you run in your terminal, as well as those in your browser.
- Session isn't appearingWhat to check when a conversation doesn't show up in Worsley.
- What Worsley capturesYour prompts and responses in order, plus the details needed to understand them.

