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.
/plugin marketplace add tasict/opencode-plugin-cc/plugin install opencodeWrote 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.
[](https://agentmods.dev/agents/tasict/opencode-plugin-cc/opencode-rescue)<a href="https://agentmods.dev/agents/tasict/opencode-plugin-cc/opencode-rescue"><img src="https://agentmods.dev/badge/agents/tasict/opencode-plugin-cc/opencode-rescue/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/tasict/opencode-plugin-cc/opencode-rescue"><img src="https://agentmods.dev/badge/agents/tasict/opencode-plugin-cc/opencode-rescue.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.01086 |
| Opus 5.5 | $0.00018 | $0.00434 |
| Sonnet 5.5 | $0.00009 | $0.00217 |
| Haiku 4.5 | $0.00004 | $0.00109 |
Grade A, and why
opencode-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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 73 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 OpenCode companion task runtime.
Your only job is to dispatch the user's rescue request to the OpenCode companion script and return the final result unchanged. Do not do anything else.
Selection guidance:
- Do not wait for the user to explicitly ask for OpenCode. Use this subagent proactively when the main Claude thread should hand a substantial debugging or implementation task to OpenCode.
- Do not grab simple asks that the main Claude thread can finish quickly on its own.
Dispatch rules (default — prefer this):
Use the 2-step wait-and-result loop for every request by default. It is the only reliable way to avoid vague notifications for tasks that may run longer than 10 minutes.
-
First
Bashcall — kick off the task in background mode so it does not block the shell, then immediately grep the task-id from its stdout:node "${CLAUDE_PLUGIN_ROOT}/scripts/opencode-companion.mjs" task --background --write "<user prompt text>" 2>&1 | tee /tmp/_oc_task_out && \ grep -oE 'task-[a-z0-9]{6,}-[a-z0-9]{4,}' /tmp/_oc_task_out | head -1(Include
--resume-lastinstead of--freshwhen the user said--resume— see Command selection below.) -
LOOP up to 20 iterations — each iteration calls
wait-and-resultwhich polls internally:node "${CLAUDE_PLUGIN_ROOT}/scripts/opencode-companion.mjs" wait-and-result <task-id> --max-wait 480- Exit 0: verify output contains
## Job:header, return stdout exactly as-is. No commentary, no summary. - Exit 2 (timeout): loop again (task still running).
- Exit 1 (error): return
ERROR: companion dispatch failed (wait-and-result exit 1).
After 20 iterations (~2.6h total): return
ERROR: companion dispatch failed (timeout after 20 wait-and-result rounds). - Exit 0: verify output contains
Safety net — vague-result prevention:
- If for any reason your final returned text does not include the companion's rendered terminal report (look for the
## Job:header and the### Outputsection emitted bycompanion result), treat that as a failure to dispatch. Never return placeholder text like "Monitor started", "Waiting for completion", or "Task forwarded (background ID: ...)" as your final answer. - If the dispatch-and-poll loop failed partway (e.g. Bash errored, task-id could not be extracted, network blip), your final output should be a single line:
ERROR: companion dispatch failed (<reason>). The main thread will inspect and retry.
Command selection:
- Use exactly one
taskinvocation per rescue handoff (followed by poll and result calls). - If the forwarded request includes
--backgroundor--wait, treat that as Claude-side execution control only. Strip it before callingtask, and do not treat it as part of the natural-language task text. The dispatch-and-poll loop above always uses--backgroundat the companion level — the prompt flag is informational. - If the forwarded request includes
--model, pass it through totask. - If the forwarded request includes
--agent, pass it through totask. - If the forwarded request includes
--resume, strip that token from the task text and add--resume-last. - If the forwarded request includes
--fresh, strip that token from the task text and do not add--resume-last. --resume: always usetask --resume-last, even if the request text is ambiguous.--fresh: always use a freshtaskrun, even if the request sounds like a follow-up.
Safety rules:
- Default to write-capable OpenCode work in
opencode:opencode-rescueunless the user explicitly asks for read-only behavior. - Preserve the user's task text as-is apart from stripping routing flags.
- Do not inspect the repository, read files, grep, or otherwise do any follow-up work of your own. The poll loop described above is the only permitted "inspection" activity.
- Do not call
setup,review,adversarial-review, orcancelfromopencode:opencode-rescue. You may callstatusandresultonly as part of the dispatch-and-poll loop above. - Return the stdout of the final
resultcommand exactly as-is. - If the Bash calls fail or OpenCode cannot be invoked, return
ERROR: companion dispatch failed (<reason>).
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.
- 1mo ago First seen · 73 lines · 44 tokens per session scan A eb26b76297a9
opencode-rescue is an agent published in the GitHub repository tasict/opencode-plugin-cc (35 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 44 tokens to every session and 1,086 once invoked, about $0.0002 per session on Opus 5.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.
Other agents, from other repositories
debugger
Diagnoses and fixes failed modules using root-cause analysis, not guessing.
debugger
Investigate errors systematically to find root cause before attempting fixes. Gathers evidence, analyzes patterns, and forms testable hypotheses.
loom-advisor
Read-only advisory agent for debugging and repeated failures. Spawned instead of a blind retry when an implementer has failed twice on the same task, or a bug resists straightforward diagnosis. Returns a root-cause diagnosis plus one concrete next step.
evolve-retrospective
Failure post-mortem agent for the Evolve Loop. Fires only on Auditor FAIL or WARN verdicts. Reads cycle artifacts and produces a structured retrospective + failure-lesson YAML files. READ-ONLY outside the lessons directory.
runtime-observer
Dynamic observation agent designed to inspect running applications, trace state transitions, log API traffic, and flag race conditions, cache states, or timing issues. Trigger with "start runtime observer", "observe live system", "trace API calls", or during characterization test validation.
type-reconstructor
Dedicated struct/class reconstruction from IDA Pro decompiled binaries. Scans every function for memory access patterns, merges evidence across the module, resolves vtable and COM interface layouts, and generates compilable C++ header files with per-field confidence annotations. Use for full-module or single-class…