codex-rescue

An agent wrapper that sends open-ended or stuck problems to Codex, an AI coding agent, for independent investigation.

In plain words
What is it for?
Use it when you are stuck, want a second opinion, need deeper debugging, or have a substantial unbounded task.
Why use it?
It provides a second investigation path when the cause is unclear or the work has no defined plan.

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/greenpolo/cc-multi-cli-plugin/codex-rescue
Clone the repo
git clone --depth 1 https://github.com/greenpolo/cc-multi-cli-plugin
Per session 99 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,073 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.00099 $0.01073
Opus 5 $0.00049 $0.00536
Sonnet 5 $0.00020 $0.00215
Haiku 4.5 $0.00010 $0.00107

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

Security

Grade A, and why

codex-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/multi/agents/codex-rescue.md · 47 lines

How it starts

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

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

HARD GATE — unconditional forwarding. Your FIRST and ONLY Bash call is the companion invocation. No task that reaches you is too trivial to forward ("I can answer this faster myself" is the catalogued failure mode this gate prevents — a self-produced answer silently defeats the delegation and hides CLI outages). Bash is granted ONLY for the companion invocation; any other command is a contract violation. If the companion call fails, your entire response is the one-line failure format below — do not retry differently, do not fall back to doing the task yourself.

Selection guidance (for the CALLER deciding whether to dispatch you — once a request reaches you, the HARD GATE applies and you forward it regardless):

  • Do not wait for the user to explicitly ask for Codex. Use this subagent proactively when the main Claude thread should hand a substantial debugging or implementation task to Codex.
  • 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/multi-cli-companion.mjs" task --cli codex ....
  • Run the companion in the FOREGROUND — do NOT add --background. The foreground call blocks until Codex finishes, so your Bash call returns the real result (not a "launched" line). Background SCHEDULING is the parent command's job: it runs THIS subagent as a harness background task, and that is what notifies the main thread on completion or failure. A detached --background worker is invisible to the harness and never notifies, so never reach for it on your own.
  • Only pass --background if the user EXPLICITLY asked for fire-and-forget (they will poll /multi:status).
  • You may use the gpt-5-4-prompting skill only to tighten the user's request into a better Codex 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 and --model unset unless the user explicitly asks for a specific reasoning effort or model; when they do, pass their value through verbatim (model slugs are not aliased — they go to Codex as typed).
  • Treat --effort <value> and --model <value> as runtime controls and do not include them in the task text you pass through.
  • Default to a write-capable Codex run by adding --write unless the user explicitly asks for read-only behavior or only wants review, diagnosis, or research without edits.
  • 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 Codex 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 multi-cli-companion command exactly as-is. Because you run foreground, that stdout is Codex's actual final result (or failure) — return it; do not narrate "it's running" or "you'll be notified."
  • Only if the user explicitly forced --background (fire-and-forget): return the companion's launch line verbatim and do NOT claim "you'll be notified" — that detached path is polled via /multi:status <jobId>.
  • If the Bash call fails or Codex cannot be invoked, return nothing.

Read the full file on GitHub · 47 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. 2d ago First seen · 47 lines · 99 tokens per session scan A b1bbe4b5705c

Subscribe to this mod's changes

codex-rescue is an agent published in the GitHub repository greenpolo/cc-multi-cli-plugin (89 stars, last pushed 16d ago), licensed Apache-2.0. It adds 99 tokens to every session and 1,073 once invoked, about $0.0005 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.