dispatch

A command that sends a task to a Cursor coding agent, another AI assistant for editing software projects. It can edit the current project directly or use an isolated copy, and can run in the foreground or background.

In plain words
What is it for?
Use it to dispatch tasks to Cursor, choose direct or isolated editing, and wait for the result or run the task in the background.
Why use it?
It hands work to Cursor without manually copying the task or choosing the execution setup each time.

Command

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/ningzio/cursor-plugin-cc/dispatch
Clone the repo
git clone --depth 1 https://github.com/ningzio/cursor-plugin-cc
Per session 18 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,243 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.00018 $0.01243
Opus 5 $0.00009 $0.00622
Sonnet 5 $0.00004 $0.00249
Haiku 4.5 $0.00002 $0.00124

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

Security

Grade A, and why

dispatch 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 yesterday.

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/cursor/commands/dispatch.md · 77 lines

How it starts

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

Forward the user request to the cursor:cursor-dispatch subagent. The subagent invokes cursor-companion.mjs dispatch once via the --raw-args-stdin channel (codex F2 — $ARGUMENTS may contain shell metacharacters; never interpolate it into a bash pipeline) and returns stdout verbatim.

Sandbox model (v0.3+): by default, cursor edits the caller's cwd directly (--in-place). Commits land on the current branch — no cherry-pick needed. Pass --isolated to opt into the legacy .cursor/worktrees/<jobId> sandbox with auto-commit to a <jobId> branch. --background defaults to --isolated (a background agent racing your edits is dangerous); pass --in-place explicitly to override.

Raw user request: $ARGUMENTS

Routing rules:

  • If the request contains --wait, run the subagent in foreground.
  • If the request contains --background, run the subagent in background (Agent({..., run_in_background: true})).
  • Otherwise, decide based on prompt size:
    • For tiny / clearly bounded tasks, recommend --wait.
    • For multi-step / open-ended / "this could take a while" tasks, recommend --background.
    • When in doubt, recommend --background.
    • Use AskUserQuestion exactly once with two options:
      • Wait for results
      • Run in background
    • Put the recommended option first and suffix its label with (Recommended).

Mode routing (cursor-agent supports plan, ask, agent):

  • If the request already contains --mode <plan|ask|agent> or --plan-only, do not ask — honor it.
  • Otherwise infer from intent and ask the user once via AskUserQuestion:
    • Pure question / explanation / read-only inspection ("what does X do", "why is Y", "解释一下", "看看") → recommend Ask only (read-only Q&A) first.
    • Wants a written plan or design before any edit ("draft a plan", "先出个方案", "怎么改") → recommend Plan only (no edits) first.
    • Wants the agent to actually do the work ("fix", "implement", "改一下", "动手") → recommend Agent (default, may edit) first.
    • When in doubt, recommend Agent (default, may edit) first.
  • Three options total; never offer more.
  • On Ask only, append --mode ask to the forwarded text.
  • On Plan only, append --mode plan.
  • On Agent, append nothing (default).

Model routing:

  • If the request already contains --model <m>, leave it untouched.
  • If the request contains --resume <jobId>, append nothing — the existing cursor thread already has a bound model.
  • Otherwise silently append --model auto. auto is cursor's per-request router (visible in cursor-agent --list-models), so the slash command never enumerates specific model IDs and never goes stale as cursor's lineup changes. Users wanting a specific model can override with --model <id>; run cursor-agent --list-models to see currently available IDs.

Resume routing:

  • If the request contains --resume or --fresh, do not ask.
  • Otherwise, run:
    node "${CLAUDE_PLUGIN_ROOT}/scripts/cursor-companion.mjs" dispatch-resume-candidate --json
    
    • If available: true, ask the user (AskUserQuestion) whether to continue the previous cursor thread or start a new one.
    • Choices:
      • Continue current cursor thread
      • Start a new dispatch
    • If the user's request reads like a follow-up ("再", "继续", "调整一下", "基础上", "another pass"), put Continue current cursor thread (Recommended) first.
    • Otherwise put Start a new dispatch (Recommended) first.
    • On Continue, append --resume <returned-jobId> to the forwarded text.
    • On Start a new dispatch, append --fresh.

Forwarding (codex F2 — the full forwarded text goes on stdin via a heredoc; sh never re-evaluates it):

Pass the prompt + flags to the subagent through stdin. The subagent runs:

node "${CLAUDE_PLUGIN_ROOT}/scripts/cursor-companion.mjs" dispatch --raw-args-stdin <<'__CURSOR_RAW_ARGS_END_a8f3c91d4b__'
<the full forwarded request, including any --resume/--fresh/--wait/--background/--isolated/--in-place/--mode you appended>
__CURSOR_RAW_ARGS_END_a8f3c91d4b__

Read the full file on GitHub · 77 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. yesterday First seen · 77 lines · 18 tokens per session scan A 3f41ce3f6d48

Subscribe to this mod's changes

dispatch is a command published in the GitHub repository ningzio/cursor-plugin-cc (2 stars, last pushed 3mo ago), licensed MIT. It adds 18 tokens to every session and 1,243 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.