BuildBotsBetter
BUILDBOTSBETTER
All Builds
Guided Build · ChatGPT Codex

Set Up Grok Build (xAI)

Install, sign in, make one bounded change, and prove it works.

90–150 minuteswindows · macos · linuxFree practice; existing tool accounts may have plan limits.

Finish with: An installed, authenticated Grok Build workspace with rules, a verified Python change, a headless read-only check, and a practiced recovery path.

Progress stays in this browser. Export to keep a portable record.

Do this now

Walkthrough

A step demonstration outline; use optional narration while you follow it.

Resources for this step

Check the result

This browser checks the evidence format and your checklist. It cannot inspect your computer or certify a live login.

When it does not work

Finish-line test

Repeat the last product-specific checkpoint from a fresh practice input, preserve actual output, then complete the Build Bot Better guard and restore checks. Export the evidence.

Sources and verification limits

Sources checked 2026-10-05. Native installers and Linux/npm prerequisite paths need clean-machine verification; see test receipts. macOS commands have not been run on a real Mac. Human sign-in and paid-plan eligibility cannot be certified without the learner’s account. Do not assign an A/fully verified setup grade until a real clean install and sign-in walk is complete.

Complete lesson text and action cards

Source-owned text for offline reading and retrieval. Command success still requires actual local evidence.

Confirm the product and access

Open the linked official source. Verify the product name Grok Build, your OS/architecture, and the account option available to you. Record the path you will use before installing.

Expected: The product, platform and eligible sign-in route are recorded; no plan upgrade is required by this course.

Set up the practice folder

Download the resource ZIP at the top of this Build. Extract it into a new folder you own (for example C:\BBBPractice on Windows, or ~/bbb-practice on macOS/Linux). Open a terminal in the extracted folder. Run the version command for your platform. All subsequent commands assume this folder.

Expected: Python reports version 3.10 or newer and the terminal is in the extracted resource folder.

windows

python --version
Get-Location
Get-ChildItem

macos

python3 --version
pwd
ls

linux

python3 --version
pwd
ls

Check installation prerequisites

For an npm route, install a current Node.js LTS from nodejs.org first. Run node --version and npm --version; Qwen Code needs Node.js 22+. For a native installer, verify the shell and curl (macOS/Linux), and check the official platform prerequisites. Do not run a macOS/Linux script directly in native PowerShell.

Expected: The required runtime and shell are available; the directory is the extracted practice workspace.

windows

node --version
npm.cmd --version
Get-Location

macos

node --version
npm --version
pwd
command -v curl

linux

node --version
npm --version
pwd
command -v curl

Install Grok Build

Inspect the installer source or package publisher on the official page, then execute the command card for your platform. Reopen the terminal if PATH changed. Save the version output; do not run elevated npm unless the official package specifically requires it.

Expected: The grok version command exits successfully and prints a version.

windows

npm.cmd install -g @xai-official/grok
grok.cmd --version

macos

curl -fsSL https://x.ai/cli/install.sh | bash
grok --version

linux

curl -fsSL https://x.ai/cli/install.sh | bash
grok --version

Complete the account sign-in

Run grok login and complete the official browser sign-in yourself. Then run grok inside the practice folder. This terminal coding agent is distinct from Grok Bot, the teammate desktop/cloud product.

Expected: The CLI is authenticated to your own account and accepts an interactive prompt; no credential is stored in the practice files.

windows

grok.cmd

macos

grok

linux

grok

Verify the rules are read

Open AGENTS.md in the resource folder and replace the workspace sentence with your real path. Start grok there. Ask the agent to list its rules, summarize app.py and say which files it may modify.

Expected: The agent names AGENTS.md, the practice path, the bounded scope and the verification command.

all

Read AGENTS.md and app.py. Summarize your permitted workspace, prohibited actions and the verification command. Do not change anything.

Delegate one small change

Ask Grok Build to add a docstring to total in app.py, keeping behavior unchanged. Require the agent to run verify.py and show the minimal diff. Review that only app.py changed, then run the command independently.

Expected: VERIFY PASS covers empty, ordinary, signed and repeated inputs; only the requested docstring changed.

windows

python verify.py

macos

python3 verify.py

linux

python3 verify.py

Inspect configuration and approval modes

Run the diagnostic command, then the CLI’s --help. Record the rules/settings locations and approval mode available in this installed version. Keep the ordinary permission prompts. For Qwen, inspect approval modes and --allowed-tools locally before using any flag.

Expected: The effective configuration and permission mode are recorded; unexpected writes need review.

windows

grok inspect
grok --help

macos

grok inspect
grok --help

linux

grok inspect
grok --help

Run a read-only scripted task

Inspect --help for the headless command. Use the card to request only an explanation of app.py. Save stdout and the exit code. Headless mode still consumes provider usage and must not be treated as a free sandbox.

Expected: The output accurately describes sum(items), the process exits 0, and app.py is unchanged.

windows

grok -p "Read app.py and explain total. Do not edit files or run commands."

macos

grok -p "Read app.py and explain total. Do not edit files or run commands."

linux

grok -p "Read app.py and explain total. Do not edit files or run commands."

Plan one connector without granting access

