grok-plugin-cc
Claude Code review and rescue workflows backed by Grok Build
- JavaScript
- Shell
- Claude Code Plugin SDK
- Grok Build CLI
A Claude Code plugin that delegates code review, adversarial review, and coding rescue tasks to Grok through xAI's official Grok Build CLI.
Problem
How do you bring Claude Code review and rescue workflows to a hosted frontier model without reimplementing an agent runtime, while keeping billing, safety gates, and setup explicit?
Approach
The plugin is a thin broker between Claude Code commands and xAI’s official grok CLI in headless mode (grok -p ... --output-format json). Setup stores only the selected model id; authentication stays with grok login. The earlier attempt to drive Grok through Codex custom provider overrides was abandoned: Codex 0.142.0 requires wire_api=responses, and xAI rejected Codex’s agent tool declaration at /v1/responses. The current harness uses Grok Build directly.
/grok:setup lists CLI models, configures a default, and smoke-tests the headless path. /grok:review and /grok:adversarial-review run with a read-oriented sandbox, explicit write/edit deny rules, structured JSON findings, and schema validation. /grok:rescue is confirmation-gated and billed, then followed by post-hoc diff-safety checks.
Background job commands (/grok:status, /grok:result, and /grok:cancel) reuse the same job store pattern as the local-model sibling plugin.
Outcome
A hosted-Grok counterpart to local-model-plugin-cc that keeps Claude Code as the command surface, Grok Build as the execution engine, and safety/billing caveats visible in the workflow.
Architecture
Claude Code commands call broker scripts in the plugin package, which spawn the grok CLI with mode-specific sandbox, schema, deny-rule, and max-turns flags. Automated tests use Node’s built-in test runner and a fake grok binary so CI never needs a live xAI account.