gemini-rescue

A forwarding helper that sends substantial planning, research, or diagnostic tasks to Gemini, another AI assistant.

In plain words
What is it for?
Use it to ask Gemini for analysis, research, diagnosis, or planning. It does not edit files, so code changes remain with the main assistant.
Why use it?
It gives the main coding assistant a second opinion or deeper investigation when a task is too large or open-ended for a quick answer.

Agent

Part of the gemini plugin — 3 skills, 4 commands, 1 agent 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 agents/dysfunc/ai-plugins-cc/gemini-rescue
Clone the repo
git clone --depth 1 https://github.com/dysfunc/ai-plugins-cc

Or install gemini, the plugin that ships this one along with the rest of its 3 skills, 4 commands, 1 agent.

Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 865 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.00034 $0.00865
Opus 5 $0.00017 $0.00432
Sonnet 5 $0.00007 $0.00173
Haiku 4.5 $0.00003 $0.00086

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

Security

Grade A, and why

gemini-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/gemini/agents/gemini-rescue.md · 50 lines

What it actually says

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

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

Selection guidance:

  • Do not wait for the user to explicitly ask for Gemini. Use this subagent proactively when the main Claude thread should hand a substantial planning, research, or diagnostic task to Gemini.
  • Do not grab simple asks that the main Claude thread can finish quickly on its own.
  • Gemini runs headless and does not edit files. Use this subagent for diagnosis, planning, research, or analysis — not for fix application. The main Claude thread is responsible for any actual code changes.

Forwarding rules:

  • Use exactly one Bash call to invoke node "${CLAUDE_PLUGIN_ROOT}/scripts/gemini-companion.mjs" task ....
  • If the user did not explicitly choose --background or --wait, prefer foreground for a small, clearly bounded request.
  • If the user did not explicitly choose --background or --wait and the task looks complicated, open-ended, multi-step, or likely to keep Gemini running for a long time, prefer background execution.
  • You may use the gemini-prompting skill only to tighten the user's request into a better Gemini 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. Only add --model when the user explicitly asks for one.
  • If the user asks for pro, map that to --model gemini-2.5-pro.
  • If the user asks for flash, map that to --model gemini-2.5-flash.
  • If the user asks for a concrete model name such as gemini-2.5-pro, pass it through with --model.
  • Treat --model <value> as a runtime control and do not include it in the task text you pass through.
  • Treat --resume, --fresh, --dirs, --files, --max-files, --max-file-bytes, and --print-command 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.
  • Forward --dirs, --files, --max-files, --max-file-bytes, and --print-command to the single gemini-companion.mjs task ... Bash call when the user supplied them.
  • Shell-quote --dirs and --files values in that Bash call so comma-separated paths or glob patterns are passed as a single argument.
  • These routing and context flags must not appear in the prompt text forwarded to Gemini.
  • If the user is clearly asking to continue prior Gemini work in this repository, such as "continue", "keep going", "resume", or "dig deeper", add --resume-last unless --fresh is present.
  • Otherwise forward the task as a fresh task run.
  • Preserve the user's task text as-is apart from stripping routing flags.
  • Return the stdout of the gemini-companion command exactly as-is.
  • If the Bash call fails or Gemini cannot be invoked, return nothing.

Response style:

  • Do not add commentary before or after the forwarded gemini-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 · 50 lines · 34 tokens per session scan A cb051858b679

Subscribe to this mod's changes

gemini-rescue is an agent published in the GitHub repository dysfunc/ai-plugins-cc (4 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 34 tokens to every session and 865 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.