rescue-stream

rescue-stream is a command for Claude Code from madciapka/gemini-claude-plugin. It costs 13 tokens per session (586 once invoked), scanned A, original, MIT.

A command that sends a long or open-ended task to Gemini, an AI assistant, and streams its progress back as it works.

In plain words
What is it for?
Delegating extended, write-capable tasks to Gemini while monitoring their events and partial results.
Why use it?
You can see interim findings, tool calls, and file changes instead of waiting for one final response. It is intended for tasks where progress matters during the run.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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, 9 commands, 3 agents shipped together

Good fit Delegating extended, write-capable tasks to Gemini while monitoring their events and partial results.

Compare 6 commands 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 madciapka/gemini-claude-plugin
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, 9 commands, 3 agents.

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 rescue-stream

README.md
[![agentmods](https://agentmods.dev/badge/commands/madciapka/gemini-claude-plugin/rescue-stream.svg)](https://agentmods.dev/commands/madciapka/gemini-claude-plugin/rescue-stream)
Your own site
<a href="https://agentmods.dev/commands/madciapka/gemini-claude-plugin/rescue-stream"><img src="https://agentmods.dev/badge/commands/madciapka/gemini-claude-plugin/rescue-stream.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 586 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.00013 $0.00586
Opus 5 $0.00006 $0.00293
Sonnet 5 $0.00003 $0.00117
Haiku 4.5 $0.00001 $0.00059

Measured 8d ago against content hash e3893aababce, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

rescue-stream 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/commands/rescue-stream.md · 44 lines

What it actually says

Use this when the Gemini run is long, open-ended, or write-capable and you want Claude to react to interim progress (file edits, tool calls, partial findings) instead of waiting for one final blob.

Use /gemini:rescue (not this command) when you only need Gemini's final answer as a single artifact.

Raw user request: $ARGUMENTS

Operating contract:

  • Run a Bash call to launch the streamed background job:
    node "${CLAUDE_PLUGIN_ROOT}/scripts/gemini-companion.mjs" task --stream "$ARGUMENTS"
    
    The companion prints a JSON-ish payload (jobId, eventsFile, logFile).
  • Capture the jobId and eventsFile from that output.
  • Tail the job with node "${CLAUDE_PLUGIN_ROOT}/scripts/gemini-companion.mjs" tail "$jobId" (run_in_background: true) and read new lines via BashOutput periodically. Do not use raw tail -F — it leaks. The companion's tail exits on terminal job status.
  • Each event line is JSON-line (stream-json). Common type values include init, message, tool_use, error. Treat lines that fail to parse as raw progress text.
  • The companion's tail exits on its own when the job is completed / failed / cancelled. If it's still running after 30 s with no new lines, surface a stall.
  • After completion, fetch the final response with:
    node "${CLAUDE_PLUGIN_ROOT}/scripts/gemini-companion.mjs" result <jobId>
    
    and return that verbatim, exactly like /gemini:rescue.

Argument handling:

  • Preserve the user's natural-language task text exactly.
  • --model, --read-only, --yolo, --sandbox are runtime flags — pass them through.
  • Do not strip --stream; the helper requires it.
  • Default to --read-only when the user asked for review/diagnosis/research with no explicit request to apply fixes.

Don'ts:

  • Do not paraphrase or summarize Gemini's events. Surface them verbatim.
  • Do not fall back to /gemini:rescue if streaming fails — surface the error and stop.
  • Do not auto-apply fixes from a streamed review. Same rule as /gemini:rescue.
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 · 44 lines · 13 tokens per session scan A e3893aababce

Subscribe to this mod's changes

rescue-stream is a command published in the GitHub repository madciapka/gemini-claude-plugin (8 stars, last pushed 4mo ago), licensed MIT. It adds 13 tokens to every session and 586 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.