grok-cli-runtime

grok-cli-runtime is a skill for Claude Code 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 Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions subagents; mentions Claude Code.

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 grok-cc plugin — 3 skills, 4 commands, 1 agent, 1 hook shipped together

Good fit 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.

Compare 6 skills from other repositories ↓
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 zachdunn/grok-plugin-claude-code
Claude Code
/plugin install grok-cc

Made for: Claude Code.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for grok-cli-runtime

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.00089 $0.00871
Opus 5.5 $0.00036 $0.00348
Sonnet 5.5 $0.00018 $0.00174
Haiku 4.5 $0.00009 $0.00087

Measured 1mo ago against content hash 7f032b17fb91, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (32 stars, last pushed 4mo ago), licensed MIT. It adds 89 tokens to every session and 871 once invoked, about $0.0004 per session on Opus 5.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.