claude-codex-fallback

claude-codex-fallback is a skill for Claude Code from bam-bam-2/solo-skills. It costs 40 tokens per session (630 once invoked), scanned B, original, MIT.

A shell script pattern that runs Claude Code first and retries the same prompt with Codex CLI only after Claude reports a confirmed usage limit.

In plain words
What is it for?
Use it in command-line automation that needs a controlled fallback between Claude Code and Codex when usage limits are reached.
Why use it?
It prevents ordinary network, authentication, parsing, or rate-limit errors from causing an unintended model switch, while preserving the original failure details.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code; mentions Codex.

Part of the solo-skills plugin — 26 skills shipped together

Good fit Use it in command-line automation that needs a controlled fallback between Claude Code and Codex when usage limits are reached.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bam-bam-2/solo-skills/claude-codex-fallback
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.

Any agent
npx skills add bam-bam-2/solo-skills --skill claude-codex-fallback
Clone the repo
git clone --depth 1 https://github.com/bam-bam-2/solo-skills

Made for: Claude Code.

Or install solo-skills, the plugin that ships this one along with the rest of its 26 skills.

Wrote 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.

agentmods badge for claude-codex-fallback

README.md
[![agentmods](https://agentmods.dev/badge/skills/bam-bam-2/solo-skills/claude-codex-fallback/github.svg)](https://agentmods.dev/skills/bam-bam-2/solo-skills/claude-codex-fallback)
Your own site
<a href="https://agentmods.dev/skills/bam-bam-2/solo-skills/claude-codex-fallback"><img src="https://agentmods.dev/badge/skills/bam-bam-2/solo-skills/claude-codex-fallback/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.

agentmods 80×15 button for claude-codex-fallback

Your own site · 80×15
<a href="https://agentmods.dev/skills/bam-bam-2/solo-skills/claude-codex-fallback"><img src="https://agentmods.dev/badge/skills/bam-bam-2/solo-skills/claude-codex-fallback.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 630 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Privilege Escalation · line 44
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
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.1 $0.00040 $0.00630
Opus 5 $0.00020 $0.00315
Sonnet 5 $0.00008 $0.00126
Haiku 4.5 $0.00004 $0.00063

Measured 6d ago against content hash 88869cfa41c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

claude-codex-fallback scanned grade B with 1 finding 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 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/llm-with-fallback.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

프롬프트는 임시파일에 `chmod 600`으로 두고 종료 시 지웁니다.
skills/claude-codex-fallback/SKILL.md · 45 lines

What it actually says

Claude 우선, Codex 조건부 폴백

이 스킬이 시스템에 하는 일 (설치 전 확인)

  • claudecodex CLI를 로컬에서 실행합니다. 둘 다 설치돼 있어야 합니다.
  • OAuth 토큰을 ~/.config/llm/claude-oauth-token에서 읽기만 합니다. 출력하거나 전송하지 않습니다.
  • 프롬프트는 임시파일(mktemp, mode 600)에 두고 종료 시 삭제합니다.
  • 네트워크 호출은 각 CLI가 하는 것뿐이고, 이 스크립트가 따로 하는 외부 통신은 없습니다.
  1. 같은 프롬프트를 안전한 임시파일에 저장한다.
  2. Claude Code를 먼저 실행한다. 자동화에 필요한 모델, 권한, 턴 상한을 기존 작업과 동일하게 유지한다.
  3. Claude가 실패했을 때 stdout과 stderr에서 실제 사용량 한도 문구만 판별한다.
    • 예: weekly limit, usage limit, hit your limit, limit ... resets
    • 일반 네트워크 오류, 인증 오류, 파싱 오류, 단순 rate limit은 자동 모델 전환 근거로 쓰지 않는다.
  4. 사용량 한도가 확정된 경우에만 같은 프롬프트를 Codex CLI로 한 번 재실행한다.
  5. Codex도 실패하면 원래 오류와 폴백 오류를 함께 기록하고 정상 산출물처럼 발송하지 않는다.
  6. 인증 토큰 값은 로그나 응답에 출력하지 않는다. Claude OAuth와 Codex ChatGPT 인증은 각 CLI의 기존 저장소를 사용한다.
  7. 배포 전에 세 경로를 각각 검증한다.
    • Claude 정상 성공: Codex 미호출
    • Claude 사용량 한도: Codex 호출 및 성공
    • Claude 일반 오류: Codex 미호출
  8. 실제 운영 환경에서 무발송 또는 읽기 전용 프롬프트로 한도 감지와 폴백 성공 로그를 확인한다.

바로 쓰는 스크립트

scripts/llm-with-fallback.sh — 실제로 매일 돌고 있는 실행기입니다.

echo "이번 주 지표 요약해줘" | ./scripts/llm-with-fallback.sh 80 opus

Claude를 먼저 쓰고, 사용량 한도 초과일 때만 같은 프롬프트를 Codex로 재실행합니다. 프롬프트는 임시파일에 chmod 600으로 두고 종료 시 지웁니다.

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago Changed · +13 lines 88869cfa41c4
  2. 11d ago First seen · 32 lines · 40 tokens per session scan B 7e63284ca1fa

Subscribe to this mod's changes

claude-codex-fallback is a skill published in the GitHub repository bam-bam-2/solo-skills (362 stars, last pushed 7d ago), licensed MIT. It adds 40 tokens to every session and 630 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.