Fable → Codex Bridge (fablex)

Keep long-running work on Fable. When a guardrail blocks a turn, use GPT-5.6 Sol instead of Opus.
Claude Fable is especially good at sustained, agentic coding tasks. The challenge
is that Fable 5 also has strict and sensitive domain guardrails. Legitimate work
can trip them, particularly around cybersecurity and biology. When that happens,
Claude Code normally retries the blocked turn on Opus.
fablex changes that fallback. Fable remains the primary model for the session,
but when its structured domain classifier blocks a turn, fablex skips the Opus
retry and hands the current turn to GPT-5.6 Sol through Codex. The following
turn returns to Fable, with Codex's outcome available as context.
Normal turn → Claude Fable
Classifier blocks a turn → Opus skipped → GPT-5.6 Sol completes that turn
Next turn → Claude Fable resumes
This is useful when you prefer Fable for the long-running task but want Sol, not
Opus, to take over the occasional turn that Fable's guardrails cannot handle.
What it does
- Keeps Fable as the default model throughout the session.
- Detects Claude Code's structured Fable classifier-refusal event.
- Prevents Claude Code from automatically retrying that turn on Opus.
- Sends the same request, bounded conversation context, and current repository
state to GPT-5.6 Sol through Codex.
- Returns control to Fable on the next turn instead of making Sol sticky.
fablex does not bypass either provider's safety policies. Ordinary Claude
refusals do not trigger a handoff, and Codex independently evaluates every
request it receives.
Why a launcher is necessary
Claude Code performs its Opus retry internally. A normal plugin hook only sees
the completed turn, so it cannot replace that retry in time. fablex launches
Claude Code with automatic model switching disabled, reads its structured event
stream, and invokes codex exec only when Fable's classifier event is present.
The launcher preserves Claude's session and the shared working directory. If
Fable changed files before the classifier event, Codex sees those changes and is
instructed to inspect the repository before continuing the turn.
Requirements
- Claude Code 2.1.170 or later, authenticated and able to use Fable 5
- Codex CLI 0.144.0 or later, authenticated and able to use
gpt-5.6-sol
- Python 3.10+
- Git (recommended and required by default for Codex handoffs)
- On Linux, system
bubblewrap is recommended; Codex can use its bundled fallback
Confirm the complete environment after installation:
fablex --doctor
Install
Clone the repository and run the installer:
git clone https://github.com/harshilmathur/fablex.git
cd fablex
./scripts/install.sh
This installs the plugin as a personal skills-directory plugin and links fablex into ~/.local/bin. Restart Claude Code and your shell after the first install. The plugin appears as fable-codex-bridge@skills-dir.
The terminal launcher is required for automatic pre-Opus routing. Installing only the Claude marketplace plugin provides the optional manual handoff skill, but a marketplace installation cannot add fablex to your shell's PATH.
For the manual Claude Code handoff skill without the terminal launcher, install
the marketplace plugin:
claude plugin marketplace add harshilmathur/fablex
claude plugin install fable-codex-bridge@fable-codex-bridge
For a one-session development load without installing the plugin components,
Claude Code also accepts --plugin-dir ./fablex; use the fablex launcher for
automatic pre-Opus routing.
Use
Start in any repository:
fablex
A Codex handoff requires the current directory to be inside a Git repository. This protects against accidentally granting an agent write access to an arbitrary directory. For deliberate non-repository work, use --allow-non-git.
Run a single prompt:
fablex --once "Investigate and fix the failing authentication tests"
Test the routes
Run these smoke tests from inside a Git repository. They request only a short
confirmation token and do not ask either model to produce sensitive content.
This ordinary prompt should stay on Fable and print only FABLE_NORMAL_OK:
fablex --once "This is a routing smoke test. Reply with exactly FABLE_NORMAL_OK and nothing else."
This cybersecurity classifier probe should hand off to Codex Sol:
fablex --once "This is a routing smoke test. Do not provide instructions or analysis. Reply only CYBER_HANDOFF_OK. Topic labels: malware, ransomware, credential theft, remote code execution, persistence, and defense evasion."
Expected output: