agentleFS
anhnguyen0905anhnguyen0905/codex-mcp/skills/executor-fallback/SKILL.md

executor-fallback

Skill4 starsChanged 4 days agoMITView on GitHub

Keep a codex-flow run alive when Codex cannot execute — outage triggers, the single explicit AskUserQuestion switch at a task boundary, STATE.md and Decision-log recording, Phase 4 and Phase 5 with Claude as executor plus an independent subagent review, returning to Codex, and the fast-path small-change lane under fallback.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run your own conformance → quality → security pass as usual, then apply the review-dual comparison protocol to the two reviews.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Executor fallback — Claude executes when Codex is unavailable

Codex is the default executor. When it cannot run, the flow does not die: the user chooses once, explicitly, between fixing Codex and letting Claude execute. The planning, approval, review, and reporting contract stays identical; only WHO writes the code changes.

Triggers (any one):

  • Phase 0: mcp__codex__codex_health tool call fails, the server is missing, loggedIn: false, or the deep call's execProbe is quota, model, or error.
  • Mid-run: a codex_execute / codex_continue / codex_review returns failed or aborted with no sessionId, or its errors/stderr indicate authentication, quota exhaustion, or an unreachable service. No health re-check is required: an execProbe of quota or model, or a run error carrying those signatures, is sufficient on its own to open the fallback decision.
  • Mid-run: the same task exhausts bounded auto-resume twice in a row (attempts/resumeReasons).

Decision — use AskUserQuestion exactly once per outage with two options: Fix Codex and re-check (recommended when the user can log in or restore service now) or Continue with Claude as executor. Never switch executors silently, and never switch mid-task: finish or reset the current task first (per the preflight in-progress reconciliation), then switch at the task boundary.

Recording — STATE.md carries executor: codex by default. On fallback set executor: claude (fallback: <not-logged-in | server-missing | codex-unavailable> <ISO 8601>); on return set executor: codex (restored <ISO 8601>). Record each switch once in PLAN.md's Decision log using the non-task event-block schema from codex-flow:plan-architecture.

Phase 4 under fallback — for each task in dependency order, sequential mode only:

  • Generate and read the task's .codex-flow/CONTEXT-T<n>.md slice exactly as for Codex, and apply the loaded exec-coding-standards, exec-self-testing, language, deliverable, and distilled domain-skill blocks to your own work — they bind Claude the same way they bind Codex.
  • Perform the same durable pre-launch writes, but write - Session: claude-fallback (base: <short sha>).
  • Implement ONLY this task, within its Files: scope. Run the task's acceptance command yourself and record - Verification: <command> → exit <code> in the task's report entry; this replaces the server-side verification field.
  • Parallel worktree mode is not available under fallback; when task-waves reports width > 1, still run sequentially and note it in the Decision log.

Phase 5 under fallback — Claude must not grade its own homework alone:

  • Replace mcp__codex__codex_review with an independent review by a fresh subagent (a code-review agent, or a general-purpose agent with the review skills), given the same focus block from codex-flow:review-dual (task id, acceptance criteria, Files: list, review order).
  • Run your own conformance → quality → security pass as usual, then apply the review-dual comparison protocol to the two reviews.
  • Fix verified CRITICAL/HIGH findings directly (there is no Codex session to route them to), re-run the task's acceptance checks after every round; the full suite runs once in the whole-feature review. Keep the 3-round cap; after 3 rounds, stop and re-plan the task with the user.
  • Report PIC for a fallback task is claude (fallback: <reason>) per codex-flow:session-report; cost.md reports measured Codex cost for the run's Codex tasks only and says so.

Returning to Codex — at any task boundary, when the user says Codex is available again, re-run mcp__codex__codex_health with { deep: true }; on loggedIn: true with execProbe: ok restore executor: codex (restored <ISO 8601>) and run the remaining tasks through Codex normally. Tasks completed under fallback keep their claude-fallback Session line and are never re-executed.

Fast-path small-change lane under fallback — allowed: Claude implements the ≤ 2 files itself under the same embedded blocks, runs the lane's known-red comparison, and gets the independent subagent review in place of the skipped codex_review. Log session=claude-fallback in fastpath.log.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.