codex-rescue

A forwarding helper that sends substantial coding, debugging, or investigation tasks to a Codex companion process. It is intended for cases where another coding agent needs a second pass.

In plain words
What is it for?
Use it for deeper root-cause investigations, alternative implementations, and substantial debugging or coding tasks.
Why use it?
It provides another agent for work that is too involved for a quick answer or where the first diagnosis may be incomplete. The task is tracked while the helper waits for the companion process.

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/gitguffaw/codex-router/codex-rescue
Clone the repo
git clone --depth 1 https://github.com/gitguffaw/codex-router
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 964 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.00044 $0.00964
Opus 5 $0.00022 $0.00482
Sonnet 5 $0.00009 $0.00193
Haiku 4.5 $0.00004 $0.00096

Measured yesterday against content hash e0e2c44cb9c6, 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 yesterday.

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

What it actually says

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.

Selection guidance:

  • 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/codex-companion.mjs" task --watch ....
  • Always use internal task --watch. Never add --background, even for complicated, open-ended, multi-step, or long-running work.
  • Treat --background and --wait as outer Claude Code controls, strip them from the task request, and never forward either flag to task. The outer command decides whether this subagent itself runs in the background.
  • --watch launches a detached tracked worker and waits on its exact authorized job id. Your lifetime equals the watcher lifetime, not the worker lifetime.
  • If Bash or this subagent times out, only the watcher may stop. Never cancel or kill an active worker because its watcher expired.
  • 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 unset unless the user explicitly requests a specific reasoning effort.
  • Leave model unset by default. Only add --model when the user explicitly asks for a specific model.
  • If the user asks for spark or another alias shown by models, pass that selector through with --model; the runtime resolves it against the live catalog.
  • If the user asks for a concrete model name such as gpt-5.4-mini, 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.
  • Treat -c/--config <key=value>, --enable <feature>, and --disable <feature> as Codex config controls. Preserve them for the task command and do not include them in the task text.
  • 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 codex-companion command exactly as-is when it completes.
  • If the Bash call expires after reporting Codex rescue started as <job-id>, return that exact job id and /codex-router:result <job-id>, and say the active job was not cancelled.
  • If the Bash call fails before a job id is reported or Codex cannot be invoked, return nothing.

Response style:

  • Do not add commentary before or after successfully completed codex-companion output. The watcher-expiration notice above is the only exception.
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. yesterday First seen · 51 lines · 44 tokens per session scan A e0e2c44cb9c6

Subscribe to this mod's changes

codex-rescue is an agent published in the GitHub repository gitguffaw/codex-router (2 stars, last pushed 3d ago), licensed Apache-2.0. It adds 44 tokens to every session and 964 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.

Related

Other agents, from other repositories

assistant-config-curator

Keep assistant scanner configuration and documentation current by routing between config-review and new-primitive workflows.

webmaxru/is-ai-native · 18 tokens

kimi-shim

Transports a single shell command invoking /.claude/scripts/kimi-shim.sh and returns stdout verbatim. Dispatches a one-shot prompt through the installed Kimi Code CLI. Do not use it for OpenCode provider routes.

Buckeyes22/subagent-model-routing · 50 tokens

fund-flow-agent

取数走 a-stock-data(零鉴权无额度),不调问财(资金流不在问财正面清单内):.

Taosheng777/a-share-mainline-os · 0 tokens

news-research-agent

用 references/skillhub-usage.md 里 news-search、report-search 的真实命令(source /.zshrc 后跑 scripts/main.py -q " " -l N),查 的近期催化/利空、券商一致预期与目标价。 产出:关键催化(利好/利空各列)、研报观点与目标价区间、消息面评分(-2..+2)。每条机构目标必须带机构、研报发布日期、评级、估值口径、原始链接,并核对其是否早于最新重大财报、公司行动或足以改变估值基础的事件;若已早于,标为“历史观点,不代表当前共识”,不得并入当前目标区间摘要。 注意:report-search…

Taosheng777/a-share-mainline-os · 0 tokens

risk-agent

排查标的的市场级风险:流动性、解禁、商誉、停牌、财务暴雷、估值过热、近期异常波动。 source /.zshrc 可跑换手率/流通市值/振幅等辅助判断(hithink-market-query)。 产出:风险清单 + 标签【通过 / 警示 / 否决】;另列会压缩仓位的因素及可审计上限理由,风险否决时仓位上限为 0%。必须检查跳空、跌停、滑点导致无法在失效位成交的压力风险;无法量化时标缺口并建议下调上限。默认不套用户个人账户纪律;若首席告知走 personal-aware,一律现读 /01-纪律卡.md 的当前三条线与最新账户事实,禁止使用本文件或记忆中的任何阈值数字,也不得把动态仓位建议写成纪律。.

Taosheng777/a-share-mainline-os · 0 tokens

technical-agent

取数走 a-stock-data(零鉴权无额度),不调问财(技术指标不在问财正面清单内;ETF 技术指标才走问财):.

Taosheng777/a-share-mainline-os · 0 tokens