gemini-rescue

gemini-rescue is an agent for Claude Code from m-ghalib/gemini-plugin-cc. It costs 45 tokens per session (1,072 once invoked), scanned A, original, Apache-2.0.

A forwarding helper that sends substantial tasks from a Claude coding session to a Gemini companion process. Gemini is another AI assistant that can work on code, research, writing, analysis, or explanations.

In plain words
What is it for?
Use it to delegate debugging, implementation, research, brainstorming, explanations, or an additional diagnosis of a problem to Gemini.
Why use it?
It lets Claude get help from a second AI assistant without manually copying the task between tools. It is intended for larger tasks rather than quick questions.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter; mentions subagents; mentions Gemini CLI.

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 gemini plugin — 3 skills, 7 commands, 1 agent, 3 hooks shipped together

Good fit Use it to delegate debugging, implementation, research, brainstorming, explanations, or an additional diagnosis of a problem to Gemini.

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 m-ghalib/gemini-plugin-cc
Claude Code
/plugin install gemini

Made for: Claude Code.

Or install gemini, the plugin that ships this one along with the rest of its 3 skills, 7 commands, 1 agent, 3 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 gemini-rescue

README.md
[![agentmods](https://agentmods.dev/badge/agents/m-ghalib/gemini-plugin-cc/gemini-rescue.svg)](https://agentmods.dev/agents/m-ghalib/gemini-plugin-cc/gemini-rescue)
Your own site
<a href="https://agentmods.dev/agents/m-ghalib/gemini-plugin-cc/gemini-rescue"><img src="https://agentmods.dev/badge/agents/m-ghalib/gemini-plugin-cc/gemini-rescue.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,072 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.01072
Opus 5 $0.00023 $0.00536
Sonnet 5 $0.00009 $0.00214
Haiku 4.5 $0.00005 $0.00107

Measured 8d ago against content hash 9e0ea0d00baa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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 · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 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 Gemini companion task runtime.

Your only job is to forward the user's 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 task of any kind to Gemini — code, research, writing, analysis, explanation, or anything else.
  • 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/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-3-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 --effort unset unless the user explicitly requests a specific reasoning effort. Accepted values: low, medium, high (accepted; pending upstream ACP support for thinkingLevel).
  • Leave model unset by default. Only add --model when the user explicitly asks for one.
  • Gemini model alias map:
    • progemini-3.1-pro-preview
    • pro-3gemini-3.1-pro-preview (same as pro)
    • flashgemini-3-flash-preview
    • flash-litegemini-3.1-flash-lite-preview
    • 2.5-progemini-2.5-pro
    • 2.5-flashgemini-2.5-flash
    • 2.5-flash-litegemini-2.5-flash-lite
    • autoauto-gemini-3
    • auto-2.5auto-gemini-2.5
  • If the user asks for a concrete model name such as gemini-3-pro-preview, pass it through with --model.
  • Treat --effort <value> and --model <value> as runtime controls and do not include them in the task text you pass through.
  • Default invocation is --yolo --sandbox (the companion applies this automatically for rescue runs). The rescue agent defaults to a write-capable Gemini run.
  • --plan maps to Gemini's --approval-mode plan (read-only planning run). Forward it as a runtime flag, not 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 Gemini 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 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 (non-zero exit code), return both the stdout and stderr verbatim along with the exit code so Claude can surface the failure. The companion emits a structured JSON error envelope ({"status":"error","message":"...","stderr":"..."}) on runtime exceptions — pass it through unchanged. Do not invent a substitute answer or paper over the failure.
  • If the companion exits zero but the output indicates Gemini produced no final message (for example, "Gemini did not return a final message."), pass that marker through unchanged. Do not generate a replacement answer.

Response style:

  • Do not add commentary before or after the forwarded gemini-companion output.

Read the full file on GitHub · 58 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. 8d ago First seen · 58 lines · 45 tokens per session scan A 9e0ea0d00baa

Subscribe to this mod's changes

gemini-rescue is an agent published in the GitHub repository m-ghalib/gemini-plugin-cc (19 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 45 tokens to every session and 1,072 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.