{"slug": "cursor-is-now-grok-build-12-steps-70-min", "title": "Cursor Is Now Grok Build: 12 Steps, 70 Min", "summary": "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.", "body_md": "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.\n\nThe 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.\n\nThe 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.\n\nDon't miss new tech stories on Google\n\nAdd Shattered once in the Google app and our stories show up in your news suggestions.\n\n[Add now](https://www.google.com/preferences/source?hl=en&q=https%3A%2F%2Fshattered.io%2F)\n\n## What Changed on November 30, 2026 (and What the Docs Say Stayed Put)\n\nCursor’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.\n\nTwo 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.\n\nGrokShelf’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.\n\nThe 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.\n\n| Area | Cursor-era setup | Terminal app today | Audit step | \n|---|---|---|---|\n| Product name | Cursor | Grok Build, since Nov 30, 2026 | None | \n| CLI command | `agent` or`cursor-agent` in older recipes | `grok` , installed from x.ai | Step 10 | \n| Headless auth | `CURSOR_API_KEY` in older recipes | `XAI_API_KEY` or`grok login --device-auth` | Step 10 | \n| JSON event stream | `stream-json` in older recipes | `--output-format streaming-json` | Step 10 | \n| Rules | `.cursor/rules/*.mdc` | Reads `*.md` in`.grok/rules` ,`.cursor/rules` and`.claude/rules` | Step 6 | \n| Hooks | `.cursor/hooks.json` , camelCase events | `.grok/hooks/*.json` , PascalCase events, also reads the Cursor file | Step 7 | \n| MCP servers | `.cursor/mcp.json` | `grok mcp` ,`~/.grok/config.toml` , still reads the Cursor file | Step 8 | \n| Permissions | `.cursor/cli.json` | `[permission]` table in`config.toml` | Step 9 | \n\nOne 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.\n\n## Prerequisites and Versions You Need Before Step 1\n\nThe 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.\n\n| Tool | Version | Why you need it | \n|---|---|---|\n| Python | 3.11 or newer (tested on 3.12.3) | `tomllib` ships in the standard library from 3.11 | \n| Git | 2.40 or newer | Baseline branch, tag and diffs | \n| jq | 1.6 or newer | Stable sorting of `grok inspect --json` output | \n| grok CLI | Latest stable (the docs’ sample session shows 1.0.77) | The terminal app. `grok update` pulls current | \n| OS | macOS (Apple silicon or Intel) or Linux (x86_64 or arm64) | On Windows use PowerShell, Git Bash or WSL | \n| Account | SpaceXSI account or an `XAI_API_KEY` | Browser sign-in locally, API key in CI | \n| 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 | \n\nKeep 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/).\n\nYou 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.\n\n## Steps 1 and 2: Freeze a Baseline and Install grok Beside the Old CLI\n\n### Step 1: Freeze a baseline you can roll back to\n\nCreate 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.\n\n```\ngit switch -c chore/grok-migration\ngit tag pre-grok-migration\n\nmkdir -p ~/grok-migration-backup\ncp -a ~/.cursor/hooks.json ~/.cursor/mcp.json ~/.cursor/cli-config.json \\\n   ~/grok-migration-backup/ 2>/dev/null || true\nchmod -R go-rwx ~/grok-migration-backup\nls -la ~/grok-migration-backup\n```\n\nThe `|| 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.\n\n### Step 2: Install grok next to your old CLI\n\nDo 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.\n\n```\ncurl -fsSL https://x.ai/cli/install.sh -o /tmp/grok-install.sh\nless /tmp/grok-install.sh        # read it\nbash /tmp/grok-install.sh\n\nexec \"$SHELL\" -l                 # the docs say to open a new terminal if grok is not found\ngrok version\nwhich -a grok agent cursor-agent\n```\n\nOn 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.\n\nExpected 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.\n\n## Steps 3 and 4: Inventory Your Setup and Learn the Two Surfaces\n\n### Step 3: Inventory every file the migration touches\n\nList 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.\n\n```\nfor f in AGENTS.md CLAUDE.md .mcp.json .cursor/rules .cursor/hooks.json \\\n         .cursor/mcp.json .cursor/cli.json .grok; do\n  if [ -e \"$f\" ]; then echo \"found   $f\"; else echo \"absent  $f\"; fi\ndone\n\nfor f in .cursor/hooks.json .cursor/mcp.json .cursor/cli-config.json .grok/config.toml; do\n  if [ -e \"$HOME/$f\" ]; then echo \"found   ~/$f\"; else echo \"absent  ~/$f\"; fi\ndone\n\ngrok inspect --json | jq -S . > inspect.before.json\nwc -c inspect.before.json\n```\n\nYour 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.\n\nIf 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.\n\n### Step 4: Learn the differences before you write a line of code\n\nThe 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.\n\n| Setting | Agents Window | Terminal app (grok) | \n|---|---|---|\n| Rule files read | `.mdc` files in`.cursor/rules` | `*.md` in`.grok/rules` , plus`*.md` in`.cursor/rules` and`.claude/rules` | \n| Plain `.md` in`.cursor/rules` | Ignored, no frontmatter | Loaded in full | \n| Rule activation | Four types: always, globs, description, manual | Every rule loads every session, in full | \n| Hook config | One `hooks.json` with`\"version\": 1` | Many `*.json` files in`.grok/hooks/` and`~/.grok/hooks/` | \n| Hook event names | camelCase, like `beforeShellExecution` | PascalCase, like `PreToolUse` | \n| Blocking events | Every permission hook can block | `PreToolUse` and`UserPromptSubmit` | \n| Malformed hook output | Blocks the action (fail-closed) | Allows the action unless `failClosed: true` | \n| Hook crash or timeout | Allows unless `failClosed: true` | Allows unless `failClosed: true` | \n| Default hook timeout | Platform default | 5 seconds for `PreToolUse` | \n| Project hooks | Run without a separate trust step | Need `/hooks-trust` or`--trust` | \n\nRead 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.\n\n## Step 5: Scaffold the Audit Project and a Fixture Repo\n\nThe 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.\n\n```\nmkdir -p tools/grok-migration-audit/checks tools/grok-migration-audit/scripts\ncd tools/grok-migration-audit\ntouch checks/__init__.py checks/common.py checks/rules.py checks/hooks.py \\\n      checks/mcp.py checks/perms.py checks/scripts.py audit.py\n```\n\nStart 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.\n\n``` python\nimport os\nfrom dataclasses import dataclass\nfrom pathlib import Path\n\nSKIP_DIRS = {\".git\", \"node_modules\", \".venv\", \"venv\", \"dist\", \"build\", \"__pycache__\", \".next\"}\nSEVERITY_RANK = {\"info\": 0, \"low\": 1, \"medium\": 2, \"high\": 3}\n\n@dataclass\nclass Finding:\n    check: str\n    severity: str\n    path: str\n    message: str\n    fix: str = \"\"\n\ndef rel(path: Path, root: Path) -> str:\n    try:\n        return str(path.relative_to(root))\n    except ValueError:\n        return str(path)\n\ndef walk_files(root: Path):\n    for dirpath, dirnames, filenames in os.walk(root):\n        dirnames[:] = [d for d in dirnames if d not in SKIP_DIRS]\n        for name in filenames:\n            yield Path(dirpath) / name\n\ndef read_text(path: Path) -> str:\n    try:\n        return path.read_text(encoding=\"utf-8\", errors=\"replace\")\n    except OSError:\n        return \"\"\n\ndef frontmatter(path: Path) -> dict:\n    text = read_text(path)\n    if not text.startswith(\"---\"):\n        return {}\n    block = text.split(\"---\", 2)\n    if len(block) < 3:\n        return {}\n    meta = {}\n    for line in block[1].splitlines():\n        if \":\" in line:\n            key, _, value = line.partition(\":\")\n            meta[key.strip()] = value.strip().strip('\"').strip(\"'\")\n    return meta\n```\n\nNext 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.\n\n``` python\n#!/usr/bin/env python3\nimport argparse\nimport json\nimport sys\nfrom collections import Counter\nfrom dataclasses import asdict\nfrom pathlib import Path\n\nfrom checks import ALL_CHECKS\nfrom checks.common import SEVERITY_RANK\n\ndef main() -> int:\n    parser = argparse.ArgumentParser(description=\"Audit a repo before moving from Cursor CLI to grok\")\n    parser.add_argument(\"path\", nargs=\"?\", default=\".\")\n    parser.add_argument(\"--home\", default=str(Path.home()), help=\"home dir to scan (use a temp dir in CI)\")\n    parser.add_argument(\"--json\", action=\"store_true\")\n    parser.add_argument(\"--fail-on\", choices=[\"high\", \"medium\", \"low\", \"none\"], default=\"high\")\n    args = parser.parse_args()\n\n    root, home = Path(args.path).resolve(), Path(args.home).resolve()\n    findings = []\n    for module in ALL_CHECKS:\n        findings.extend(module.check(root, home))\n    findings.sort(key=lambda f: (-SEVERITY_RANK[f.severity], f.check, f.path))\n\n    if args.json:\n        print(json.dumps([asdict(f) for f in findings], indent=2))\n    else:\n        for f in findings:\n            print(\"[%-6s] %-7s %s\" % (f.severity.upper(), f.check, f.path))\n            print(\"         %s\" % f.message)\n            if f.fix:\n                print(\"         fix: %s\" % f.fix)\n        counts = Counter(f.severity for f in findings)\n        print(\"\\nSummary: %d high, %d medium, %d low, %d info\" % (\n            counts[\"high\"], counts[\"medium\"], counts[\"low\"], counts[\"info\"]))\n\n    if args.fail_on == \"none\":\n        return 0\n    limit = SEVERITY_RANK[args.fail_on]\n    return 1 if any(SEVERITY_RANK[f.severity] >= limit for f in findings) else 0\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n```\n\nLeave `checks/__init__.py` as an empty tuple for now and add one import per step:\n\n``` python\nfrom . import rules   # add the others as you build them\n\nALL_CHECKS = (rules,)\n```\n\nLast, 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)\n\n``` bash\n#!/usr/bin/env bash\nset -euo pipefail\nbase=\"${1:-fixtures}\"\nrepo=\"$base/sample-repo\"\nrm -rf \"$base\"\nmkdir -p \"$repo/.cursor/rules\" \"$repo/.cursor/hooks\" \"$repo/.github/workflows\" \"$base/fake-home/.cursor\"\n\ncat > \"$repo/.cursor/rules/react.mdc\" <<'EOF'\n---\ndescription: React component conventions\nglobs: src/components/**/*.tsx\nalwaysApply: false\n---\n- Use named exports\n- Keep components under 200 lines\nEOF\n\necho \"Return structured errors with a code and message.\" > \"$repo/.cursor/rules/api-guidelines.md\"\n\ncat > \"$repo/.cursor/hooks.json\" <<'EOF'\n{\n  \"version\": 1,\n  \"hooks\": {\n    \"beforeShellExecution\": [{ \"command\": \".cursor/hooks/guard.sh\" }],\n    \"afterAgentResponse\": [{ \"command\": \".cursor/hooks/log.sh\" }]\n  }\n}\nEOF\n\ncat > \"$repo/.cursor/hooks/guard.sh\" <<'EOF'\n#!/bin/bash\ninput=$(cat)\ncmd=$(echo \"$input\" | jq -r '.command // empty')\ncurl -s https://policy.example.com/check -d \"$cmd\" > /dev/null\necho '{\"permission\":\"allow\"}'\nEOF\n\ncat > \"$repo/.cursor/mcp.json\" <<'EOF'\n{\n  \"mcpServers\": {\n    \"linear\": { \"url\": \"https://mcp.linear.app/mcp\" },\n    \"docs\": {\n      \"command\": \"npx\",\n      \"args\": [\"@acme/docs-mcp\"],\n      \"env\": { \"DOCS_API_KEY\": \"sk-live-123456\" }\n    }\n  }\n}\nEOF\n\ncat > \"$repo/.cursor/cli.json\" <<'EOF'\n{\n  \"permissions\": {\n    \"allow\": [\"Shell(git)\", \"Read(src/**)\", \"Mcp(linear:*)\"],\n    \"deny\": [\"Write(.env*)\", \"Shell(rm -rf *)\"]\n  }\n}\nEOF\n\ncat > \"$repo/.github/workflows/agent.yml\" <<'EOF'\nname: agent-review\non: pull_request\njobs:\n  review:\n    runs-on: ubuntu-latest\n    steps:\n      - run: curl https://cursor.com/install -fsS | bash\n      - run: cursor-agent -p \"review this diff\" --output-format stream-json --force\n        env:\n          CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}\nEOF\n\necho \"Tag @Cursor for a second pass. Contact [email protected] for access.\" > \"$repo/.github/PULL_REQUEST_TEMPLATE.md\"\necho \"fixtures written to $base\"\n```\n\nRun `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.\n\n## Step 6: Audit Rules for the Two Rule Systems\n\nRules 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.\n\nThe 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.\n\n``` python\nfrom pathlib import Path\n\nfrom .common import Finding, frontmatter, read_text, rel\n\nTUI_RULE_BUDGET_BYTES = 40_000  # our own alarm level, not a vendor limit\n\ndef check(root: Path, home: Path) -> list[Finding]:\n    findings = []\n    cursor_dir = root / \".cursor\" / \"rules\"\n    grok_dir = root / \".grok\" / \"rules\"\n    has_agents_md = (root / \"AGENTS.md\").exists()\n\n    mdc = sorted(cursor_dir.rglob(\"*.mdc\")) if cursor_dir.is_dir() else []\n    cursor_md = sorted(cursor_dir.rglob(\"*.md\")) if cursor_dir.is_dir() else []\n    grok_md = sorted(grok_dir.rglob(\"*.md\")) if grok_dir.is_dir() else []\n    grok_stems = {p.stem for p in grok_md}\n\n    for rule in mdc:\n        meta = frontmatter(rule)\n        scoped = meta.get(\"alwaysApply\", \"false\").lower() != \"true\"\n        if rule.stem not in grok_stems and not has_agents_md:\n            findings.append(Finding(\n                \"rules\", \"medium\", rel(rule, root),\n                \"Agents Window rule (.mdc) with no copy in .grok/rules and no AGENTS.md. \"\n                \"The terminal app does not read .mdc files.\",\n                \"Copy the body to .grok/rules/%s.md or move it into AGENTS.md.\" % rule.stem))\n        if scoped and rule.stem in grok_stems:\n            findings.append(Finding(\n                \"rules\", \"low\", rel(rule, root),\n                \"Scoped rule (globs or description) is mirrored in .grok/rules. \"\n                \"The terminal app loads every rule in full each session.\",\n                \"Keep the mirror short, or fold it into AGENTS.md under a heading.\"))\n        lines = len(read_text(rule).splitlines())\n        if lines > 500:\n            findings.append(Finding(\n                \"rules\", \"low\", rel(rule, root),\n                \"Rule runs %d lines. The docs advise keeping rules under 500.\" % lines,\n                \"Split it into composable rules.\"))\n\n    for note in cursor_md:\n        findings.append(Finding(\n            \"rules\", \"medium\", rel(note, root),\n            \"Plain .md inside .cursor/rules is ignored by the Agents Window \"\n            \"but loaded in full by the terminal app.\",\n            \"Rename to .mdc with frontmatter if the Agents Window should see it, \"\n            \"or move it to .grok/rules.\"))\n\n    total = sum(len(read_text(p).encode()) for p in grok_md + cursor_md)\n    if total > TUI_RULE_BUDGET_BYTES:\n        findings.append(Finding(\n            \"rules\", \"medium\", \".grok/rules\",\n            \"Rules the terminal app loads every session total %d bytes.\" % total,\n            \"Trim, or move rarely used guidance into skills.\"))\n\n    if not (mdc or cursor_md or grok_md or has_agents_md):\n        findings.append(Finding(\"rules\", \"info\", \".\", \"No rules or AGENTS.md found.\"))\n    return findings\n```\n\nLook 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.\n\nTeams 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.\n\nAdd `rules` to the tuple in `checks/__init__.py`, then run the fixture:\n\n```\npython3 audit.py fixtures/sample-repo --home fixtures/fake-home\n```\n\nExpected 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`.\n\n## Step 7: Audit Hooks for Fail-Open Behavior and Payload Drift\n\nHooks 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.\n\nThe 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.\n\n``` python\nimport json\nimport re\nfrom pathlib import Path\n\nfrom .common import Finding, read_text, rel\n\n# Closest terminal-app event for each Agents Window event. Our mapping, verify with /hooks.\nCLOSEST_TUI = {\n    \"sessionStart\": \"SessionStart\", \"sessionEnd\": \"SessionEnd\",\n    \"beforeSubmitPrompt\": \"UserPromptSubmit\",\n    \"preToolUse\": \"PreToolUse\", \"postToolUse\": \"PostToolUse\",\n    \"postToolUseFailure\": \"PostToolUseFailure\",\n    \"beforeShellExecution\": \"PreToolUse\", \"afterShellExecution\": \"PostToolUse\",\n    \"beforeMCPExecution\": \"PreToolUse\", \"afterMCPExecution\": \"PostToolUse\",\n    \"beforeReadFile\": \"PreToolUse\", \"afterFileEdit\": \"PostToolUse\",\n    \"subagentStart\": \"SubagentStart\", \"subagentStop\": \"SubagentStop\",\n    \"preCompact\": \"PreCompact\", \"stop\": \"Stop\",\n}\nNO_TUI_EVENT = {\"afterAgentResponse\", \"afterAgentThought\", \"beforeTabFileRead\",\n                \"afterTabFileEdit\", \"workspaceOpen\"}\nGATING = {\"beforeShellExecution\", \"beforeMCPExecution\", \"beforeReadFile\",\n          \"preToolUse\", \"subagentStart\", \"beforeSubmitPrompt\"}\nSLOW_HINTS = re.compile(r\"\\b(curl|wget|npm|pnpm|pytest|docker|terraform|cargo)\\b\")\n\ndef _load(path: Path):\n    try:\n        return json.loads(read_text(path))\n    except json.JSONDecodeError:\n        return None\n\ndef check(root: Path, home: Path) -> list[Finding]:\n    findings = []\n    for cfg in (root / \".cursor\" / \"hooks.json\", home / \".cursor\" / \"hooks.json\"):\n        if not cfg.is_file():\n            continue\n        data = _load(cfg)\n        name = rel(cfg, root)\n        if data is None:\n            findings.append(Finding(\"hooks\", \"high\", name, \"hooks.json is not valid JSON.\",\n                                    \"Run it through jq . and fix the syntax.\"))\n            continue\n        if data.get(\"version\") != 1:\n            findings.append(Finding(\"hooks\", \"low\", name, 'Missing \"version\": 1.',\n                                    'Add \"version\": 1 at the top level.'))\n        for event, entries in (data.get(\"hooks\") or {}).items():\n            if event in NO_TUI_EVENT:\n                findings.append(Finding(\n                    \"hooks\", \"medium\", name,\n                    \"%s has no documented terminal-app event.\" % event,\n                    \"Keep it for the Agents Window and cloud agents, or drop it.\"))\n                continue\n            for entry in entries:\n                if event in GATING and not entry.get(\"failClosed\"):\n                    findings.append(Finding(\n                        \"hooks\", \"medium\", name,\n                        \"%s hook fails open in the terminal app (closest event: %s).\"\n                        % (event, CLOSEST_TUI.get(event, \"?\")),\n                        'Add \"failClosed\": true if a crash or timeout must deny.'))\n                if \"timeout\" not in entry:\n                    script = root / entry.get(\"command\", \"\").split()[0] if entry.get(\"command\") else None\n                    body = read_text(script) if script and script.is_file() else \"\"\n                    if SLOW_HINTS.search(body):\n                        findings.append(Finding(\n                            \"hooks\", \"medium\", name,\n                            \"%s hook runs a slow tool with no timeout. PreToolUse defaults to 5 s.\"\n                            % event,\n                            'Set \"timeout\" in seconds on the hook.'))\n                    if re.search(r\"jq -r ['\\\"]\\.command\", body):\n                        findings.append(Finding(\n                            \"hooks\", \"low\", rel(script, root),\n                            \"Script reads .command from stdin. The terminal app sends toolName and toolInput.\",\n                            \"Log a real payload first, then read the field it actually sends.\"))\n\n    return findings\n```\n\nThe 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.\n\nA 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.\n\n```\nmkdir -p .grok/hooks\ncat > .grok/hooks/probe.json <<'EOF'\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      { \"matcher\": \"Bash\",\n        \"hooks\": [{ \"type\": \"command\", \"command\": \"tee -a /tmp/grok-hook-payload.log > /dev/null\", \"timeout\": 10 }] }\n    ]\n  }\n}\nEOF\n# in the TUI: /hooks-trust, ask for any shell command, then\ncat /tmp/grok-hook-payload.log | jq .\n```\n\nWhatever 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.\n\nOne 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.\n\n## Step 8: Audit MCP Servers for Secrets, Collisions and Cold Starts\n\nMCP 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.\n\nThe 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.\n\n``` python\nimport json\nimport re\nimport tomllib\nfrom pathlib import Path\n\nfrom .common import Finding, read_text, rel\n\nSECRET_KEY = re.compile(r\"(key|token|secret|password|authorization)\", re.I)\nENV_REF = re.compile(r\"\\$\\{[A-Za-z_][A-Za-z0-9_]*(:-[^}]*)?\\}\")\n\ndef _json_servers(path: Path) -> dict:\n    try:\n        return json.loads(read_text(path)).get(\"mcpServers\", {})\n    except (json.JSONDecodeError, AttributeError):\n        return {}\n\ndef _toml_servers(path: Path) -> dict:\n    try:\n        return tomllib.loads(read_text(path)).get(\"mcp_servers\", {})\n    except tomllib.TOMLDecodeError:\n        return {}\n\ndef collect(root: Path, home: Path) -> list[tuple[str, str, dict]]:\n    sources = [\n        (root / \".grok\" / \"config.toml\", _toml_servers),\n        (home / \".grok\" / \"config.toml\", _toml_servers),\n        (root / \".mcp.json\", _json_servers),\n        (root / \".cursor\" / \"mcp.json\", _json_servers),\n        (home / \".cursor\" / \"mcp.json\", _json_servers),\n        (home / \".claude.json\", _json_servers),\n    ]\n    found = []\n    for path, loader in sources:\n        if path.is_file():\n            for name, cfg in loader(path).items():\n                found.append((name, str(path), cfg))\n    return found\n\ndef check(root: Path, home: Path) -> list[Finding]:\n    findings = []\n    servers = collect(root, home)\n    by_name = {}\n    for name, source, cfg in servers:\n        by_name.setdefault(name, []).append((source, cfg))\n        shown = rel(Path(source), root)\n        for field in (\"env\", \"headers\"):\n            for key, value in (cfg.get(field) or {}).items():\n                if SECRET_KEY.search(key) and isinstance(value, str) and not ENV_REF.search(value):\n                    findings.append(Finding(\n                        \"mcp\", \"high\", shown,\n                        \"%s: %s.%s holds a literal secret.\" % (name, field, key),\n                        \"Replace the value with ${VAR} and export VAR in your shell or CI.\"))\n        command = cfg.get(\"command\", \"\")\n        if command == \"npx\" and \"-y\" not in (cfg.get(\"args\") or []):\n            findings.append(Finding(\n                \"mcp\", \"low\", shown,\n                \"%s: npx without -y can hang on a first-run prompt.\" % name,\n                \"Add -y to args, and raise startup_timeout_sec for cold starts.\"))\n        if \"url\" in cfg and not cfg.get(\"headers\"):\n            findings.append(Finding(\n                \"mcp\", \"info\", shown,\n                \"%s: remote server with no static header. Expect an OAuth sign-in on first use.\" % name,\n                \"Run grok mcp doctor %s after the first login.\" % name))\n\n    for name, entries in by_name.items():\n        if len(entries) > 1 and any(e[1] != entries[0][1] for e in entries[1:]):\n            where = \", \".join(rel(Path(s), root) for s, _ in entries)\n            findings.append(Finding(\n                \"mcp\", \"medium\", where,\n                \"%s is defined %d times with different settings.\" % (name, len(entries)),\n                \"config.toml wins over compatibility files, and a project entry replaces a user one. \"\n                \"Keep a single definition.\"))\n    if not servers:\n        findings.append(Finding(\"mcp\", \"info\", \".\", \"No MCP servers found in any known location.\"))\n    return findings\n```\n\nThe 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.\n\nRemote 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.\n\nAdd `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.\n\n## Step 9: Translate Old CLI Permissions Into a [permission] Table\n\nCursor-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.\n\nThe 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.\n\n``` python\nimport json\nimport re\nfrom pathlib import Path\n\nfrom .common import Finding, read_text, rel\n\nRULE = re.compile(r\"^(\\w+)\\((.*)\\)$\")\n\ndef translate(rule: str):\n    match = RULE.match(rule)\n    if not match:\n        return None\n    kind, arg = match.groups()\n    if kind == \"Shell\":\n        return \"Bash(%s)\" % (arg if (\"*\" in arg or \" \" in arg) else arg + \" *\")\n    if kind == \"Read\":\n        return \"Read(%s)\" % arg\n    if kind == \"Write\":\n        return \"Edit(%s)\" % arg\n    if kind == \"WebFetch\":\n        return \"WebFetch(%s)\" % arg\n    if kind == \"Mcp\":\n        server, _, tool = arg.partition(\":\")\n        return \"MCPTool(%s__%s)\" % (server, tool or \"*\")\n    return None\n\ndef check(root: Path, home: Path) -> list[Finding]:\n    findings = []\n    for cfg in (root / \".cursor\" / \"cli.json\", home / \".cursor\" / \"cli-config.json\"):\n        if not cfg.is_file():\n            continue\n        try:\n            perms = json.loads(read_text(cfg)).get(\"permissions\", {})\n        except json.JSONDecodeError:\n            findings.append(Finding(\"perms\", \"high\", rel(cfg, root), \"Invalid JSON.\", \"\"))\n            continue\n        for bucket in (\"allow\", \"deny\"):\n            converted, manual = [], []\n            for rule in perms.get(bucket, []):\n                new = translate(rule)\n                (converted if new else manual).append(new or rule)\n            if converted:\n                findings.append(Finding(\n                    \"perms\", \"medium\", rel(cfg, root),\n                    \"%s rules to carry over: %s\" % (bucket, \", \".join(converted)),\n                    \"Paste into [permission] %s = [...] in .grok/config.toml and review.\" % bucket))\n            for rule in manual:\n                findings.append(Finding(\n                    \"perms\", \"medium\", rel(cfg, root),\n                    \"No known translation for %s.\" % rule,\n                    \"Rewrite by hand using the Permissions page.\"))\n    return findings\n```\n\nAfter running it, paste the converted lists into the project file. For the fixture, that gives you this:\n\n```\n# .grok/config.toml (project scope)\n[permission]\nallow = [\"Bash(git *)\", \"Read(src/**)\", \"MCPTool(linear__*)\"]\ndeny  = [\"Edit(.env*)\", \"Bash(rm -rf *)\"]\n```\n\nTwo 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 *)`.\n\nAdd `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.\n\n## Step 10: Scan Scripts, CI Files and @Mentions\n\nThis 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.\n\n``` python\nimport re\nfrom pathlib import Path\n\nfrom .common import Finding, read_text, rel, walk_files\n\nSCAN_SUFFIXES = {\".sh\", \".yml\", \".yaml\", \".json\", \".toml\", \".md\", \".mk\", \".ps1\", \".py\", \".ts\", \".js\"}\nSCAN_NAMES = {\"Makefile\", \"Dockerfile\", \"justfile\"}\n\nPATTERNS = [\n    (\"medium\", re.compile(r\"\\bcursor-agent\\b\"),\n     \"Legacy binary name.\",\n     \"Decide per pipeline: keep the old binary, or call grok.\"),\n    (\"medium\", re.compile(r\"\\bCURSOR_API_KEY\\b\"),\n     \"Cursor-era key name. The grok CLI documents XAI_API_KEY.\",\n     \"Export XAI_API_KEY for grok jobs and keep the old key only for old binaries.\"),\n    (\"medium\", re.compile(r\"--output-format[ =]stream-json\"),\n     \"grok spells it streaming-json.\",\n     \"Switch the flag value and re-test any event parser.\"),\n    (\"medium\", re.compile(r\"\\b(agent|cursor-agent)\\b[^\\n]*(\\s-f\\b|--force)\"),\n     \"Old force flag. grok uses --always-approve (alias --yolo).\",\n     \"Prefer scoped --allow/--deny rules over blanket approval.\"),\n    (\"low\", re.compile(r\"cursor\\.com/install\"),\n     \"Installer URL for the old CLI. grok installs from x.ai/cli/install.sh.\",\n     \"Pin one installer per job.\"),\n    (\"medium\", re.compile(r\"(?<![\\w.])@[Cc]ursor(?![\\w/-]|\\.\\w)\"),\n     \"@Cursor mention. The announcement moves the tag to @Build from December 7.\",\n     \"Update templates, Slack workflows and issue forms.\"),\n]\nGROK_CALL = re.compile(r\"\\bgrok\\b[^\\n]*\\s-p\\b\")\n\ndef check(root: Path, home: Path) -> list[Finding]:\n    findings = []\n    for path in walk_files(root):\n        if path.suffix not in SCAN_SUFFIXES and path.name not in SCAN_NAMES:\n            continue\n        if \".cursor\" in path.parts and path.suffix == \".mdc\":\n            continue\n        for number, line in enumerate(read_text(path).splitlines(), start=1):\n            for severity, pattern, message, fix in PATTERNS:\n                if pattern.search(line):\n                    findings.append(Finding(\n                        \"scripts\", severity, \"%s:%d\" % (rel(path, root), number), message, fix))\n            if GROK_CALL.search(line) and \"--no-auto-update\" not in line:\n                findings.append(Finding(\n                    \"scripts\", \"low\", \"%s:%d\" % (rel(path, root), number),\n                    \"Headless grok call without --no-auto-update.\",\n                    \"Add the flag, or set GROK_DISABLE_AUTOUPDATER=1 in CI.\"))\n    return findings\n```\n\nThe 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.\n\nOne 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.\n\nFinish the package by listing all five modules in `checks/__init__.py`:\n\n``` python\nfrom . import hooks, mcp, perms, rules, scripts\n\nALL_CHECKS = (rules, hooks, mcp, perms, scripts)\n```\n\nRerun 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.\n\n## Steps 11 and 12: Run the Audit, Fix Findings, Verify With grok and Gate CI\n\n### Step 11: Run it on a real repo and fix in severity order\n\nPoint 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:\n\n``` bash\n$ python3 audit.py fixtures/sample-repo --home fixtures/fake-home\n[HIGH  ] mcp     .cursor/mcp.json\n         docs: env.DOCS_API_KEY holds a literal secret.\n         fix: Replace the value with ${VAR} and export VAR in your shell or CI.\n...\nSummary: 1 high, 12 medium, 3 low, 1 info\n$ echo $?\n1\n```\n\nWork 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.\n\n```\nmkdir -p .grok/rules\nawk '/^---$/{n++; next} n>=2' .cursor/rules/react.mdc > .grok/rules/react.md\ngit mv .cursor/rules/api-guidelines.md .grok/rules/api-guidelines.md\nprintf '# Project rules\\nTerminal-app copies live in .grok/rules.\\n' > AGENTS.md\n\njq '.mcpServers.docs.env.DOCS_API_KEY = \"${DOCS_API_KEY}\"\n    | .mcpServers.docs.args = [\"-y\", \"@acme/docs-mcp\"]' \\\n  .cursor/mcp.json > /tmp/mcp.json && mv /tmp/mcp.json .cursor/mcp.json\n\njq '.hooks.beforeShellExecution[0] += {failClosed: true, timeout: 10}' \\\n  .cursor/hooks.json > /tmp/hooks.json && mv /tmp/hooks.json .cursor/hooks.json\n\ncat > .grok/config.toml <<'TOML'\n[permission]\nallow = [\"Bash(git *)\", \"Read(src/**)\", \"MCPTool(linear__*)\"]\ndeny  = [\"Edit(.env*)\", \"Bash(rm -rf *)\"]\nTOML\ngit rm -q .cursor/cli.json\n\nsed -i 's#curl https://cursor.com/install -fsS | bash#curl -fsSL https://x.ai/cli/install.sh | bash#' .github/workflows/agent.yml\nsed -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\nsed -i 's#CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}#XAI_API_KEY: ${{ secrets.XAI_API_KEY }}#' .github/workflows/agent.yml\nsed -i 's/@Cursor/@Build/' .github/PULL_REQUEST_TEMPLATE.md\n```\n\nRerun 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:\n\n``` bash\n$ python3 audit.py /tmp/fx2/sample-repo --home /tmp/fx2/fake-home\n[MEDIUM] hooks   .cursor/hooks.json\n         afterAgentResponse has no documented terminal-app event.\n...\nSummary: 0 high, 1 medium, 1 low, 1 info\n```\n\nThe 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.\n\nA 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.\n\n```\ngrok inspect --json | jq -S . > inspect.after.json\ndiff -u inspect.before.json inspect.after.json && echo \"no drift\"\n```\n\nA 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:\n\n``` bash\n#!/usr/bin/env bash\nset -euo pipefail\nrepo=\"${1:-.}\"\nout=\"$(mktemp)\"\ntrap 'rm -f \"$out\"' EXIT\n\nexport GROK_DISABLE_AUTOUPDATER=1\ngrok --no-auto-update --cwd \"$repo\" -p \"Reply with the single word ready.\" \\\n  --output-format json > \"$out\"\n\npython3 -m json.tool \"$out\" > /dev/null\necho \"headless json ok: $(wc -c < \"$out\") bytes\"\n```\n\nThe 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.\n\n### Step 12: Gate the audit in CI and write the rollback plan\n\nRun 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.\n\n```\nname: grok-migration-audit\non:\n  pull_request:\n    paths: [\".cursor/**\", \".grok/**\", \".github/**\", \"AGENTS.md\", \"scripts/**\"]\n  schedule:\n    - cron: \"17 5 * * 1\"\njobs:\n  audit:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-python@v5\n        with:\n          python-version: \"3.12\"\n      - name: Static audit\n        run: |\n          mkdir -p \"$RUNNER_TEMP/empty-home\"\n          python3 tools/grok-migration-audit/audit.py . \\\n            --home \"$RUNNER_TEMP/empty-home\" --fail-on high\n```\n\nPin the CLI version in that job the way you pin any build tool. The CLI reference documents `grok update --version <V>` for installing a specific release, so treat each new release as a change to review. A weekly run catches the quiet case, where nothing in your repo moved but the tool did, so the same files now behave differently.\n\nThe rollback plan is the tag from Step 1. If the terminal app misbehaves after you merge, `git revert` the migration branch, restore the files from `~/grok-migration-backup`, and keep calling the old binary until the audit passes again. Because you never uninstalled the old CLI, the whole rollback is two commands and takes about a minute.\n\n## Common Pitfalls During the Move\n\nMost migration incidents trace back to the same handful of assumptions. Check these before you blame the tool.\n\n- **Mirroring every .mdc rule.** A scoped rule that attached only to TSX files in the Agents Window now loads in every terminal session. Copy only the rules that should always apply, and fold the rest into`AGENTS.md` .\n- **Assuming guards fail closed.** Crashes, timeouts and malformed output allow the action in the terminal app unless`failClosed` is true, and that flag works only for`PreToolUse` and`UserPromptSubmit` . Test the failure path, not just the happy path.\n- **Trusting a repo you did not write.** The`/hooks-trust` decision, stored in`~/.grok/trusted_folders.toml` , also covers project MCP and LSP servers. Granting it is the same decision as running that repo’s scripts. Use a strict sandbox profile for unfamiliar code.\n- **Renaming or deleting `.cursor`.** The Agents Window still reads it. Move files out only when you have confirmed that nobody on the team uses the desktop app against that repo.\n- **Using `--always-approve` in CI.** Deny rules and`PreToolUse` hooks still apply, but everything else runs unprompted. Prefer a short allow list and an explicit deny list.\n- **Putting settings in the wrong config file.** Project`.grok/config.toml` contributes only MCP servers, plugins and permissions. A theme, a model default or a sandbox profile set there is silently ignored.\n- **Committing secrets with the move.** Compatibility scanning means an old`mcp.json` now feeds a new tool. Fix literal tokens before the file travels any further.\n\n## Troubleshooting: 12 Problems and Their Fixes\n\nEach item below follows the same shape: the symptom you see, the cause, and the shortest fix.\n\n1. **grok: command not found.** The installer updates your shell profile, but the current session does not see it. Open a new terminal or run`exec \"$SHELL\" -l` , then`which -a grok` .\n2. **The agent ignores your rules in the terminal app.** You probably have`.mdc` files only, and the terminal app does not read them. Copy the body to`.grok/rules/<name>.md` or into`AGENTS.md` , then run`grok inspect` to confirm the rule is discovered.\n3. **A project hook never fires.** Project hooks need trust. Run`/hooks-trust` in the TUI or launch with`--trust` . Then open the`/hooks` tab and check that the file loaded.\n4. **A guard hook crashed and the command still ran.** That is fail-open behavior. Add`\"failClosed\": true` to the hook, and remember it applies only to`PreToolUse` and`UserPromptSubmit` .\n5. **A hook works by hand but dies in the agent.** Hooks run under a default timeout, and it is easy to hit it. Set`timeout` explicitly for anything that calls the network or a test runner, and do not rely on the default for`PreToolUse` ,`PostToolUse` or`Stop` .\n6. **An MCP server will not connect.** Run`grok mcp doctor <name>` first. For stdio servers, read`~/.grok/logs/mcp/<server>.stderr.log` . Cold`npx` starts may need a higher`startup_timeout_sec` , which defaults to 30 seconds. The[Cursor MCP not loading diagnostic script](https://shattered.io/cursor-mcp-not-loading-doctor-script-12-steps-2026/) covers the editor-side equivalent.\n7. **Settings in .grok/config.toml have no effect.** The project file honors only`[mcp_servers]` ,`[plugins]` and`[permission]` . Move everything else to`~/.grok/config.toml` .\n8. **An OAuth MCP server hangs on a CI runner.** There is no browser. Use a static header with a secret, as in`--header \"Authorization: Bearer ${API_TOKEN}\"` , or pick a server that supports tokens.\n9. **A headless job stalls at start.** The background update check can race short jobs. Pass`--no-auto-update` , set`GROK_DISABLE_AUTOUPDATER=1` , or set`auto_update = false` under`[cli]` .\n10. **Your JSON event parser breaks.** The new flag value is`streaming-json` , not`stream-json` . Also remember that`json` prints one object at the end, while`streaming-json` prints newline-delimited events.\n11. **Two MCP servers share a name and one vanishes.** A project definition replaces a user definition with the same name, and`config.toml` wins over compatibility files. Run`grok inspect` to see the origin of each server and keep one definition.\n12. **The audit exits with code 1 in CI.** That is by design when a finding meets`--fail-on` . Fix the finding, or lower the threshold to`medium` or`none` for a trial week, and write down who owns the accepted risks.\n\n## Advanced Tips and the Complete Project Layout\n\n### Tighten the blast radius with sandbox profiles\n\nThe terminal app ships an optional sandbox, built on Landlock on Linux and Seatbelt on macOS. It is off by default. Permissions decide whether a tool call runs, and the sandbox limits what an approved call can touch. Pair a strict profile with narrow allow rules whenever you open a repo you did not write.\n\n| Profile | File writes | Child network | Use it for | \n|---|---|---|---|\n| `off` | Unrestricted | Allowed | Default, no sandbox | \n| `workspace` | Working directory, `~/.grok/` , temp | Allowed | Normal development | \n| `devbox` | Top-level directories except `/data` | Allowed | Cloud devbox environments | \n| `read-only` | `~/.grok/` and temp only | Blocked | Code review and auditing | \n| `strict` | Working directory, `~/.grok/` , temp | Blocked | Untrusted repositories | \n\nEnable one with `grok --sandbox workspace`, the `GROK_SANDBOX` variable, or a `[sandbox]` table in your user config. The docs flag two limits. Child-network blocking is enforced on Linux only, and the built-in profiles do not permanently protect paths such as `~/.ssh`, so add a custom deny list for credentials.\n\n### Prove your .grok files stand on their own\n\nThe compatibility scanners default to on. That is convenient, and it also hides gaps. Switch them off for one session with `GROK_CURSOR_RULES_ENABLED=0`, `GROK_CURSOR_MCPS_ENABLED=0` and `GROK_CURSOR_HOOKS_ENABLED=0`, or set the matching keys under `[compat.cursor]` in your config. Then run `grok inspect`. Anything missing is a dependency on a Cursor file you had not noticed.\n\n### Bundle the result as a plugin\n\nOnce the rules, hooks and MCP definitions are clean, package them. Cursor’s plugin docs describe plugins as bundles of rules, skills, agents, commands, MCP servers and hooks, and a [third-party walkthrough of the plugin spec](https://toris.kr/en/posts/cursor-plugins-official-spec-marketplace-guide) explains the manifest. A team marketplace then replaces copy-paste. Our [tutorial on building a team plugin bundle](https://shattered.io/cursor-plugins-team-guardrails-rules-hooks-mcp-12-steps-2026/) shows the full flow.\n\n### The complete working project\n\nEverything above assembles into one folder that you can drop into any repo under `tools/`. There are no third-party dependencies, so the CI job needs nothing beyond a stock Python.\n\n```\ntools/grok-migration-audit/\n  audit.py\n  Makefile\n  make-fixtures.sh\n  grok-audit.yml\n  checks/\n    __init__.py  common.py  rules.py  hooks.py  mcp.py  perms.py  scripts.py\n  scripts/\n    smoke.sh\n```\n\nThe five check modules each own one row group from the Step 4 table. Rules, hooks, MCP, permissions and scripts never import each other, so you can delete a module you do not need or add a sixth for plugins or skills without touching the rest.\n\nThe Makefile in that folder wraps four commands. Run `make demo` to see the fixture report, `make audit` to scan the current repo, `make drift` after any config change, and `make smoke` once your credentials are in place. When the report is clean and the smoke test passes, merge the migration branch and delete the baseline tag after a week of quiet.\n\n## FAQ\n\n**Is Cursor really called Grok Build now?** Yes. Cursor’s homepage says “Cursor is now Grok Build,” and 9to5Mac dated the change to November 30, 2026. The desktop app, agent sessions and third-party model support carry over, according to its report. Many file paths still say `.cursor`, which is why the migration is about behavior, not names.\n\n**Do my .cursor files still work in the terminal app?** Partly. The terminal app scans `.cursor/mcp.json` and `.cursor/hooks.json` by default, and it loads plain `.md` files from `.cursor/rules`. It does not read `.mdc` rules. Run `grok inspect` to see exactly what it discovers in a given directory.\n\n**Do I have to uninstall the old CLI?** No, and you should not until the audit passes. GrokShelf’s summary of the announcement says automations that call `agent` keep working as written, so the old and new binaries can coexist while you move pipelines one at a time.\n\n**Which variable authenticates headless runs?** The grok CLI documents `XAI_API_KEY` for CI and scripts, `grok login` for a local browser sign-in, and `grok login --device-auth` for SSH and remote machines.\n\n**Did pricing change with the rename?** The announcement did not mention prices, according to GrokShelf. The pricing page now reads as Grok plans and pricing, with a free tier at $0 and paid personal tiers at $8, $30, $100 and $200 a month, and it describes one subscription covering Grok Chat, Grok Build, Grok Bot and X benefits. Check your own invoice before assuming anything about legacy plans.\n\n**Does Grok Build only run Grok models?** No. 9to5Mac reports that the terminal app adopts Cursor’s agent system and adds support for models from Anthropic, Google and open models, and that third-party model support carries over in the desktop app.\n\n**What happens on December 7?** Per GrokShelf’s reading of the announcement, the work-app tag moves from @Cursor to @Build. Whether @Cursor stops working that day is unstated, so update Slack, GitHub, Linear and Jira templates now. Step 10 flags every occurrence in your repo.\n\n**Can I stop the terminal app from reading Cursor files?** Yes. Set the `[compat.cursor]` keys to false in your config, or export the `GROK_CURSOR_*_ENABLED=0` variables for one session. This is the fastest way to test whether your `.grok` setup works on its own.", "url": "https://wpnews.pro/news/cursor-is-now-grok-build-12-steps-70-min", "canonical_source": "https://shattered.io/cursor-is-now-grok-build-migration-audit-12-steps-2026/", "published_at": "2026-12-02 08:57:20+00:00", "updated_at": "2026-12-02 09:13:25.761932+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "agent-protocols"], "entities": ["SpaceX", "Cursor", "Grok Build", "9to5Mac", "GrokShelf", "x.ai", "X"], "also_reported_by": [], "takeaway": "After the Cursor-to-Grok Build rename, rules load from `*.md` in `.grok/rules`, `.cursor/rules` and `.claude/rules`, hooks from `.grok/hooks/*.json` with PascalCase events, and MCP servers from `~/.grok/config.toml`, and because the new terminal fails open where the old hook guard failed closed, a s", "recommendation": {"advice": "Audit your repo after the Grok Build rename: verify rules, hooks, MCP servers and CLI permissions still load, and add a smoke test to every pull request to catch fail-open gaps.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/cursor-is-now-grok-build-12-steps-70-min", "markdown": "https://wpnews.pro/news/cursor-is-now-grok-build-12-steps-70-min.md", "text": "https://wpnews.pro/news/cursor-is-now-grok-build-12-steps-70-min.txt", "jsonld": "https://wpnews.pro/news/cursor-is-now-grok-build-12-steps-70-min.jsonld"}}