Cursor Is Now Grok Build: 12 Steps, 70 Min SpaceX renamed the Cursor editor and its terminal coding agent to Grok Build on November 30, 2026, with the terminal app now invoked as the `grok` command, installed from x.ai, and authenticated via `XAI_API_KEY` or `grok login --device-auth`, according to 9to5Mac. The migration changes where rules, hooks and MCP servers are read from — rules now load from `*.md` in `.grok/rules`, `.cursor/rules` and `.claude/rules`, hooks from `.grok/hooks/*.json` with PascalCase events, and MCP servers via `grok mcp` and `~/.grok/config.toml` — and the new terminal fails open in places where the old hook guard failed closed, so repos can silently lose coding rules, shell-command gates or MCP tools. The source prescribes a 12-step, roughly 70-minute audit that builds a stdlib Python scanner checking rules, hooks, MCP servers, CLI permissions and CI scripts, plus a smoke test to run on every pull request; SpaceX claims the rewritten Agents Window is three times more responsive, though an X post reportedly cited an unbenchmarked "3-10x" figure. Cursor became Grok Build on November 30, 2026, when SpaceX put its terminal coding agent and the Cursor editor under one name, 9to5Mac reported https://9to5mac.com/2026/11/30/spacex-gives-cursor-a-new-name-and-faster-interface/ . The desktop app, agent sessions and third-party model support carry over. The terminal side is where your scripts and guardrails can quietly break. The new terminal app runs as the grok command. It reads rules from different folders than the Agents Window does, loads hooks from a different file layout, and fails open in places where your old hook guard failed closed. A repo that behaved yesterday can lose its coding rules, its shell-command gate or its MCP tools without printing a single error. The fix is a repeatable audit, not a rewrite. Twelve steps and roughly 70 minutes give you a stdlib Python scanner that checks rules, hooks, MCP servers, CLI permissions and CI scripts, plus a smoke test you can run on every pull request. If you still need the original baseline first, the earlier walkthrough of local Cursor CLI setup, permissions and sandbox https://shattered.io/cursor-cli-local-setup-permissions-sandbox-12-steps-2026/ covers it. Don't miss new tech stories on Google Add Shattered once in the Google app and our stories show up in your news suggestions. Add now https://www.google.com/preferences/source?hl=en&q=https%3A%2F%2Fshattered.io%2F What Changed on November 30, 2026 and What the Docs Say Stayed Put Cursor’s own homepage now opens with a banner that reads “Cursor is now Grok Build.” The docs carry the SpaceXSI name, the pricing page is titled Grok plans and pricing, and a blog post dated August 14, 2026 announced that Cursor is now part of SpaceX. The rename is official. The migration details are scattered across docs pages, so it pays to read them as a diff rather than as news. Two product claims matter for planning. SpaceX says the rewritten Agents Window is three times more responsive and loads faster, and it ships as an open beta with a wider rollout over the coming weeks. A post on the company’s X account reportedly used a bigger “3-10x” figure, which no benchmark backs. Treat the written 3x as the ceiling until someone measures it. For this migration, speed is irrelevant. File locations, flags and fail-open behavior are what bite. GrokShelf’s summary of the announcement adds three practical points. Automations that call agent keep working as written, the @Cursor tag in work apps becomes @Build from December 7, and the announcement said nothing about prices, plans or accounts. Because that summary is a third-party reading of the post, verify the tag date in your own Slack, GitHub and Jira admin screens. GrokShelf’s write-up https://grokshelf.com/news/cursor-is-now-grok-build links the original announcement. The table below separates what moved from what did not. The right-hand column shows which step of the audit covers each row. If you also track what your coding agent costs, the CLI cost ledger tutorial https://shattered.io/cursor-pricing-cli-cost-ledger-reasoning-tokens-12-steps-2026/ still applies to headless runs. | Area | Cursor-era setup | Terminal app today | Audit step | |---|---|---|---| | Product name | Cursor | Grok Build, since Nov 30, 2026 | None | | CLI command | agent or cursor-agent in older recipes | grok , installed from x.ai | Step 10 | | Headless auth | CURSOR API KEY in older recipes | XAI API KEY or grok login --device-auth | Step 10 | | JSON event stream | stream-json in older recipes | --output-format streaming-json | Step 10 | | Rules | .cursor/rules/ .mdc | Reads .md in .grok/rules , .cursor/rules and .claude/rules | Step 6 | | Hooks | .cursor/hooks.json , camelCase events | .grok/hooks/ .json , PascalCase events, also reads the Cursor file | Step 7 | | MCP servers | .cursor/mcp.json | grok mcp , ~/.grok/config.toml , still reads the Cursor file | Step 8 | | Permissions | .cursor/cli.json | permission table in config.toml | Step 9 | One more rename-adjacent fact deserves a flag. The Model Context Protocol, which both surfaces rely on, shipped specification 2026-07-28 on July 28, 2026 and targets 2027-03-30 for the next one. Your MCP servers do not need to change because of the rename, but they should speak a current spec, so check each server’s SDK version while you audit. Prerequisites and Versions You Need Before Step 1 The audit itself is static. It reads files and never calls a model, so you can run it on a laptop with no Grok Build account. You only need the account, or an API key, for the install check in Step 2, the grok inspect comparison in Step 11 and the headless smoke test. Budget the 70 minutes as 15 for Steps 1 to 4, 35 for Steps 5 to 10, and 20 for Steps 11 and 12. | Tool | Version | Why you need it | |---|---|---| | Python | 3.11 or newer tested on 3.12.3 | tomllib ships in the standard library from 3.11 | | Git | 2.40 or newer | Baseline branch, tag and diffs | | jq | 1.6 or newer | Stable sorting of grok inspect --json output | | grok CLI | Latest stable the docs’ sample session shows 1.0.77 | The terminal app. grok update pulls current | | OS | macOS Apple silicon or Intel or Linux x86 64 or arm64 | On Windows use PowerShell, Git Bash or WSL | | Account | SpaceXSI account or an XAI API KEY | Browser sign-in locally, API key in CI | | Node.js | 22.13 or newer | The install docs ask for it before you run the CLI or the Agent SDK, the audit does not | Keep the rename’s timing in mind when you pin versions. The terminal docs were last updated on November 23, 2026, one week before the announcement, so expect flag names and file layouts to keep moving. Re-run the audit whenever grok update lands a new release. More of this kind of tooling coverage sits in our coding tools section https://shattered.io/category/software/ . You also need a repo that uses at least one Cursor feature, otherwise the audit has nothing to report. If you want to follow along without touching a real project, Step 5 generates a fixture repo with one deliberate problem per check. Steps 1 and 2: Freeze a Baseline and Install grok Beside the Old CLI Step 1: Freeze a baseline you can roll back to Create a branch and a tag before you touch anything. Then copy your user-level Cursor files somewhere outside the repo, because hooks, MCP servers and permissions often live in the home directory and git will never see them. Lock the backup folder down, since mcp.json often contains tokens. git switch -c chore/grok-migration git tag pre-grok-migration mkdir -p ~/grok-migration-backup cp -a ~/.cursor/hooks.json ~/.cursor/mcp.json ~/.cursor/cli-config.json \ ~/grok-migration-backup/ 2 /dev/null || true chmod -R go-rwx ~/grok-migration-backup ls -la ~/grok-migration-backup The || true keeps the command from failing when a file does not exist. Most people have two of the three. If the listing shows an empty folder, you have no user-level config and Steps 7 to 9 will mostly report on the repo alone. Step 2: Install grok next to your old CLI Do not uninstall anything. The announcement reportedly keeps the agent command working, and you want a working fallback until the audit passes. Install grok with the documented one-liner, but read the script first if the machine matters to you. Piping a remote script into a shell is the classic supply-chain foot-gun. curl -fsSL https://x.ai/cli/install.sh -o /tmp/grok-install.sh less /tmp/grok-install.sh read it bash /tmp/grok-install.sh exec "$SHELL" -l the docs say to open a new terminal if grok is not found grok version which -a grok agent cursor-agent On first launch grok opens a browser to sign in. On an SSH session use grok login --device-auth , and in CI export XAI API KEY . The which -a line matters more than it looks. If it prints two different binaries, you now know which one a script resolves to, which is the root of half the surprises later on. Expected result: grok version prints a version string, and which -a lists at least grok . An empty agent or cursor-agent line is fine. It only means that CLI was never installed on this machine. Steps 3 and 4: Inventory Your Setup and Learn the Two Surfaces Step 3: Inventory every file the migration touches List what exists before you scan it. This takes a minute and prevents the most common audit mistake, which is scanning the repo while the real hook lives in ~/.cursor . The loop below prints one line per location, then asks grok inspect what the terminal app actually discovers in this directory. Save that output. It is the “before” half of the drift check in Step 11. for f in AGENTS.md CLAUDE.md .mcp.json .cursor/rules .cursor/hooks.json \ .cursor/mcp.json .cursor/cli.json .grok; do if -e "$f" ; then echo "found $f"; else echo "absent $f"; fi done for f in .cursor/hooks.json .cursor/mcp.json .cursor/cli-config.json .grok/config.toml; do if -e "$HOME/$f" ; then echo "found ~/$f"; else echo "absent ~/$f"; fi done grok inspect --json | jq -S . inspect.before.json wc -c inspect.before.json Your output will list one line per path. Count the found lines. Each one maps to a check in this project. If grok inspect already lists your Cursor rules, hooks and MCP servers, that confirms the terminal app scans Cursor files by default. It still does not mean it reads them the way the Agents Window does, which is the point of the next step. If your MCP setup is the part you are least sure about, the walkthrough for setting up Cursor MCP servers https://shattered.io/set-up-cursor-mcp-servers-2026/ explains the JSON shape that Step 8 audits. Step 4: Learn the differences before you write a line of code The docs say outright that the two surfaces differ on purpose. The hooks page states that these are real per-surface differences, not documentation drift, and that a hook written for one surface does not run on the other as-is. Every check in the audit encodes one row of this table. | Setting | Agents Window | Terminal app grok | |---|---|---| | Rule files read | .mdc files in .cursor/rules | .md in .grok/rules , plus .md in .cursor/rules and .claude/rules | | Plain .md in .cursor/rules | Ignored, no frontmatter | Loaded in full | | Rule activation | Four types: always, globs, description, manual | Every rule loads every session, in full | | Hook config | One hooks.json with "version": 1 | Many .json files in .grok/hooks/ and ~/.grok/hooks/ | | Hook event names | camelCase, like beforeShellExecution | PascalCase, like PreToolUse | | Blocking events | Every permission hook can block | PreToolUse and UserPromptSubmit | | Malformed hook output | Blocks the action fail-closed | Allows the action unless failClosed: true | | Hook crash or timeout | Allows unless failClosed: true | Allows unless failClosed: true | | Default hook timeout | Platform default | 5 seconds for PreToolUse | | Project hooks | Run without a separate trust step | Need /hooks-trust or --trust | Read the rules rows twice. A plain Markdown file in .cursor/rules does nothing in the Agents Window and loads in full in the terminal app. A proper .mdc rule drives the Agents Window and is invisible to the terminal app. The docs’ advice for rules you want on both surfaces is a copy in .grok/rules as Markdown, or the same content in AGENTS.md , which both surfaces read. That single sentence explains why a repo can look healthy and still give the terminal agent none of its rules. Step 5: Scaffold the Audit Project and a Fixture Repo The scanner is a small Python package with one module per concern and a shared Finding record. Every check returns a list of findings with a severity, a path, a plain-English message and a suggested fix. That shape keeps the output greppable, lets CI fail on a threshold and makes the JSON mode trivial. Create the layout first. mkdir -p tools/grok-migration-audit/checks tools/grok-migration-audit/scripts cd tools/grok-migration-audit touch checks/ init .py checks/common.py checks/rules.py checks/hooks.py \ checks/mcp.py checks/perms.py checks/scripts.py audit.py Start with the shared helpers. walk files prunes node modules and .git in place with os.walk , which matters on monorepos where a naive recursive glob can take minutes. frontmatter is a deliberately tiny parser. The audit only needs the alwaysApply flag, so a YAML dependency would be dead weight. python import os from dataclasses import dataclass from pathlib import Path SKIP DIRS = {".git", "node modules", ".venv", "venv", "dist", "build", " pycache ", ".next"} SEVERITY RANK = {"info": 0, "low": 1, "medium": 2, "high": 3} @dataclass class Finding: check: str severity: str path: str message: str fix: str = "" def rel path: Path, root: Path - str: try: return str path.relative to root except ValueError: return str path def walk files root: Path : for dirpath, dirnames, filenames in os.walk root : dirnames : = d for d in dirnames if d not in SKIP DIRS for name in filenames: yield Path dirpath / name def read text path: Path - str: try: return path.read text encoding="utf-8", errors="replace" except OSError: return "" def frontmatter path: Path - dict: text = read text path if not text.startswith "---" : return {} block = text.split "---", 2 if len block < 3: return {} meta = {} for line in block 1 .splitlines : if ":" in line: key, , value = line.partition ":" meta key.strip = value.strip .strip '"' .strip "'" return meta Next comes the entry point. It runs every check, sorts findings so the worst appear first, prints them or dumps JSON, and returns exit code 1 when anything meets the --fail-on threshold. The --home flag exists for CI, where you want to scan the repo without picking up whatever sits in the runner’s home directory. python /usr/bin/env python3 import argparse import json import sys from collections import Counter from dataclasses import asdict from pathlib import Path from checks import ALL CHECKS from checks.common import SEVERITY RANK def main - int: parser = argparse.ArgumentParser description="Audit a repo before moving from Cursor CLI to grok" parser.add argument "path", nargs="?", default="." parser.add argument "--home", default=str Path.home , help="home dir to scan use a temp dir in CI " parser.add argument "--json", action="store true" parser.add argument "--fail-on", choices= "high", "medium", "low", "none" , default="high" args = parser.parse args root, home = Path args.path .resolve , Path args.home .resolve findings = for module in ALL CHECKS: findings.extend module.check root, home findings.sort key=lambda f: -SEVERITY RANK f.severity , f.check, f.path if args.json: print json.dumps asdict f for f in findings , indent=2 else: for f in findings: print " %-6s %-7s %s" % f.severity.upper , f.check, f.path print " %s" % f.message if f.fix: print " fix: %s" % f.fix counts = Counter f.severity for f in findings print "\nSummary: %d high, %d medium, %d low, %d info" % counts "high" , counts "medium" , counts "low" , counts "info" if args.fail on == "none": return 0 limit = SEVERITY RANK args.fail on return 1 if any SEVERITY RANK f.severity = limit for f in findings else 0 if name == " main ": sys.exit main Leave checks/ init .py as an empty tuple for now and add one import per step: python from . import rules add the others as you build them ALL CHECKS = rules, Last, generate the fixture repo. It plants one problem for every check: a scoped .mdc rule with no terminal copy, a plain .md rule, a fail-open shell hook that shells out to curl , a literal secret in mcp.json , Cursor-style permissions, and a workflow that still calls the old binary. It also hides a trap, the address \ email protected\ https://shattered.io/cdn-cgi/l/email-protection bash /usr/bin/env bash set -euo pipefail base="${1:-fixtures}" repo="$base/sample-repo" rm -rf "$base" mkdir -p "$repo/.cursor/rules" "$repo/.cursor/hooks" "$repo/.github/workflows" "$base/fake-home/.cursor" cat "$repo/.cursor/rules/react.mdc" <<'EOF' --- description: React component conventions globs: src/components/ / .tsx alwaysApply: false --- - Use named exports - Keep components under 200 lines EOF echo "Return structured errors with a code and message." "$repo/.cursor/rules/api-guidelines.md" cat "$repo/.cursor/hooks.json" <<'EOF' { "version": 1, "hooks": { "beforeShellExecution": { "command": ".cursor/hooks/guard.sh" } , "afterAgentResponse": { "command": ".cursor/hooks/log.sh" } } } EOF cat "$repo/.cursor/hooks/guard.sh" <<'EOF' /bin/bash input=$ cat cmd=$ echo "$input" | jq -r '.command // empty' curl -s https://policy.example.com/check -d "$cmd" /dev/null echo '{"permission":"allow"}' EOF cat "$repo/.cursor/mcp.json" <<'EOF' { "mcpServers": { "linear": { "url": "https://mcp.linear.app/mcp" }, "docs": { "command": "npx", "args": "@acme/docs-mcp" , "env": { "DOCS API KEY": "sk-live-123456" } } } } EOF cat "$repo/.cursor/cli.json" <<'EOF' { "permissions": { "allow": "Shell git ", "Read src/ ", "Mcp linear: " , "deny": "Write .env ", "Shell rm -rf " } } EOF cat "$repo/.github/workflows/agent.yml" <<'EOF' name: agent-review on: pull request jobs: review: runs-on: ubuntu-latest steps: - run: curl https://cursor.com/install -fsS | bash - run: cursor-agent -p "review this diff" --output-format stream-json --force env: CURSOR API KEY: ${{ secrets.CURSOR API KEY }} EOF echo "Tag @Cursor for a second pass. Contact email protected for access." "$repo/.github/PULL REQUEST TEMPLATE.md" echo "fixtures written to $base" Run chmod +x make-fixtures.sh && ./make-fixtures.sh and confirm the fixtures/sample-repo folder appears. Every later step ends with a run against this fixture, so you see each check fire before you trust it. Step 6: Audit Rules for the Two Rule Systems Rules are where migrations fail silently, because nothing crashes. The agent simply stops following your conventions. The check below walks .cursor/rules and .grok/rules and reports four situations: a .mdc rule the terminal app cannot see, a plain .md file the Agents Window ignores, a scoped rule that you mirrored into a folder where it will load every session, and a rule file past 500 lines. The 500-line limit comes straight from the docs’ best-practice list, which also says to split large rules into composable ones and to reference files instead of pasting them. The 40,000-byte budget is different. It is our own alarm level, not a vendor limit, so tune it. The reasoning is simple. Everything in .grok/rules loads in full every session, so total size is a direct tax on every prompt. python from pathlib import Path from .common import Finding, frontmatter, read text, rel TUI RULE BUDGET BYTES = 40 000 our own alarm level, not a vendor limit def check root: Path, home: Path - list Finding : findings = cursor dir = root / ".cursor" / "rules" grok dir = root / ".grok" / "rules" has agents md = root / "AGENTS.md" .exists mdc = sorted cursor dir.rglob " .mdc" if cursor dir.is dir else cursor md = sorted cursor dir.rglob " .md" if cursor dir.is dir else grok md = sorted grok dir.rglob " .md" if grok dir.is dir else grok stems = {p.stem for p in grok md} for rule in mdc: meta = frontmatter rule scoped = meta.get "alwaysApply", "false" .lower = "true" if rule.stem not in grok stems and not has agents md: findings.append Finding "rules", "medium", rel rule, root , "Agents Window rule .mdc with no copy in .grok/rules and no AGENTS.md. " "The terminal app does not read .mdc files.", "Copy the body to .grok/rules/%s.md or move it into AGENTS.md." % rule.stem if scoped and rule.stem in grok stems: findings.append Finding "rules", "low", rel rule, root , "Scoped rule globs or description is mirrored in .grok/rules. " "The terminal app loads every rule in full each session.", "Keep the mirror short, or fold it into AGENTS.md under a heading." lines = len read text rule .splitlines if lines 500: findings.append Finding "rules", "low", rel rule, root , "Rule runs %d lines. The docs advise keeping rules under 500." % lines, "Split it into composable rules." for note in cursor md: findings.append Finding "rules", "medium", rel note, root , "Plain .md inside .cursor/rules is ignored by the Agents Window " "but loaded in full by the terminal app.", "Rename to .mdc with frontmatter if the Agents Window should see it, " "or move it to .grok/rules." total = sum len read text p .encode for p in grok md + cursor md if total TUI RULE BUDGET BYTES: findings.append Finding "rules", "medium", ".grok/rules", "Rules the terminal app loads every session total %d bytes." % total, "Trim, or move rarely used guidance into skills." if not mdc or cursor md or grok md or has agents md : findings.append Finding "rules", "info", ".", "No rules or AGENTS.md found." return findings Look closely at the second finding type, the “scoped rule mirrored” warning. In the Agents Window, a rule with globs: src/components/ / .tsx attaches only when a matching file is in context. Copy that same text into .grok/rules and it loads on every session, even when you are editing a Dockerfile. For rules like that, an AGENTS.md section with a heading often costs less context than a mirrored file. Teams that already moved rules once, for example from Copilot instructions, will recognise the pattern. The guide to migrating Copilot rules into Cursor https://shattered.io/cursor-rules-migrate-github-copilot-2026/ and the Cursor rules tutorial on globs and test harnesses https://shattered.io/cursor-rules-tutorial-mdc-globs-test-harness-12-steps-2026/ cover the .mdc side in detail, so use them to decide which rules deserve a second home. Add rules to the tuple in checks/ init .py , then run the fixture: python3 audit.py fixtures/sample-repo --home fixtures/fake-home Expected result: two medium findings for rules. One names api-guidelines.md as ignored by the Agents Window, the other names react.mdc as invisible to the terminal app. If you see neither, check that make-fixtures.sh created the files under fixtures/sample-repo/.cursor/rules . Step 7: Audit Hooks for Fail-Open Behavior and Payload Drift Hooks are the highest-stakes part of this migration, because a hook is usually a guard. The Agents Window treats a malformed response from a permission hook as a block. The terminal app treats a malformed response, a crash or a timeout as an allow unless the hook sets failClosed to true, and that flag only applies to PreToolUse and UserPromptSubmit . A guard that quietly stops guarding is worse than no guard, because the team believes it is protected. The check handles four things. It maps each Cursor event to the closest terminal event, so you know what to look at. It flags events that have no documented terminal equivalent, such as afterAgentResponse and workspaceOpen . It warns when a gating hook lacks failClosed . And it opens the hook script, because the script is where the other two traps live. A script that runs curl or pytest with no timeout will hit the five-second PreToolUse default, get killed, and then fail open. python import json import re from pathlib import Path from .common import Finding, read text, rel Closest terminal-app event for each Agents Window event. Our mapping, verify with /hooks. CLOSEST TUI = { "sessionStart": "SessionStart", "sessionEnd": "SessionEnd", "beforeSubmitPrompt": "UserPromptSubmit", "preToolUse": "PreToolUse", "postToolUse": "PostToolUse", "postToolUseFailure": "PostToolUseFailure", "beforeShellExecution": "PreToolUse", "afterShellExecution": "PostToolUse", "beforeMCPExecution": "PreToolUse", "afterMCPExecution": "PostToolUse", "beforeReadFile": "PreToolUse", "afterFileEdit": "PostToolUse", "subagentStart": "SubagentStart", "subagentStop": "SubagentStop", "preCompact": "PreCompact", "stop": "Stop", } NO TUI EVENT = {"afterAgentResponse", "afterAgentThought", "beforeTabFileRead", "afterTabFileEdit", "workspaceOpen"} GATING = {"beforeShellExecution", "beforeMCPExecution", "beforeReadFile", "preToolUse", "subagentStart", "beforeSubmitPrompt"} SLOW HINTS = re.compile r"\b curl|wget|npm|pnpm|pytest|docker|terraform|cargo \b" def load path: Path : try: return json.loads read text path except json.JSONDecodeError: return None def check root: Path, home: Path - list Finding : findings = for cfg in root / ".cursor" / "hooks.json", home / ".cursor" / "hooks.json" : if not cfg.is file : continue data = load cfg name = rel cfg, root if data is None: findings.append Finding "hooks", "high", name, "hooks.json is not valid JSON.", "Run it through jq . and fix the syntax." continue if data.get "version" = 1: findings.append Finding "hooks", "low", name, 'Missing "version": 1.', 'Add "version": 1 at the top level.' for event, entries in data.get "hooks" or {} .items : if event in NO TUI EVENT: findings.append Finding "hooks", "medium", name, "%s has no documented terminal-app event." % event, "Keep it for the Agents Window and cloud agents, or drop it." continue for entry in entries: if event in GATING and not entry.get "failClosed" : findings.append Finding "hooks", "medium", name, "%s hook fails open in the terminal app closest event: %s ." % event, CLOSEST TUI.get event, "?" , 'Add "failClosed": true if a crash or timeout must deny.' if "timeout" not in entry: script = root / entry.get "command", "" .split 0 if entry.get "command" else None body = read text script if script and script.is file else "" if SLOW HINTS.search body : findings.append Finding "hooks", "medium", name, "%s hook runs a slow tool with no timeout. PreToolUse defaults to 5 s." % event, 'Set "timeout" in seconds on the hook.' if re.search r"jq -r '\" \.command", body : findings.append Finding "hooks", "low", rel script, root , "Script reads .command from stdin. The terminal app sends toolName and toolInput.", "Log a real payload first, then read the field it actually sends." return findings The payload warning needs a careful reading. The Agents Window example in the docs reads .command from the JSON on stdin. The terminal contract names hookEventName , sessionId , cwd , workspaceRoot , and for tool events toolName and toolInput . The docs also say the terminal app reads a Cursor .cursor/hooks.json file, including camelCase event names, and that those hooks follow the terminal fail-open rules. Nothing on the pages I read says the payload is translated. So the check does not rewrite your script. It tells you to log a real payload and look. A throwaway logging hook does that job. Put it in .grok/hooks/probe.json , trust the folder, run one command in the TUI, and read the log. Delete the file afterward. mkdir -p .grok/hooks cat .grok/hooks/probe.json <<'EOF' { "hooks": { "PreToolUse": { "matcher": "Bash", "hooks": { "type": "command", "command": "tee -a /tmp/grok-hook-payload.log /dev/null", "timeout": 10 } } } } EOF in the TUI: /hooks-trust, ask for any shell command, then cat /tmp/grok-hook-payload.log | jq . Whatever field names appear in that log are the ones your script must read. Our Cursor hooks tutorial on guarding the agent https://shattered.io/cursor-hooks-tutorial-guard-agent-12-steps-2026/ goes deeper on writing the guard itself. Here the goal is narrower. Prove that the guard still fires on the new surface. One gap is deliberate. The audit does not validate files under .grok/hooks/ , because the terminal app already reports them in its /hooks tab, and those project files stay inert until you grant trust. Add hooks to the tuple and rerun the fixture. Expected result: three medium findings fail-open, slow tool with no timeout, no terminal event for afterAgentResponse and one low finding about the .command field. Step 8: Audit MCP Servers for Secrets, Collisions and Cold Starts MCP configs move easily, which is the good news. The terminal app loads .cursor/mcp.json , ~/.claude.json and project .mcp.json files, merged below config.toml in priority. The bad news is that easy movement hides three kinds of problems. Literal secrets travel with the file. The same server name can be defined in several places with different settings. And servers started through npx can hang on a cold start. The documented precedence is worth memorising. A server in config.toml beats the compatibility files, and a project server with the same name as a user server replaces it entirely, with no merging of fields. That second rule bites teams who define a shared linear server at repo level and a personal one in their home directory. The personal one silently disappears inside that repo. The audit reports every name defined more than once, with the paths, so you can pick a winner on purpose. python import json import re import tomllib from pathlib import Path from .common import Finding, read text, rel SECRET KEY = re.compile r" key|token|secret|password|authorization ", re.I ENV REF = re.compile r"\$\{ A-Za-z A-Za-z0-9 :- ^} ?\}" def json servers path: Path - dict: try: return json.loads read text path .get "mcpServers", {} except json.JSONDecodeError, AttributeError : return {} def toml servers path: Path - dict: try: return tomllib.loads read text path .get "mcp servers", {} except tomllib.TOMLDecodeError: return {} def collect root: Path, home: Path - list tuple str, str, dict : sources = root / ".grok" / "config.toml", toml servers , home / ".grok" / "config.toml", toml servers , root / ".mcp.json", json servers , root / ".cursor" / "mcp.json", json servers , home / ".cursor" / "mcp.json", json servers , home / ".claude.json", json servers , found = for path, loader in sources: if path.is file : for name, cfg in loader path .items : found.append name, str path , cfg return found def check root: Path, home: Path - list Finding : findings = servers = collect root, home by name = {} for name, source, cfg in servers: by name.setdefault name, .append source, cfg shown = rel Path source , root for field in "env", "headers" : for key, value in cfg.get field or {} .items : if SECRET KEY.search key and isinstance value, str and not ENV REF.search value : findings.append Finding "mcp", "high", shown, "%s: %s.%s holds a literal secret." % name, field, key , "Replace the value with ${VAR} and export VAR in your shell or CI." command = cfg.get "command", "" if command == "npx" and "-y" not in cfg.get "args" or : findings.append Finding "mcp", "low", shown, "%s: npx without -y can hang on a first-run prompt." % name, "Add -y to args, and raise startup timeout sec for cold starts." if "url" in cfg and not cfg.get "headers" : findings.append Finding "mcp", "info", shown, "%s: remote server with no static header. Expect an OAuth sign-in on first use." % name, "Run grok mcp doctor %s after the first login." % name for name, entries in by name.items : if len entries 1 and any e 1 = entries 0 1 for e in entries 1: : where = ", ".join rel Path s , root for s, in entries findings.append Finding "mcp", "medium", where, "%s is defined %d times with different settings." % name, len entries , "config.toml wins over compatibility files, and a project entry replaces a user one. " "Keep a single definition." if not servers: findings.append Finding "mcp", "info", ".", "No MCP servers found in any known location." return findings The secret check looks at env and headers keys that contain key, token, secret, password or authorization, and accepts a value only when it is a ${VAR} reference. That matches how the terminal app expands variables at load time in url , command , args , env and headers . Move the value into your shell profile or the CI secret store, and keep the file in git. Remote servers deserve a separate note. A server with a url and no static header will trigger a browser OAuth flow on first use, and the docs say tokens land in ~/.grok/mcp credentials.json . That works on a laptop and fails on a headless runner, so plan a static header backed by an environment variable for CI. For deeper permission and allowlist checks, the Cursor MCP server audit https://shattered.io/audit-cursor-mcp-servers-allowlist-hooks-12-steps-2026/ is the companion piece. Add mcp to the tuple and rerun. Expected result: one high finding for DOCS API KEY , one low finding for npx without -y , and one info note that linear will ask you to sign in. Step 9: Translate Old CLI Permissions Into a permission Table Cursor-era CLI permissions lived in .cursor/cli.json for a project and ~/.cursor/cli-config.json for a user, as lists of strings such as Shell git and Read src/ . The terminal app reads permissions from a permission table and evaluates deny first, then ask, then allow. One quirk is easy to miss. A project-level .grok/config.toml only contributes three sections: MCP servers, plugins and permissions. Everything else must live in your user config. The translator below handles the four rule kinds I could map to documented terminal syntax and refuses to guess on the rest. Shell git becomes Bash git , Write ... becomes Edit ... , and Mcp server:tool becomes MCPTool server tool , matching the docs’ note that MCP tools are namespaced as server, double underscore, tool. Unknown kinds surface as manual work. Treat every converted line as a draft, because a prefix-style shell rule and a glob-style shell rule are not guaranteed to match the same commands. python import json import re from pathlib import Path from .common import Finding, read text, rel RULE = re.compile r"^ \w+ \ . \ $" def translate rule: str : match = RULE.match rule if not match: return None kind, arg = match.groups if kind == "Shell": return "Bash %s " % arg if " " in arg or " " in arg else arg + " " if kind == "Read": return "Read %s " % arg if kind == "Write": return "Edit %s " % arg if kind == "WebFetch": return "WebFetch %s " % arg if kind == "Mcp": server, , tool = arg.partition ":" return "MCPTool %s %s " % server, tool or " " return None def check root: Path, home: Path - list Finding : findings = for cfg in root / ".cursor" / "cli.json", home / ".cursor" / "cli-config.json" : if not cfg.is file : continue try: perms = json.loads read text cfg .get "permissions", {} except json.JSONDecodeError: findings.append Finding "perms", "high", rel cfg, root , "Invalid JSON.", "" continue for bucket in "allow", "deny" : converted, manual = , for rule in perms.get bucket, : new = translate rule converted if new else manual .append new or rule if converted: findings.append Finding "perms", "medium", rel cfg, root , "%s rules to carry over: %s" % bucket, ", ".join converted , "Paste into permission %s = ... in .grok/config.toml and review." % bucket for rule in manual: findings.append Finding "perms", "medium", rel cfg, root , "No known translation for %s." % rule, "Rewrite by hand using the Permissions page." return findings After running it, paste the converted lists into the project file. For the fixture, that gives you this: .grok/config.toml project scope permission allow = "Bash git ", "Read src/ ", "MCPTool linear " deny = "Edit .env ", "Bash rm -rf " Two behaviors from the permissions page are worth testing right after. First, deny always wins over allow . Second, a remembered “always allow” grant in the TUI still prompts for dangerous patterns such as rm and git push , but an explicit config or CLI allow rule auto-approves them. So a sloppy Bash git allow rule also approves git push without a prompt. Narrow it to the subcommands you actually want, for example Bash git status and Bash git diff . Add perms to the tuple. Expected result on the fixture: two medium findings, one listing the allow rules to carry over and one listing the deny rules. Step 10: Scan Scripts, CI Files and @Mentions This is the check that finds the breakage your teammates will report first. It walks the repo for shell scripts, YAML, Makefiles, Dockerfiles, JSON, TOML, Markdown and a few source types, and matches six patterns line by line. Each pattern comes from a difference in the docs. The new CLI installs from x.ai/cli/install.sh , authenticates with XAI API KEY , takes --output-format values of plain, json or streaming-json, and uses --always-approve alias --yolo where older recipes used a force flag. python import re from pathlib import Path from .common import Finding, read text, rel, walk files SCAN SUFFIXES = {".sh", ".yml", ".yaml", ".json", ".toml", ".md", ".mk", ".ps1", ".py", ".ts", ".js"} SCAN NAMES = {"Makefile", "Dockerfile", "justfile"} PATTERNS = "medium", re.compile r"\bcursor-agent\b" , "Legacy binary name.", "Decide per pipeline: keep the old binary, or call grok." , "medium", re.compile r"\bCURSOR API KEY\b" , "Cursor-era key name. The grok CLI documents XAI API KEY.", "Export XAI API KEY for grok jobs and keep the old key only for old binaries." , "medium", re.compile r"--output-format = stream-json" , "grok spells it streaming-json.", "Switch the flag value and re-test any event parser." , "medium", re.compile r"\b agent|cursor-agent \b ^\n \s-f\b|--force " , "Old force flag. grok uses --always-approve alias --yolo .", "Prefer scoped --allow/--deny rules over blanket approval." , "low", re.compile r"cursor\.com/install" , "Installer URL for the old CLI. grok installs from x.ai/cli/install.sh.", "Pin one installer per job." , "medium", re.compile r" ?< \w. @ Cc ursor ? \w/- |\.\w " , "@Cursor mention. The announcement moves the tag to @Build from December 7.", "Update templates, Slack workflows and issue forms." , GROK CALL = re.compile r"\bgrok\b ^\n \s-p\b" def check root: Path, home: Path - list Finding : findings = for path in walk files root : if path.suffix not in SCAN SUFFIXES and path.name not in SCAN NAMES: continue if ".cursor" in path.parts and path.suffix == ".mdc": continue for number, line in enumerate read text path .splitlines , start=1 : for severity, pattern, message, fix in PATTERNS: if pattern.search line : findings.append Finding "scripts", severity, "%s:%d" % rel path, root , number , message, fix if GROK CALL.search line and "--no-auto-update" not in line: findings.append Finding "scripts", "low", "%s:%d" % rel path, root , number , "Headless grok call without --no-auto-update.", "Add the flag, or set GROK DISABLE AUTOUPDATER=1 in CI." return findings The mention pattern uses a lookbehind and lookahead so \ email protected\ https://shattered.io/cdn-cgi/l/email-protection @cursor/sdk do not trigger it, while a standalone @Cursor in an issue template does. That matters because the announcement, as GrokShelf summarises it, moves the tag to @Build from December 7 and does not say whether @Cursor stops working that day. Fix templates, Slack workflows and issue forms now rather than learn the answer in production. One CI-specific check deserves attention. Any grok -p call without --no-auto-update is flagged as low severity. The docs recommend that flag for headless and ACP runs, or auto update = false under cli in config.toml , so a background update check never races your job. If your pipeline already runs the agent on pull requests, the headless Cursor CLI in GitHub Actions walkthrough https://shattered.io/cursor-cli-github-actions-headless-agent-2026/ shows the workflow shape that this check is protecting. Finish the package by listing all five modules in checks/ init .py : python from . import hooks, mcp, perms, rules, scripts ALL CHECKS = rules, hooks, mcp, perms, scripts Rerun the fixture. Expected result: five medium findings and one low finding from the scripts check, including the old binary, the old key name, the stream-json spelling, the force flag, the installer URL and the @Cursor tag in the pull request template. Steps 11 and 12: Run the Audit, Fix Findings, Verify With grok and Gate CI Step 11: Run it on a real repo and fix in severity order Point the scanner at your actual project. Start with the default threshold, which fails on high findings only, then tighten it once the repo is clean. On the fixture repo the first run looks like this, trimmed to the top of the report and the summary line: bash $ python3 audit.py fixtures/sample-repo --home fixtures/fake-home HIGH mcp .cursor/mcp.json docs: env.DOCS API KEY holds a literal secret. fix: Replace the value with ${VAR} and export VAR in your shell or CI. ... Summary: 1 high, 12 medium, 3 low, 1 info $ echo $? 1 Work the list top-down. The script below applies every fix the fixture needs, and it doubles as a template for yours. It splits the .mdc frontmatter off the rule with awk , moves the plain Markdown rule where the terminal app expects it, replaces the literal secret with an environment reference, hardens the shell hook, writes the permissions table, retires the old permission file, and rewrites the workflow. mkdir -p .grok/rules awk '/^---$/{n++; next} n =2' .cursor/rules/react.mdc .grok/rules/react.md git mv .cursor/rules/api-guidelines.md .grok/rules/api-guidelines.md printf ' Project rules\nTerminal-app copies live in .grok/rules.\n' AGENTS.md jq '.mcpServers.docs.env.DOCS API KEY = "${DOCS API KEY}" | .mcpServers.docs.args = "-y", "@acme/docs-mcp" ' \ .cursor/mcp.json /tmp/mcp.json && mv /tmp/mcp.json .cursor/mcp.json jq '.hooks.beforeShellExecution 0 += {failClosed: true, timeout: 10}' \ .cursor/hooks.json /tmp/hooks.json && mv /tmp/hooks.json .cursor/hooks.json cat .grok/config.toml <<'TOML' permission allow = "Bash git ", "Read src/ ", "MCPTool linear " deny = "Edit .env ", "Bash rm -rf " TOML git rm -q .cursor/cli.json sed -i 's curl https://cursor.com/install -fsS | bash curl -fsSL https://x.ai/cli/install.sh | bash ' .github/workflows/agent.yml sed -i 's cursor-agent -p "review this diff" --output-format stream-json --force grok --no-auto-update -p "review this diff" --output-format streaming-json ' .github/workflows/agent.yml sed -i 's CURSOR API KEY: ${{ secrets.CURSOR API KEY }} XAI API KEY: ${{ secrets.XAI API KEY }} ' .github/workflows/agent.yml sed -i 's/@Cursor/@Build/' .github/PULL REQUEST TEMPLATE.md Rerun the audit. The fixture drops from 1 high, 12 medium and 3 low findings to nothing high, one medium, one low and one info note: bash $ python3 audit.py /tmp/fx2/sample-repo --home /tmp/fx2/fake-home MEDIUM hooks .cursor/hooks.json afterAgentResponse has no documented terminal-app event. ... Summary: 0 high, 1 medium, 1 low, 1 info The three leftovers are accepted risks, not bugs. The afterAgentResponse hook still serves the Agents Window. The mirrored rule is a deliberate copy. The remote server will ask for an OAuth sign-in once. A clean report means every remaining item has an owner and a reason. A static audit proves your files are consistent. It cannot prove the terminal app agrees. So finish with three live checks. First, compare what grok inspect discovers now against the inspect.before.json snapshot from Step 3. Second, run grok mcp doctor and fix anything it reports. Third, trust the folder once with /hooks-trust , trigger a command your guard should block, and confirm the block. The diff and the smoke test below turn the first and last of those into commands CI can run. grok inspect --json | jq -S . inspect.after.json diff -u inspect.before.json inspect.after.json && echo "no drift" A changed line in that diff is not automatically a bug. It is a prompt to ask whether you meant it. Rules, hooks and servers that appeared or vanished since Step 3 are exactly the ones the migration was supposed to touch. The second automated check is a headless smoke test: bash /usr/bin/env bash set -euo pipefail repo="${1:-.}" out="$ mktemp " trap 'rm -f "$out"' EXIT export GROK DISABLE AUTOUPDATER=1 grok --no-auto-update --cwd "$repo" -p "Reply with the single word ready." \ --output-format json "$out" python3 -m json.tool "$out" /dev/null echo "headless json ok: $ wc -c < "$out" bytes" The smoke test asserts only that grok exits cleanly and prints valid JSON, because the docs describe the json format as one object at the end without naming its fields. Do not hardcode field names until you have read your own output. If the call succeeds, the install, sign-in, working directory and output format all work. That is the same check the docs suggest for a first prompt, automated. Step 12: Gate the audit in CI and write the rollback plan Run the static audit on every pull request that touches agent configuration and once a week on a schedule, because grok update can change behavior with no commit in your repo. The workflow below uses an empty home directory so the runner’s own files never leak into results. Keep the live checks out of this job until you have a dedicated XAI API KEY secret with tight limits. name: grok-migration-audit on: pull request: paths: ".cursor/ ", ".grok/ ", ".github/ ", "AGENTS.md", "scripts/ " schedule: - cron: "17 5 1" jobs: audit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: "3.12" - name: Static audit run: | mkdir -p "$RUNNER TEMP/empty-home" python3 tools/grok-migration-audit/audit.py . \ --home "$RUNNER TEMP/empty-home" --fail-on high Pin the CLI version in that job the way you pin any build tool. The CLI reference documents grok update --version