rescue
Skill219 starsChanged 4 months agoApache-2.0View on GitHub
Delegate a substantial diagnosis, implementation, or follow-up task to Claude Code through the tracked-job runtime. Args: --background, --wait, --resume, --resume-last, --fresh, --write, --model <model>, --effort <low|medium|high|xhigh|max>, --prompt-file <path>, [task text]. Defaults to opus with no forced effort. Use when Claude should investigate or change things, not when the user only wants review findings.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- dydtjr1128/claude-bridgetheir own version, first seen Sep 22, 2026
- suboss87/FDEOpstheir own version, first seen Sep 17, 2026
- metallurgical/ogre-runnertheir own version, first seen Jul 7, 2026
- unsafe9/agent-skillstheir own version, first seen Jun 16, 2026
- Rune-kit/runetheir own version, first seen Apr 22, 2026
- logly/mureotheir own version, first seen Apr 13, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- suboss87/FDEOps★ 950same name
- Houseofmvps/ultraship★ 123same name
- Rune-kit/rune★ 88same name
- logly/mureo★ 48same name
- dydtjr1128/claude-bridge★ 1same name
- metallurgical/ogre-runner★ 1same name
- unsafe9/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
72 rules. 0 are common, 24 are distinctive, and 48 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
24
Distinctive
This author's own choices. Worth a look.
48
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Do not answer the request inline in the main Codex thread.
- Distinctive: line 13
Use this skill when the user wants Claude Code to investigate, implement, or continue substantial work in this repository.
- Very specific: line 15
Prefer $cc:rescue when the user wants Claude Code to diagnose the issue, validate a risky change by actually editing or testing, apply …
- Distinctive: line 16
Do not use rescue for "just review this diff" unless the user also wants follow-through work beyond review findings.
- Distinctive: line 17
Do not use rescue merely because the main Codex thread plans to fix things after combining its own review with a separate Claude review.
- Very specific: line 32
If the user explicitly invoked $cc:rescue or Claude Code Rescue, do not keep the work in the main Codex thread.
- Distinctive: line 33
If the user did not supply a task, ask what Claude Code should investigate or fix.
- Very specific: line 34
Treat --background and --wait as execution controls, not task text.
- Very specific: line 37
Treat --model, --effort, --resume, --resume-last, --fresh, and --prompt-file as runtime or routing controls, not task text.
- Very specific: line 38
If the user task text itself begins with a slash command such as /simplify, /fix, or /review, treat that slash command as literal Claude …
- Very specific: line 40
If the user explicitly passed --background, run the rescue subagent in the background.
- Very specific: line 41
If the user explicitly passed --wait, run in the foreground.
- Distinctive: line 42
If neither flag is present and the rescue request is small, clearly bounded, or likely to finish quickly, prefer foreground.
- Distinctive: line 43
If neither flag is present and the request looks complicated, open-ended, multi-step, or likely to keep Claude Code running for a while, …
- Very specific: line 46
Default to --write unless the user explicitly wants read-only behavior or only review, diagnosis, or research without edits.
- Very specific: line 47
If --resume or --resume-last is present, continue the latest tracked Claude Code task.
- Very specific: line 48
If none of --resume, --resume-last, or --fresh is present, first run: node "<plugin-root>/scripts/claude-companion.mjs" …
- Very specific: line 50
If that helper reports available: true, ask the user once whether to continue the current Claude Code thread or start a new one.
- Distinctive: line 51
Use exactly these two choices:
- Very specific: line 54
If the user's wording is clearly a follow-up such as "continue", "keep going", "resume", "apply the top fix", or "dig deeper", recommend …
- Very specific: line 56
If the user chooses continue, add --resume before spawning the subagent.
- Very specific: line 57
If the user chooses a new thread, add --fresh before spawning the subagent.
- Very specific: line 58
If the helper reports available: false, do not ask.
- Distinctive: line 59
Do not inspect the repo, do the task yourself, poll job status, or summarize the result in the same turn.
- Very specific: line 60
If a legacy request still includes --notify-parent-on-complete, treat it as a compatibility alias.
- Very specific: line 64
Never satisfy background rescue by launching claude-companion.mjs task itself as a detached shell process.
- Very specific: line 65
If a legacy request still includes --builtin-agent, treat it as a compatibility alias for the default built-in path.
- Very specific: line 66
Prefer fork_context: false for the built-in rescue child.
- Very specific: line 67
Only consider fork_context: true as a last resort for a short follow-up where essential context truly cannot be summarized.
- Very specific: line 69
Before spawning the built-in child, emit one short commentary update that clearly says the parent is starting the built-in rescue child on …
- Very specific: line 70
Remove --background and --wait before spawning the subagent.
- Very specific: line 72
If the free-text task begins with /, preserve it verbatim in the spawned subagent request.
- Very specific: line 73
Before spawning the built-in child, capture the task job id plus routing context in one call: node …
- Very specific: line 75
If that helper returns a non-empty ownerSessionId, include --owner-session-id <owner-session-id> in the companion command so tracked Claude …
- Very specific: line 76
If it returns an empty ownerSessionId, omit --owner-session-id entirely.
- Very specific: line 77
If that helper returns a non-empty jobId, pass it into the companion command as an internal --job-id <reserved-job-id> routing flag.
- Distinctive: line 79
Add an internal companion routing flag that reflects whether the user will see this result in the current turn:
- Very specific: line 83
If that helper returns a non-empty parentThreadId, pass it into the child prompt as the parent thread id for one-shot completion …
- Very specific: line 84
If it returns an empty parentThreadId, continue without parent wake-up instead of blocking the rescue.
- Distinctive: line 88
If the built-in rescue request is vague, chatty, or a follow-up, the parent may tighten only the task text before composing the exact …
- Very specific: line 89
Prefer passing a small structured <parent_context> block instead of forked thread history when the child needs a little prior context.
- Very specific: line 90
Use the internal prompt-shaping reference at ../../internal-skills/task-prompt-shaping/prompt-shaping.md as deeper guidance for that …
- Distinctive: line 92
prefer a short delta instruction for resume follow-ups
- Very specific: line 93
when helpful, use compact blocks such as <task>, <output_contract>, and <default_follow_through_policy>
- Distinctive: line 94
do not add more words than value for already-clear requests
- Distinctive: line 96
If the request is already concrete, keep it literal.
- Very specific: line 97
If the request names a concrete file, path, or artifact such as README.md, and also includes explicit source/style/installation …
- Distinctive: line 98
If the request refers to earlier work, rewrite it into a short delta that names the next thing Claude Code should change or inspect.
- Distinctive: line 99
If the user asks for "fix it", "keep going", or similar follow-ups, make the next objective explicit without inventing repo facts.
- Distinctive: line 100
If the user asks in mixed language, preserve the language mix and only tighten the execution intent.
- Distinctive: line 101
If the user implies an output format, make that output contract explicit instead of broadening the task.
- Very specific: line 103
Keep <parent_context> small and structured.
- Very specific: line 110
Do not use <parent_context> for already-clear fresh tasks unless it adds real value.
- Very specific: line 111
Keep <parent_context> deterministic and short.
- Very specific: line 113
If the resolved rescue task text is shell-hostile or likely to break a single inline shell string, materialize it into a temporary prompt …
- Very specific: line 114
Treat any of the following as prompt-file triggers unless the user already supplied --prompt-file:
- Very specific: line 118
When using a prompt file, preserve the exact resolved task text byte-for-byte in that file and point the companion command at that file …
- Very specific: line 119
Prefer a temporary path outside the repository checkout, for example under the OS temp directory such as /tmp on POSIX systems, so rescue …
- Very specific: line 121
If the user is not satisfied with a built-in rescue result, the parent should treat the next rescue request as a follow-up and prefer …
- Distinctive: line 125
run that command as one blocking foreground shell-tool call, not as a background terminal/session
- Distinctive: line 126
do not request a shell session id, poll a shell session later, or return before the companion command exits
- Very specific: line 127
if the available shell tool is exec_command, call it once in non-interactive mode and wait for command exit in that same call
- Very specific: line 128
when using exec_command, pass sandbox_permissions: "require_escalated" and the justification Allow the Claude Code companion to contact the …
- Very specific: line 131
if a parent thread id is provided for experimental background notification, allow one extra send_input call after a successful shell result …
- Distinctive: line 135
if the parent provided a non-empty parent thread id, do not silently drop the completion notification path from the child prompt
- Very specific: line 137
if a reserved companion job id is available, use this exact high-level shape for the notification message: Background Claude Code rescue …
- Very specific: line 139
if no reserved job id is available, fall back to: Background Claude Code rescue finished.
- Distinctive: line 141
if the parent thread is already busy with unrelated work, prefer these steering messages over embedding the raw result text
- Distinctive: line 142
do not embed the raw Claude result inside the notification message
- Distinctive: line 143
do not include any other prose in that notification message
- Distinctive: line 156
Default background notify: when the parent thread id was captured successfully, the background built-in child may wake the parent with one …
- Very specific: line 161
If the companion reports missing setup or authentication, direct the user to $cc:setup.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude Code Rescue
By default, hand this skill off through Codex's built-in default subagent.
Do not answer the request inline in the main Codex thread.
Spawn exactly one rescue forwarding subagent whose only job is to run one companion task command and return that stdout unchanged.
Foreground rescue responses must be that subagent's output verbatim.
Use this skill when the user wants Claude Code to investigate, implement, or continue substantial work in this repository.
Prefer $cc:rescue when the user wants Claude Code to diagnose the issue, validate a risky change by actually editing or testing, apply fixes from a prior review, or carry a task forward across multiple steps.
Do not use rescue for "just review this diff" unless the user also wants follow-through work beyond review findings.
Do not use rescue merely because the main Codex thread plans to fix things after combining its own review with a separate Claude review. Rescue is only the right delegation when Claude itself is supposed to investigate, edit, test, or otherwise own the follow-through work.
Resolve <plugin-root> as two directories above this SKILL.md file. Always run the companion from that active plugin root:
node "<plugin-root>/scripts/claude-companion.mjs" task ...
Raw slash-command arguments:
$ARGUMENTS
Supported arguments: --background, --wait, --resume, --resume-last, --fresh, --write, --model <model>, --effort <low|medium|high|xhigh|max>, --prompt-file <path>, plus free-text task text
Companion defaults: model=opus, and no effort. The companion forwards --effort only when the user passes it, so fable, opus, sonnet, and haiku each keep Claude Code's own effort default. Claude Code owns which effort levels each model supports.
Forward --model unchanged to the companion. The companion trims surrounding whitespace, canonicalizes the friendly aliases fable, opus, sonnet, and haiku to lowercase, then forwards every other --model value unchanged to Claude Code. Claude Code owns alias resolution and supported effort levels; /model is the authoritative picker for the current account and provider.
Main-thread routing rules:
- If the user explicitly invoked
$cc:rescueorClaude Code Rescue, do not keep the work in the main Codex thread. Delegate it. - If the user did not supply a task, ask what Claude Code should investigate or fix.
- Treat
--backgroundand--waitas execution controls, not task text. --backgroundand--waitare Codex-side execution controls only. Never forward either flag toclaude-companion.mjs task.- The main Codex thread owns that execution-mode choice. It decides whether to wait for the subagent. The child subagent must never reinterpret those flags as companion flags.
- Treat
--model,--effort,--resume,--resume-last,--fresh, and--prompt-fileas runtime or routing controls, not task text. - If the user task text itself begins with a slash command such as
/simplify,/fix, or/review, treat that slash command as literal Claude Code task text to be forwarded unchanged. Do not execute or reinterpret it in the parent Codex thread. --modelselects the Claude model for the companiontaskcommand only. It does not select the Codex subagent model.- If the user explicitly passed
--background, run the rescue subagent in the background. - If the user explicitly passed
--wait, run in the foreground. - If neither flag is present and the rescue request is small, clearly bounded, or likely to finish quickly, prefer foreground.
- If neither flag is present and the request looks complicated, open-ended, multi-step, or likely to keep Claude Code running for a while, prefer background execution for the subagent.
- This size-and-scope heuristic belongs to the main Codex thread. The child subagent does not get to override it.
- If
--resumeor--resume-lastis present without--wait, and the new instruction is substantial, open-ended, or likely to take more than a quick follow-up, the main thread should usually prefer background execution for the subagent. Keep that as a parent-side choice only. Do not inject--backgroundinto the child request or the companion command. - Default to
--writeunless the user explicitly wants read-only behavior or only review, diagnosis, or research without edits. - If
--resumeor--resume-lastis present, continue the latest tracked Claude Code task. If--freshis present, start a new task. - If none of
--resume,--resume-last, or--freshis present, first run:node "<plugin-root>/scripts/claude-companion.mjs" task-resume-candidate --json - If that helper reports
available: true, ask the user once whether to continue the current Claude Code thread or start a new one. - Use exactly these two choices:
Continue current Claude Code threadStart a new Claude Code thread
- If the user's wording is clearly a follow-up such as "continue", "keep going", "resume", "apply the top fix", or "dig deeper", recommend
Continue current Claude Code threadfirst. - Otherwise recommend
Start a new Claude Code threadfirst. - If the user chooses continue, add
--resumebefore spawning the subagent. - If the user chooses a new thread, add
--freshbefore spawning the subagent. - If the helper reports
available: false, do not ask. Delegate normally. - Do not inspect the repo, do the task yourself, poll job status, or summarize the result in the same turn.
- If a legacy request still includes
--notify-parent-on-complete, treat it as a compatibility alias. Background built-in rescue now attempts parent wake-up by default.
Subagent launch:
- By default, use Codex's
spawn_agenttool. Omitagent_type; an omittedagent_typealready selects the built-in default agent, and Codex only advertises that parameter when custom agents are configured. - Never satisfy background rescue by launching
claude-companion.mjs taskitself as a detached shell process. Do not use&,nohup, detachedspawn, or any equivalent direct background process launch from the parent. - If a legacy request still includes
--builtin-agent, treat it as a compatibility alias for the default built-in path. It should not change behavior. - Prefer
fork_context: falsefor the built-in rescue child. The parent should pass a self-contained forwarding message instead of replaying the full parent thread by default. - Only consider
fork_context: trueas a last resort for a short follow-up where essential context truly cannot be summarized. Avoid it for large or long-lived threads because it can exhaust the child context window. - The built-in rescue path must omit
modelonspawn_agentso the child inherits the parent model, and must setreasoning_effort: "medium"so the transient forwarding child stays cheap and predictable. Never pin a specific Codex model name here; the available catalog is owned by the host CLI and changes between releases. - Before spawning the built-in child, emit one short commentary update that clearly says the parent is starting the built-in rescue child on the inherited model at
mediumeffort. - Remove
--backgroundand--waitbefore spawning the subagent. Those flags control only whether the main thread waits on the subagent. - Pass only the routing and task arguments that actually belong to
claude-companion.mjs task. - If the free-text task begins with
/, preserve it verbatim in the spawned subagent request. Do not strip the slash or rewrite it into a local Codex command. - Before spawning the built-in child, capture the task job id plus routing context in one call:
node "<plugin-root>/scripts/claude-companion.mjs" background-routing-context --kind task --json - If that helper returns a non-empty
ownerSessionId, include--owner-session-id <owner-session-id>in the companion command so tracked Claude Code jobs stay attached to the user-facing parent session for$cc:status/$cc:result. - If it returns an empty
ownerSessionId, omit--owner-session-identirely. Never leave an empty routing placeholder such as--owner-session-id --job-id. - If that helper returns a non-empty
jobId, pass it into the companion command as an internal--job-id <reserved-job-id>routing flag. - Whenever forwarding that reserved
--job-id, also pass--cwd <workspace-root>usingworkspaceRootfrom the same helper response. Reserved job ids are workspace-scoped. - Add an internal companion routing flag that reflects whether the user will see this result in the current turn:
- Foreground rescue must add
--view-state on-success - Background rescue must add
--view-state defer
- Foreground rescue must add
- Any user-supplied
--modelflag is for the Claude companion only and must be forwarded unchanged totask. - If that helper returns a non-empty
parentThreadId, pass it into the child prompt as the parent thread id for one-shot completion notification. - If it returns an empty
parentThreadId, continue without parent wake-up instead of blocking the rescue. - This parent wake-up attempt is now the default for background built-in rescue on persistent Codex/Desktop threads. It is still best-effort and should silently degrade on one-shot
codex execruns. - For the built-in rescue path, the parent thread owns prompt shaping. The built-in child should stay a pure executor.
- For the built-in rescue path, treat the internal runtime reference at
../../internal-skills/cli-runtime/runtime.mdas the command-building contract for the forwarding worker. It is an internal reference document, not a public skill to invoke. - If the built-in rescue request is vague, chatty, or a follow-up, the parent may tighten only the task text before composing the exact companion command.
- Prefer passing a small structured
<parent_context>block instead of forked thread history when the child needs a little prior context. - Use the internal prompt-shaping reference at
../../internal-skills/task-prompt-shaping/prompt-shaping.mdas deeper guidance for that parent-side tightening. It is an internal reference document, not a public skill to invoke.- preserve user intent and add no new repo facts
- prefer a short delta instruction for resume follow-ups
- when helpful, use compact blocks such as
<task>,<output_contract>, and<default_follow_through_policy> - do not add more words than value for already-clear requests
- Parent-side shaping should be conservative and specific:
- If the request is already concrete, keep it literal.
- If the request names a concrete file, path, or artifact such as
README.md, and also includes explicit source/style/installation constraints, keep the full task text literal apart from stripping routing flags. Do not compress it into a shorter delta. - If the request refers to earlier work, rewrite it into a short delta that names the next thing Claude Code should change or inspect.
- If the user asks for "fix it", "keep going", or similar follow-ups, make the next objective explicit without inventing repo facts.
- If the user asks in mixed language, preserve the language mix and only tighten the execution intent.
- If the user implies an output format, make that output contract explicit instead of broadening the task.
- For
--resume,--resume-last, vague follow-ups, or ambiguous continuation requests, prefer adding a compact<parent_context>block before the task command instead of relying on inherited history. - Keep
<parent_context>small and structured. Good fields include:mode(freshorresume)job_idwhen the parent reserved oneclaude_sessionwhen a resumable Claude session is already knownprevious_summaryonly when the parent can state it tersely from tracked metadatanext_deltafor the exact next objectiveconstraintsonly when they are explicit and still binding
- Do not use
<parent_context>for already-clear fresh tasks unless it adds real value. - Keep
<parent_context>deterministic and short. Do not turn it into a free-form summary of the whole parent thread. - For the built-in rescue path, parent-side shaping must happen before the command is handed to the child. The child must not do an additional interpretation pass.
- If the resolved rescue task text is shell-hostile or likely to break a single inline shell string, materialize it into a temporary prompt file first and use
--prompt-fileinstead of embedding the task directly in the command. - Treat any of the following as prompt-file triggers unless the user already supplied
--prompt-file:- multi-line task text
- single quotes, backticks, or XML-style blocks such as
<task>/<output_contract> - long concrete requests where inline shell quoting would be brittle
- When using a prompt file, preserve the exact resolved task text byte-for-byte in that file and point the companion command at that file with an absolute
--prompt-filepath. - Prefer a temporary path outside the repository checkout, for example under the OS temp directory such as
/tmpon POSIX systems, so rescue prompt staging does not dirty the repo. - Materialize that prompt file with a normal file-write tool or other structured write path. Do not try to generate it by re-embedding the long task text inside another fragile one-line shell string.
- If the user is not satisfied with a built-in rescue result, the parent should treat the next rescue request as a follow-up and prefer
--resumeor--resume-lastwith a short delta instruction when a resumable Claude Code session exists. - The built-in rescue path must use a compact strict forwarding message. It must:
- identify the child as a transient forwarding worker for Claude Code rescue
- include exactly one shell command to run
- run that command as one blocking foreground shell-tool call, not as a background terminal/session
- do not request a shell session id, poll a shell session later, or return before the companion command exits
- if the available shell tool is
exec_command, call it once in non-interactive mode and wait for command exit in that same call - when using
exec_command, passsandbox_permissions: "require_escalated"and the justificationAllow the Claude Code companion to contact the Claude API for this requested task.on that one call; do not first try the companion command in the default network-disabled sandbox - for foreground rescue only, tell the child to return that command's stdout text exactly, with no preamble, summary, code fence, trimming, normalization, or punctuation changes
- tell the child to ignore stderr progress chatter such as
[cc] ...lines and preserve only the stdout-equivalent final result text - if a parent thread id is provided for experimental background notification, allow one extra
send_inputcall after a successful shell result and before finishing - the child prompt must mention the tool name
send_inputliterally; do not replace it with a vague instruction like "send a message to the parent" - that
send_inputcall must target the provided parent thread id, must happen at most once, and must not run on failure paths - that
send_inputcall should use the exact tool shapesend_input({ target: <parent-thread-id>, message: <steering-message> })with no extra prose payload - if the parent provided a non-empty parent thread id, do not silently drop the completion notification path from the child prompt
- that
send_inputmessage should use a short user-facing template that steers the parent toward explicit result retrieval instead of inlining the raw result - if a reserved companion job id is available, use this exact high-level shape for the notification message:
Background Claude Code rescue finished. Open it with $cc:result <reserved-job-id>. - if no reserved job id is available, fall back to:
Background Claude Code rescue finished. Inspect it with $cc:status first, then use $cc:result for the finished job you want to open. - if the parent thread is already busy with unrelated work, prefer these steering messages over embedding the raw result text
- do not embed the raw Claude result inside the notification message
- do not include any other prose in that notification message
- for background rescue, use that same steering message as the child's own final assistant message instead of echoing the raw companion result
- tell the child not to inspect the repository, read files, grep, or do the task directly
- tell the child not to reinterpret routing flags that were already resolved by the parent
- include the matching
--cwd <workspace-root>whenever the command includes that reserved--job-id - tell the child to copy the resolved rescue task text byte-for-byte into that exact command after parent-side routing flags are removed
- explicitly forbid appending terminal punctuation, adding quotes, dropping prefixes such as
completed:, or stripping leading slash commands such as/simplify - include one short exact-output example such as
completed:/simplify make the output compact - say that auth/setup failures from the companion must be returned unchanged
Execution:
- Foreground: spawn the rescue subagent, wait for it to finish, and return its stdout.
- Background: spawn the rescue subagent without waiting for it in this turn. The subagent still runs the companion
taskcommand in the foreground inside its own thread. Background here describes only the parent thread's wait behavior. - Default background notify: when the parent thread id was captured successfully, the background built-in child may wake the parent with one synthetic follow-up turn after success.
Output:
- Foreground: return the subagent's companion stdout exactly as-is. Do not paraphrase, summarize, or add commentary before or after it.
- Background: do not wait for the subagent output. After launching it, tell the user
Claude Code rescue started in the background. Check the subagent session or $cc:status for progress, and once it's done, we will let you know to see the results. - If the companion reports missing setup or authentication, direct the user to
$cc:setup.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

