/grok-cc:grok-cli-runtimefrom grok-cc
Delegates coding, debugging, or review tasks to the Grok CLI via a companion script. Covers task vs read-only runs, foreground vs background execution, and routing flags like --effort, --model, --best-of-n, and --worktree.
Ships in grok-cc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Delegate work to the Grok CLI through one companion script. The companion wraps
Grok's headless -p/--single mode (a one-shot process that prints a JSON result
and exits) so Claude Code gets a clean, non-blocking hand-off.
Always invoke the companion — never call grok directly from the delegation
path:
node "${CLAUDE_PLUGIN_ROOT}/scripts/grok-companion.mjs" <setup|task> [args]
${CLAUDE_PLUGIN_ROOT} resolves to this plugin's root, so the path is portable.
node "${CLAUDE_PLUGIN_ROOT}/scripts/grok-companion.mjs" setup
Reports the resolved grok binary, version, and whether ~/.grok/auth.json
exists (sign-in state). Exit 0 = ready. If not signed in, the user runs
! grok login themselves (interactive). Add --json for machine-readable output.
node "${CLAUDE_PLUGIN_ROOT}/scripts/grok-companion.mjs" task [routing flags] "<task text>"
The task text is the trailing argument. Routing flags come first and are stripped before the text reaches Grok:
| Flag | Effect |
|---|---|
| (default) | write-capable run — Grok may edit files (--always-approve, non-blocking) |
--read | read-only — plan mode; Grok reads and reasons but does not mutate |
--background | spawn detached; returns a pid + log path instead of waiting |
--effort <level> | low | medium | high | xhigh | max |
--model <id> | pin a specific Grok model (omit to use the default) |
--cwd <path> | working directory (defaults to the current directory) |
--best-of-n <N> | run the task N ways in parallel, keep the best |
--check | append a self-verification pass to the run |
--worktree [name] | run inside a fresh git worktree |
--resume | continue the most recent Grok session in this directory |
text + sessionId. Continue the thread later with
grok -c in the same directory.--background): long, open-ended, or multi-step work. The
companion spawns a detached process, prints the pid and a log file path, and
returns immediately. The full JSON result lands in the log when Grok finishes;
tail -f it to watch.AuthorizationRequired lines on stderr from a
background worker even on success. The companion keys off the exit code and
stdout JSON, not stderr, and only surfaces stderr on failure. Do the same if
you ever read Grok output directly.--background + the log
file, or grok sessions / grok -c, to follow up.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub zachdunn/grok-plugin-claude-code --plugin grok-cc3 skills in this plugin
/grok-promptingHow to shape a good prompt before delegating to Grok via the grok-rescue subagent or /grok-cc:rescue. Use when tightening a vague user request into a crisp Grok task. Covers stating the goal, constraints, acceptance criteria, and scope so a one-shot headless Grok run succeeds./grok-result-handlingInternal guidance for presenting Grok companion output (delegate results and reviews) back to the userOther plugins' skills for the same job