grok-preflight

grok-preflight is a command for Claude Code from xiaolai/cc-suite. It costs 29 tokens per session (588 once invoked), scanned C, original, ISC.

A local readiness check for Grok Build, xAI's coding agent. It verifies that the Grok command is installed, that authentication is available, and which models are present locally.

In plain words
What is it for?
Use it before sending work to Grok Build to check its version, login method, default model, available models, reasoning options, and sandbox levels.
Why use it?
It catches setup problems before a delegated task starts, so a missing login or executable produces an immediate useful result instead of a delayed failure.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Codex.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the cc-suite plugin — 13 skills, 39 commands, 6 agents, 3 hooks shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add xiaolai/cc-suite
Claude Code
/plugin install cc-suite

Made for: Claude Code.

Or install cc-suite, the plugin that ships this one along with the rest of its 13 skills, 39 commands, 6 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for grok-preflight

README.md
[![agentmods](https://agentmods.dev/badge/commands/xiaolai/cc-suite/grok-preflight.svg)](https://agentmods.dev/commands/xiaolai/cc-suite/grok-preflight)
Your own site
<a href="https://agentmods.dev/commands/xiaolai/cc-suite/grok-preflight"><img src="https://agentmods.dev/badge/commands/xiaolai/cc-suite/grok-preflight.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 588 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.00588
Opus 5 $0.00015 $0.00294
Sonnet 5 $0.00006 $0.00118
Haiku 4.5 $0.00003 $0.00059

Measured 6d ago against content hash cbb8fb4a6339, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade C, and why

grok-preflight scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- `grok_not_found` → install: `curl -fsSL https://x.ai/cli/install.sh | bash`

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- `grok_not_found` → install: `curl -fsSL https://x.ai/cli/install.sh | bash`
commands/grok-preflight.md · 66 lines

What it actually says

Grok Build Preflight

Verify Grok Build is ready before delegating to it. This is separate from /cc-suite:codex-preflight (Codex) and /cc-suite:agy-preflight (Antigravity).

Unlike those two, this check is fast and local — it does not round-trip to xAI. It confirms the grok binary is installed and that you're authenticated (via XAI_API_KEY or a ~/.grok/auth.json session), so /cc-suite:grok fails fast with an actionable hint instead of hanging until the job deadline when Grok isn't set up. Models are read from Grok's local cache; because Grok keeps model and effort as separate flags, reasoning_efforts is a fixed enum.

Step 1: Run the preflight script

bash "${CLAUDE_PLUGIN_ROOT}/scripts/grok-preflight.sh"

Parse the single JSON object from stdout. Keys mirror codex-preflight.sh (status, grok_version, auth_mode, default_model, models, models_detail, reasoning_efforts, sandbox_levels).

Step 2: Display results

## Grok Build Preflight Results

**Status**: {status}
**grok version**: {grok_version}
**Auth mode**: {auth_mode}   (api_key or session)
**Default model**: {default_model}

### Available Models

| Model | Description |
|-------|-------------|
| {slug} | {display_name} — {description} |

### Options

- **Reasoning efforts**: {reasoning_efforts}
- **Sandbox levels**: read-only, workspace-write, danger-full-access

Step 3: Handle errors

If status is "error", show the message and the fix keyed on error_code:

  • grok_not_found → install: curl -fsSL https://x.ai/cli/install.sh | bash
  • not_authenticatedgrok login (or set XAI_API_KEY)

This is a local readiness check: it confirms the binary and that credentials exist, not that the token is still valid. An expired session still surfaces at call time as a failed/stalled job.

Step 4: Summary

  • Ready: "Grok is ready. Default model: {default_model}."
  • Error: "Grok is not ready — {error}. Fix above, then retry."
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 66 lines · 29 tokens per session scan C cbb8fb4a6339

Subscribe to this mod's changes

grok-preflight is a command published in the GitHub repository xiaolai/cc-suite (44 stars, last pushed 3d ago), licensed ISC. It adds 29 tokens to every session and 588 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.