Skip to content
Back to skills

Claude Codex Fallback

ASecurity

CLI 기반 자동화에서 Claude를 우선 사용하고 계정 사용량 한도 초과 때만 Codex로 재실행하는 폴백을 구현하거나 점검할 때 사용

  • 366 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added October 22, 2026
ai-agents

Works with

  • claude code
  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 22, 2026

npx -y skills add bam-bam-2/solo-skills --skill claude-codex-fallback --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Claude Codex Fallback?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Claude Codex Fallback
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bam-bam-2-claude-codex-fallback/badge)](https://www.skillsdirectory.com/skills/bam-bam-2-claude-codex-fallback)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "claude-codex-fallback"
description: "CLI 기반 자동화에서 Claude를 우선 사용하고 계정 사용량 한도 초과 때만 Codex로 재실행하는 폴백을 구현하거나 점검할 때 사용"
---

> **이 스킬이 시스템에 하는 일 (설치 전 확인)**
>
> - `claude`와 `codex` CLI를 **로컬에서 실행**합니다. 둘 다 설치돼 있어야 합니다.
> - OAuth 토큰을 `~/.config/llm/claude-oauth-token`에서 **읽기만** 합니다. 출력하거나 전송하지 않습니다.
> - 프롬프트는 임시파일(`mktemp`, mode 600)에 두고 **종료 시 삭제**합니다.
> - 네트워크 호출은 각 CLI가 하는 것뿐이고, 이 스크립트가 따로 하는 외부 통신은 없습니다.

# Claude 우선, Codex 조건부 폴백

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. 실제 운영 환경에서 무발송 또는 읽기 전용 프롬프트로 한도 감지와 폴백 성공 로그를 확인한다.

Files in this skill

  • SKILL.md2 KB
  • scripts/llm-with-fallback.sh1.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.