grok-cli-runtime

grok-cli-runtime is a skill for Claude Code, Codex from zachdunn/grok-plugin-claude-code. It costs 89 tokens per session (871 once invoked), scanned A, original, MIT.

A runtime helper for sending coding, debugging, or review tasks to the Grok command-line tool. It runs Grok in a separate, one-shot process and returns the result to Claude Code.

In plain words
What is it for?
Use it to check whether Grok is installed and signed in, then forward tasks to Grok in either write-capable or read-only runs. It also supports headless use by other rescue or delegation commands.
Why use it?
It provides one predictable way to delegate work without manually calling Grok or handling its process output yourself.

Skill for Claude CodeCodex

Part of the grok-cc plugin — 3 skills, 4 commands, 1 agent, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/zachdunn/grok-plugin-claude-code/grok-cli-runtime
Any agent
npx skills add zachdunn/grok-plugin-claude-code --skill grok-cli-runtime
Clone the repo
git clone --depth 1 https://github.com/zachdunn/grok-plugin-claude-code

Made for: Claude Code, Codex.

Or install grok-cc, the plugin that ships this one along with the rest of its 3 skills, 4 commands, 1 agent, 1 hook.

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-cli-runtime

README.md
[![agentmods](https://agentmods.dev/badge/skills/zachdunn/grok-plugin-claude-code/grok-cli-runtime.svg)](https://agentmods.dev/skills/zachdunn/grok-plugin-claude-code/grok-cli-runtime)
Your own site
<a href="https://agentmods.dev/skills/zachdunn/grok-plugin-claude-code/grok-cli-runtime"><img src="https://agentmods.dev/badge/skills/zachdunn/grok-plugin-claude-code/grok-cli-runtime.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 871 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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 $0.00089 $0.00871
Opus 5 $0.00044 $0.00436
Sonnet 5 $0.00018 $0.00174
Haiku 4.5 $0.00009 $0.00087

Measured 3d ago against content hash 7f032b17fb91, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

grok-cli-runtime scanned grade A with 0 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 3d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/grok-cc/skills/grok-cli-runtime/SKILL.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Grok CLI runtime

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.

The one entry point

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.

Readiness

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.

Delegating a task

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

Foreground vs background

  • Foreground (default): small, bounded asks. The companion waits, parses the JSON result, and prints text + sessionId. Continue the thread later with grok -c in the same directory.
  • Background (--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.

Read the full file on GitHub · 76 lines

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. 3d ago First seen · 76 lines · 89 tokens per session scan A 7f032b17fb91

Subscribe to this mod's changes

grok-cli-runtime is a skill published in the GitHub repository zachdunn/grok-plugin-claude-code (29 stars, last pushed 2mo ago), licensed MIT. It adds 89 tokens to every session and 871 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.