Inspect the CLI’s help/configuration for MCP or tool extensions. Write the name of one needed tool, the exact directory/data it would expose, and the permission needed. Add no server until you review that scope. Qwen users inspect current MCP/multi-directory help instead of assuming older --mcp-config flags still exist.

Expected: One connector plan contains purpose, scoped data, permissions, verification and a removal plan.

Record a reproducible incident

Use incident-template.md to document one real or deliberately introduced missing-file error in the practice project. Ask the agent to diagnose from the exact command, path and error, then repair only the practice input and rerun verification.

Expected: The incident contains the failure, one supported diagnosis, smallest fix and VERIFY PASS after recovery.

windows

python verify.py

macos

python3 verify.py

linux

python3 verify.py

Write a repeatable onboarding checklist

Fill onboarding-checklist.md for Grok Build. Rules: AGENTS.md. Memory/settings: ~/.grok (Windows: %USERPROFILE%\.grok). Guard: ~/.grok/hooks/ with Grok Build’s documented JSON deny protocol; inspect the discovered hooks using grok inspect. Record permissions, backup schedule, restore and final verification. Launch grok and inspect its welcome screen: confirm the working directory, model/reasoning effort, permission mode and release channel. Entering a first prompt begins a new conversation; choosing a recent session resumes its history. New worktree creates an isolated Git checkout/branch and needs a Git repository; Changelog opens release notes; Quit exits. Use /resume or grok -c to continue the latest for this directory. The installed vendor guide lists welcome Ctrl+R for Resume, Ctrl+W for New worktree and Ctrl+Q for Quit. Current web docs list some different in-session keys, so verify your installed shortcut screen before using them. /new or Ctrl+N twice starts fresh; /home returns to welcome when supported. No welcome-disable setting was found in the inspected vendor guide; cli.show_tips hides only the tip line. grok -c bypasses welcome by resuming. Always-approve means actions can run without asking; it is not proof of a guard. Record which choice you made.

Expected: The checklist contains a concrete path and owner for rules, memory, permissions, guard, backup, restore and final verification. The welcome-screen observation distinguishes a new conversation from resuming existing history.

Demonstrate the variable-path limit safely

Run workspace_guard.py --self-test. Read the source: the target is resolved before deciding. The variable_target case points at the home folder but performs no filesystem operation. Compare this with a hook that sees only command text.

Expected: GUARD PASS reports inside allowed and profile, outside, variable-derived profile and workspace root denied; no deletion was executed.

windows

python workspace_guard.py --self-test

macos

python3 workspace_guard.py --self-test

linux

python3 workspace_guard.py --self-test

Verify the actual protection in your tool

For CLI tools, open the hook/permissions screen and confirm the configured guard is active. Use your tool’s documented pre-command hook protocol; the BBB working reference is linked in Sources. Run a harmless directory listing, then a guard dry-run targeting the profile. Do not execute a destructive profile probe. Grok Bot has no proven local shell guard here: use project-only tasks and reviewed actions, with backups.

Expected: A harmless command runs, the guard dry-run returns DENY, and the checklist records the actual hook protocol and active state or the Grok Bot limitation.

Enable a real backup of memory and project files

Connect a second backup drive. Windows: configure System Protection as additional recovery and use a scheduled copy/File History that explicitly includes hidden agent folders. macOS: configure Time Machine and verify dot folders are included. Linux: use a home backup such as restic/Deja Dup; Timeshift omits /home by default. Download the copy-only profile backup script for your platform, inspect it, and adapt the folder list to your tool. Record the last successful scheduled run; protect backup access because it may contain credentials.

Expected: A backup on another drive includes the tool’s user settings and memory folder and this project, and a successful schedule/time is recorded.

windows

.\profile-backup.ps1 -Destination D:\Backups\llm-profiles

macos

bash profile-backup.sh /Volumes/YourBackup/llm-profiles

linux

bash profile-backup.sh /media/YourBackup/llm-profiles

Practice a hash-verified restore

Run restore_drill.py with a separate backup directory. The script creates a new proof file, copies it, restores a second copy, and compares SHA256 hashes. Then restore one non-secret file from your actual agent memory backup into a separate scratch directory and open it; do not overwrite the live profile.

Expected: RESTORE PASS contains matching hashes; the actual memory file is readable after restoration into scratch.

windows

python restore_drill.py --backup-root D:\Backups\bbb-practice --work-root practice

macos

python3 restore_drill.py --backup-root /Volumes/YourBackup/bbb-practice --work-root practice

linux

python3 restore_drill.py --backup-root /media/YourBackup/bbb-practice --work-root practice

Restart from the right directory

Close Grok Build normally. Reopen a terminal in this extracted folder. Run grok to inspect the welcome screen; choose a recent conversation or use grok -c (or grok --resume) to resume it. A new prompt from the welcome screen starts fresh; it does not promise old conversation context. Ask the resumed session to summarize its last verification and reread AGENTS.md. Compare that with a separate fresh session, then run verify.py independently. Never use rewind/restore-code merely to resume: they can change files.

Expected: The correct workspace/rules are active after restart and VERIFY PASS is reproducible.

windows

grok -c
# After returning to your terminal:
python verify.py

macos

grok -c
# After returning to your terminal:
python3 verify.py

linux

grok -c
# After returning to your terminal:
python3 verify.py