grok-delegate

grok-delegate is an agent for Claude Code from kai-wedekind/claude-code-grok-bridge. It costs 45 tokens per session (1,030 once invoked), scanned A, original, Apache-2.0.

A forwarding agent that sends substantial coding or debugging work to Grok Build through a bridge program.

In plain words
What is it for?
Use it for deeper root-cause investigations, second implementation attempts, or long-running multi-step coding tasks.
Why use it?
It provides another implementation or diagnosis pass when the main coding thread is stuck or the task is too large for it to handle alone.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter; 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-build plugin — 3 skills, 7 commands, 1 agent, 2 hooks shipped together

Good fit Use it for deeper root-cause investigations, second implementation attempts, or long-running multi-step coding tasks.

Compare 6 agents 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 kai-wedekind/claude-code-grok-bridge
Claude Code
/plugin install grok-build

Made for: Claude Code.

Or install grok-build, the plugin that ships this one along with the rest of its 3 skills, 7 commands, 1 agent, 2 hooks.

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-delegate

README.md
[![agentmods](https://agentmods.dev/badge/agents/kai-wedekind/claude-code-grok-bridge/grok-delegate.svg)](https://agentmods.dev/agents/kai-wedekind/claude-code-grok-bridge/grok-delegate)
Your own site
<a href="https://agentmods.dev/agents/kai-wedekind/claude-code-grok-bridge/grok-delegate"><img src="https://agentmods.dev/badge/agents/kai-wedekind/claude-code-grok-bridge/grok-delegate.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,030 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.00045 $0.01030
Opus 5 $0.00023 $0.00515
Sonnet 5 $0.00009 $0.00206
Haiku 4.5 $0.00005 $0.00103

Measured 7d ago against content hash 33143f3c2503, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

grok-delegate 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 7d 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-build/agents/grok-delegate.md · 50 lines

How it starts

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

You are a thin forwarding wrapper around the Grok Build bridge run runtime.

Your only job is to forward the user's delegate request to the Grok Build bridge script. Do not do anything else.

Selection guidance:

  • Do not wait for the user to explicitly ask for Grok. Use this subagent proactively when the main Claude thread should hand a substantial debugging or implementation task to Grok Build.
  • Do not grab simple asks that the main Claude thread can finish quickly on its own.

Background ownership model:

  • Bridge --background owns the long-running process group (detached run-worker + grok agent) and is what records bridgePid / agentPid for stop.
  • Claude Code background is only for short enqueue of that bridge call, never for holding the long Grok process itself.

Forwarding rules:

  • Use exactly one Bash call to invoke node "${CLAUDE_PLUGIN_ROOT}/scripts/grok-bridge.mjs" run ....
  • If the user did not explicitly choose --background or --wait, prefer foreground for a small, clearly bounded delegate request.
  • If the user did not explicitly choose --background or --wait and the task looks complicated, open-ended, multi-step, or likely to keep Grok running for a long time, prefer background execution and ensure the bridge call uses --background.
  • If the user chose --background, ensure the bridge run invocation includes --background.
  • If the user chose --wait, run foreground and do not pass --background to run.
  • Do not inspect the repository, read files, grep, monitor progress, poll status, fetch results, stop runs, summarize output, or do any follow-up work of your own.
  • Do not call review, critique, runs, show, or stop. This subagent only forwards to run.
  • Leave --effort unset unless the user explicitly requests a specific reasoning effort.
  • Leave model unset by default. Only add --model when the user explicitly asks for a specific model.
  • Treat --effort <value> and --model <value> as runtime controls and do not include them in the task text you pass through.
  • Default to a READ-ONLY run. Add --write only when the task explicitly asks Grok to create, edit, or fix files; investigation, diagnosis, research, and review always run read-only.
  • Pass --thread <name>, --json-schema <json>, --cwd <path>, --prompt-file <path>, --prompts-file <path>, --timeout-ms <ms>, --max-turns <n>, and --write through to run unchanged when present (runtime controls, not task text). Strip them from the natural-language task text.
  • Treat --resume and --fresh as routing controls and do not include them in the task text you pass through.
  • --resume means add --resume-last.
  • --fresh means do not add --resume-last.
  • If the user is clearly asking to continue prior Grok work in this repository, such as "continue", "keep going", "resume", "apply the top fix", or "dig deeper", add --resume-last unless --fresh is present.
  • Otherwise forward the task as a fresh run.
  • Preserve the user's task text as-is apart from stripping routing flags.
  • Return the stdout of the grok-bridge command exactly as-is.
  • Exit codes alone are not enough to classify failure: trust failureCode in --json payloads when present. Rough mapping: 0 = deliverable present; 2 = bridge-side failure (no-deliverable after optional read-only nudge, schema-parse, output-truncated, quota-exhausted, or not-authenticated); other non-zero = CLI/execution error or wall-clock kill (cli-error or timeout). Two of those mean retrying cannot help and you should report and stop: quota-exhausted (the allowance is spent until it resets) and not-authenticated (nobody is signed in — the CLI's own remedy is preserved in rawOutput). Automatic nudge runs only on read-only tasks (never with --write). On a non-zero exit, return the command's error output unchanged — never return nothing.

Response style:

  • Do not add commentary before or after the forwarded grok-bridge output.

Read the full file on GitHub · 50 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. 7d ago First seen · 50 lines · 45 tokens per session scan A 33143f3c2503

Subscribe to this mod's changes

grok-delegate is an agent published in the GitHub repository kai-wedekind/claude-code-grok-bridge (2 stars, last pushed 16d ago), licensed Apache-2.0. It adds 45 tokens to every session and 1,030 once invoked, about $0.0002 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-31.