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.
npx agentmods add skills/zachdunn/grok-plugin-claude-code/grok-cli-runtimenpx skills add zachdunn/grok-plugin-claude-code --skill grok-cli-runtimegit clone --depth 1 https://github.com/zachdunn/grok-plugin-claude-codeWrote 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.
[](https://agentmods.dev/skills/zachdunn/grok-plugin-claude-code/grok-cli-runtime)<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>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.
| Model | Per session | Once 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 |
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.
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 withgrok -cin 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 -fit to watch.
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.
- 3d ago First seen · 76 lines · 89 tokens per session scan A 7f032b17fb91
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.
Other skills, from other repositories
agent-browser
Use the host-side agent-browser CLI for local browser smoke tests, screenshots, snapshots, and simple UI validation against forwarded localhost URLs.
agent-desktop
Use the built-in Computer sub-agent with agent-desktop for macOS desktop automation. Apply when a task needs application launching, accessibility snapshots, stable element refs, window focusing, semantic clicks/typing, or visual confirmation outside the browser sandbox.
grok-brand-media
Prompt recipes for Grok image/video generation from Codex (OG images, README banners, launch clips).
grok-workflows
When and how to run Grok Rhai multi-agent workflows from Codex.
grok-cli-runtime
Internal helper contract for calling the grok-companion runtime from Codex.
grok-routing
When Codex should delegate to Grok vs handle work itself.