delegate

delegate is a command for coding agents from dashpot4/grok-plugin-for-claude. It costs 19 tokens per session (2,352 once invoked), scanned A, original, Apache-2.0.

A command for sending a request to a separate Grok-based coding assistant for investigation, fixes, or follow-up work.

In plain words
What is it for?
Use it to delegate debugging, code changes, research, or follow-up tasks to the Grok assistant.
Why use it?
It lets another assistant handle a defined piece of work instead of doing every task in the current session.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the grok plugin — 2 skills, 17 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 commands/dashpot4/grok-plugin-for-claude/delegate
Clone the repo
git clone --depth 1 https://github.com/dashpot4/grok-plugin-for-claude

Or install grok, the plugin that ships this one along with the rest of its 2 skills, 17 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 delegate

README.md
[![agentmods](https://agentmods.dev/badge/commands/dashpot4/grok-plugin-for-claude/delegate.svg)](https://agentmods.dev/commands/dashpot4/grok-plugin-for-claude/delegate)
Your own site
<a href="https://agentmods.dev/commands/dashpot4/grok-plugin-for-claude/delegate"><img src="https://agentmods.dev/badge/commands/dashpot4/grok-plugin-for-claude/delegate.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,352 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.00019 $0.02352
Opus 5 $0.00010 $0.01176
Sonnet 5 $0.00004 $0.00470
Haiku 4.5 $0.00002 $0.00235

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

Security

Grade A, and why

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 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/commands/delegate.md · 103 lines

How it starts

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

Raw user request: $ARGUMENTS

Execution mode:

  • If the request includes --no-subagents, do not invoke the grok:grok-delegate subagent. Run grok-companion.mjs task directly via Bash instead (see Direct companion flow below).
  • If the request does not include --no-subagents, invoke the grok:grok-delegate subagent via the Agent tool (subagent_type: "grok:grok-delegate"), forwarding the raw user request as the prompt.
  • grok:grok-delegate is a subagent, not a skill — do not call Skill(grok:grok-delegate) or Skill(grok:delegate) (that re-enters this command and hangs the session). The command runs inline so the Agent tool stays in scope; forked general-purpose subagents do not expose it.
  • The final user-visible response must be Grok's output verbatim.

Subagent path (default):

  • Always invoke the grok:grok-delegate subagent in the foreground (do not use the Agent tool's run_in_background). The subagent runs Grok and returns the answer, so the result is delivered to you in-band.
  • Default (and --wait): the subagent runs grok-companion.mjs task in the foreground and returns Grok's full answer. This is the right choice for almost every delegation. It is bounded by the Bash tool's ~10-minute limit; if a task is likely to run longer, use --background.
  • --background: the user is opting into a long-running or fire-and-forget run. The subagent forwards --background to task, which launches a detached worker and returns a job id immediately (not the answer). Surface that job id and tell the user to retrieve the result with /grok:status <id> and /grok:result <id>. --background survives arbitrarily long Grok runs.
  • --wait and --background are execution-mode flags — strip them from the natural-language task text. --wait is the default and is not passed to task; --background is passed through to task.
  • --model, --effort, --disable-web-search, --no-web, and --web are runtime-selection flags. Preserve them for the forwarded task call, but do not treat them as part of the natural-language task text. Workspace defaults (from /grok:model, /grok:web, /grok:effort) are applied automatically if no explicit flag.
  • Effort can also be requested in natural language. Scan the raw request for phrases indicating desired effort level and ensure the corresponding flag is present:
    • "grok max", "max mode", "max effort", "grok max 모드", "맥스", "최대 effort", "highest", "maximum" → --effort max
    • "xhigh", "extra high", "매우 높음" → --effort xhigh
    • "high effort", "높은 effort" → --effort high
    • Similar for medium/low. If natural language indicates effort but no explicit --effort is present, insert the flag (e.g. prepend --effort max) before forwarding to the subagent or building the direct task command. Prefer any explicit --effort over inferred.
  • Advanced Grok features: Dedicated commands exist for convenience (/grok:image, /grok:edit-image, /grok:video, /grok:edit-video, /grok:vision, /grok:tts, /grok:stt). You can still use natural language in this command. Detect common patterns and forward accurately:
    • Image: "generate image", "grok generate image", "create image of", "grok image"
    • Edit image: "edit image at PATH", "modify image", "grok edit image ./file.jpg to ..."
    • Analyze/vision: "analyze image at PATH", "grok vision", "describe image ./screenshot.png", "grok analyze image"
    • Video: "generate video", "grok generate video", "edit video ./clip.mp4"
    • File upload: "upload file", "grok upload file at ./report.pdf"
    • Brainstorm/search: "brainstorm ideas", "grok search for", "grok search x for"
    • Code/calc: "run code", "calculate", "grok calculate" Always preserve exact file paths mentioned (e.g. ./photo.jpg, /absolute/path/video.mp4). Do not rewrite or summarize paths.
  • Permission and file handling guidance (important for Claude to manage safely):
    • When the request touches files/folders (read for vision/analysis, write for edit/generate), keep paths verbatim.
    • For read-only analysis/vision/describe: Forward as-is; Grok binary will attempt read access based on current user/shell permissions.
    • For modifications/generation that may save files: Ensure write-capable delegation (default behavior adds --write). If user might not want auto-approve, consider --no-subagents or note it.
    • If permission issues are likely (e.g., restricted dirs, read-only workspace), include explicit notes in the forwarded prompt like "Note: access may require user approval for file X".
    • Claude (main session) should handle approvals for the initial delegation Bash call. For internal Grok approvals during execution, they will appear in the returned output.
    • Prefer absolute paths when possible for reliability, but respect user's provided relative paths.
    • Never assume files are accessible; if the task involves specific files, the prompt must contain the paths so Grok can reference them.
  • Web search is disabled by default for this workspace. Pass --web only when the user explicitly wants web search for this run. Pass --no-web to force-disable even when the workspace default is on.
  • If the request includes --resume, do not ask whether to continue. The user already chose.
  • If the request includes --fresh, do not ask whether to continue. The user already chose.
  • Otherwise, before starting Grok, check for a resumable delegate thread from this Claude session by running:

Read the full file on GitHub · 103 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 · 103 lines · 19 tokens per session scan A 88d4d51386b5

Subscribe to this mod's changes

delegate is a command published in the GitHub repository dashpot4/grok-plugin-for-claude (4 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 19 tokens to every session and 2,352 once invoked, about $0.0001 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.