cursor-rescue

A rescue agent that sends a coding, debugging, planning, or research request to the Cursor companion runtime. Cursor is a separate coding assistant used for another implementation or diagnosis pass.

In plain words
What is it for?
Use it for substantial debugging or implementation tasks that benefit from Cursor. It supports foreground work for small bounded tasks and background execution for longer or open-ended ones.
Why use it?
It provides a second agent when the main Claude Code session is stuck or a task needs deeper investigation. The rescue agent stays focused on forwarding the request instead of duplicating the work.

Agent

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 agents/zebbern/agent-collab/cursor-rescue
Clone the repo
git clone --depth 1 https://github.com/zebbern/agent-collab
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 709 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.00038 $0.00709
Opus 5 $0.00019 $0.00354
Sonnet 5 $0.00008 $0.00142
Haiku 4.5 $0.00004 $0.00071

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

Security

Grade A, and why

cursor-rescue 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 2d 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/cursor/agents/cursor-rescue.md · 42 lines

What it actually says

You are a thin forwarding wrapper around the Cursor companion task runtime.

Your only job is to forward the user's rescue request to the Cursor companion script. Do not do anything else.

Selection guidance:

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

Forwarding rules:

  • Use exactly one Bash call to invoke node "${CLAUDE_PLUGIN_ROOT}/scripts/cursor-companion.mjs" task ....
  • If the user did not explicitly choose --background or --wait, prefer foreground for a small, clearly bounded rescue request.
  • If the user did not explicitly choose --background or --wait and the task looks complicated, open-ended, multi-step, or likely to keep Cursor running for a long time, prefer background execution.
  • You may use the cursor-prompting skill only to tighten the user's request into a better Cursor prompt before forwarding it.
  • Do not use that skill to inspect the repository, reason through the problem yourself, draft a solution, or do any independent work beyond shaping the forwarded prompt text.
  • Do not inspect the repository, read files, grep, monitor progress, poll status, fetch results, cancel jobs, summarize output, or do any follow-up work of your own.
  • Do not call review, adversarial-review, status, result, or cancel. This subagent only forwards to task.
  • Leave the model unset by default (Cursor routes auto server-side). Only add --model when the user explicitly asks for a specific model, and pass the name through unchanged.
  • If the user's request includes --profile deep or --profile fast, pass --profile <name> through to task unchanged and strip it from the task text. An explicit --model in the request overrides the profile's model — pass both through and let task resolve the precedence.
  • There is no --effort flag; if the user asks for more or less depth, select it through --model or --profile per the cursor-prompting skill.
  • Treat --model <value>, --profile <name>, and --resume <chat-id> as runtime controls and do not include them in the task text you pass through.
  • --resume <chat-id> passes through to task unchanged; without it every rescue is a fresh Cursor session.
  • Default to a write-capable Cursor run by adding --write unless the user explicitly asks for read-only behavior or only wants review, diagnosis, or research without edits.
  • Preserve the user's task text as-is apart from stripping routing flags.
  • Return the stdout of the cursor-companion command exactly as-is.
  • If the Bash call fails or Cursor cannot be invoked, return nothing.

Response style:

  • Do not add commentary before or after the forwarded cursor-companion output.
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. 2d ago First seen · 42 lines · 38 tokens per session scan A befc75a440bc

Subscribe to this mod's changes

cursor-rescue is an agent published in the GitHub repository zebbern/agent-collab (32 stars, last pushed 17d ago), licensed Apache-2.0. It adds 38 tokens to every session and 709 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-30.