rescue

A command that hands a coding task to Claude Code, another coding assistant, through a companion process. It can run the task in the background, wait for it, continue an earlier session, or start a new one.

In plain words
What is it for?
Use it to delegate coding tasks, choose a Claude model and turn limit, run work asynchronously, or resume a previous Claude Code task.
Why use it?
It lets you pass work to Claude Code without manually setting up the handoff or deciding how to handle an existing session.

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/tornikegomareli/claude-plugin-codex/rescue
Clone the repo
git clone --depth 1 https://github.com/tornikegomareli/claude-plugin-codex
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 587 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.00036 $0.00587
Opus 5 $0.00018 $0.00293
Sonnet 5 $0.00007 $0.00117
Haiku 4.5 $0.00004 $0.00059

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

Security

Grade A, and why

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 3d 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/claude/commands/rescue.md · 42 lines

What it actually says

Delegate the user's task to Claude Code through the companion task runtime.

Raw slash-command arguments: $ARGUMENTS

Locating the companion script:

  • The companion script is scripts/claude-companion.mjs inside this plugin's root directory (the installed claude plugin directory that contains .codex-plugin/plugin.json).
  • Always invoke it with an absolute path.

Delegation rules:

  • If the claude-rescue agent is available, delegate this request to it and return its output verbatim.
  • Otherwise, follow the forwarding rules below yourself.

Resume preflight:

  • If the raw arguments contain neither --resume nor --fresh, first run:
node "<plugin-root>/scripts/claude-companion.mjs" task-resume-candidate --json
  • If the payload has available: true, ask the user exactly once, in plain conversation, whether to continue the latest Claude session or start fresh. Put "Continue the latest Claude session (Recommended)" first when the request sounds like a follow-up ("continue", "keep going", "apply the fix"); otherwise recommend starting fresh.
  • Add --resume-last when continuing, nothing when starting fresh.

Forwarding rules:

  • Use exactly one shell invocation of node "<plugin-root>/scripts/claude-companion.mjs" task ....
  • Map routing controls onto companion flags and keep them out of the task text:
    • --resume means add --resume-last.
    • --fresh means do not add --resume-last.
    • --background and --wait pass through as-is (--wait means simply omit --background).
    • --model <model|fast> and --max-turns <n> pass through.
  • Default to a write-capable 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 companion command exactly as-is, with no commentary before or after.
  • If the run fails because Claude is unavailable or not authenticated, direct the user to @claude setup.

Sandbox requirements:

  • The companion spawns the claude CLI, which needs network access to reach the Anthropic API.
  • If the sandbox blocks the command or Claude reports a connection error, rerun the same shell command with escalated permissions and explain why in the justification.
  • Do not work around a sandbox denial by improvising your own review or edits; the command's value is Claude's independent 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. 3d ago First seen · 42 lines · 36 tokens per session scan A 934b3dfc3901

Subscribe to this mod's changes

rescue is a command published in the GitHub repository tornikegomareli/claude-plugin-codex (9 stars, last pushed 1mo ago), licensed MIT. It adds 36 tokens to every session and 587 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.