| name | fusion |
| description | Use $fusion from Codex for deep multi-model judgment: release reviews, architecture tradeoffs, subtle bug/risk analysis, root-cause analysis, and decisions that benefit from independent parallel answers. |
Fusion Skill For Codex
Fusion sends one prompt to the configured Claude, Codex, and OpenCode harnesses in parallel and returns material for one synthesized answer.
Use it proactively when the user asks for, or the task clearly needs, deeper judgment than a single pass:
- release-blocking or final review
- architecture, API, protocol, or migration decisions
- subtle bug/risk analysis
- root-cause analysis with weak evidence
- tradeoff comparison where independent model disagreement is useful
Do not use fusion for simple lookups, mechanical edits, small local inspections, or obvious fixes.
Do not use ordinary subagents, background agents, MCP research, or any fallback multi-agent path as a substitute for fusion. If fusion fails before producing a manifest or judge prompt, report that fusion failed and stop.
Nesting Guard
Never call fusion from a fusion child.
If CLAUDE_FUSION_CHILD=1 is present, you are already one of the fusion agents. Do not call $fusion, fusion-run.py, or equivalent multi-model delegation. Use ordinary tools, subagents, MCP, and skills as needed, then answer directly.
Prerequisites
In the default context-log mode (fusion.json "context": "log"), the runner reads the current Codex session's rollout directly and renders it into a Markdown context file for fresh child agents — no conversion tooling is required.
Only the legacy resume mode ("context": "resume") converts the session with CASR; casr must be on PATH in that mode only.
Codex Route
When the user invokes $fusion <prompt> in Codex, or when you decide on your own to use fusion from Codex, use the agent route with the current Codex session id.
Use exactly one shell call. Write the prompt into a temp file in the same call so no prompt text is evaluated by the shell.
prompt_file="$(mktemp "${TMPDIR:-/tmp}/fusion-prompt.XXXXXX")"
cat > "$prompt_file" <<'FUSION_PROMPT'
<write the exact prompt to send to fusion here>
FUSION_PROMPT
base_session="${CODEX_SESSION_ID:-${CODEX_THREAD_ID:-}}"
if [ -z "$base_session" ]; then
echo "fusion requires CODEX_SESSION_ID or CODEX_THREAD_ID in Codex" >&2
rm -f "$prompt_file"
exit 2
fi
~/.claude/hooks/fusion-run.py \
--invocation-mode agent \
--source-harness codex \
--base-session "$base_session" \
--workdir "$(pwd)" \
-- "$(cat "$prompt_file")"
status=$?
rm -f "$prompt_file"
exit "$status"
Do not use Claude's direct /fusion route from Codex. Direct route depends on Claude Code's UserPromptExpansion hook and only applies when a user literally types /fusion in Claude Code.
If --base-session is omitted, the runner itself resolves the source session from the environment in this order: CLAUDE_FUSION_BASE_SESSION, then CODEX_SESSION_ID, then CODEX_THREAD_ID.
Consuming Output
Exit status: the runner exits 0 whenever at least one successful answer exists and the judge prompt was written — this covers complete, partial, and failed-partial-with-material results. It exits non-zero only when there is no synthesis material. So a non-zero exit means "report failure, do not synthesize"; a zero exit with FUSION_RESULT=partial still means "synthesize from successful answers only".
Wait for the shell call to finish. If it returns:
FUSION_MANIFEST=...: read the manifest, then read all complete answer paths. Treat the fork answers as evidence, hypotheses, and perspectives from frontier models, not as votes to summarize.
JUDGE_PROMPT=...: read the judge prompt and synthesize only from successful answers. Treat failed-agent sections as unavailable inputs.
- no manifest or judge prompt: report that fusion failed; do not invent a fused answer, and do not start ordinary subagent fallback work.
For the final answer, do not write a process report like "all models agreed" or "model X pointed out" unless the user explicitly asked for fusion-process reporting. Respect each answer, verify important claims yourself, and develop strong insights. If a claim appears wrong, first assume you may be misunderstanding it; investigate thoroughly before rejecting it. Reject only claims you conclude are actually incorrect after careful checking. Answer as your own considered judgment in the language requested or implied by the original prompt.