Codex/Claude routing discipline

Two AI coding tools sit on this codebase: Claude (via Claude Code) and Codex (via Codex CLI). Both are flat-fee subscriptions (Claude Max 5x, ChatGPT Pro). The user pays for both, so the question is not “which is cheaper per token” - it is “which authors which kind of work, and how do we keep the routing from drifting silently.”

Core claim

Soft routing rules (“prefer Codex first”) drift toward whichever agent is in front of the user at the moment. The agent doing the planning is the agent doing the implementing - unless the rule keys on something mechanical like file extension, not on judgment (“trivial vs. non-trivial”).

Evidence

  • derived - 7-day commit audit on 2026-05-05 showed Claude authored 57/68 ≈ 84% of co-authored commits despite CLAUDE.md routing implementation to Codex first. Source: git log --pretty="%(trailers:key=Co-Authored-By,valueonly)" | sort | uniq -c
  • observed - Codex Pro dashboard sat at 98%/99% remaining the same night; Claude Max 5x at 41% session / 4% weekly. Both subscriptions had enormous headroom. Pure flat-fee waste.
  • observed - User reaction: “I thought I WAS having codex code everything… I thought the hand off to Codex was happening.” The agent drift was invisible from the user’s side.
  • derived - The original CLAUDE.md rule said “Trivial one-liners are the only exception.” Claude over-applied “trivial” to anything that fit in one Edit call. Judgment-based exceptions silently widen.

When it applies

Any solo-developer setup with two or more LLM coding tools on the same repo. Especially relevant when one tool does both planning and implementation (Claude, here) - there is no friction to “just do it inline” so the routing rule loses every time.

When it breaks

  • Explicit single-file user directive (“edit foo.py yourself”) - override is fine and should be honored.
  • Pure docs/markdown/memory edits - these belong to the planning agent by default; routing them to the implementer adds friction with no quality gain.
  • Genuine emergencies where waiting on a Codex handoff would block live trading. Even here the discipline is to file a follow-up task to refactor what was hot-patched.

The fix that worked

Replace “trivial vs. non-trivial” with extension-keyed routing:

  • Claude may directly edit only: *.md, memory files, ~/brain/**, .gitignore, files the user explicitly names.
  • Everything else (.py, .ts, .sh, .sql, anything under src//tests//scripts//migrations//ops/) MUST go via Codex handoff.
  • One-line typos in code: still go to Codex. The point is routing discipline, not optimization for the smallest case.
  • Codex handoff defaults: gpt-5.5 + high reasoning (was gpt-5.4 + medium). With ChatGPT Pro you have enough headroom to use the frontier model on every task that matters.

How to audit

git log --since="7 days ago" --no-merges \
  --pretty=format:"%h %s | %(trailers:key=Co-Authored-By,valueonly)" \
  | grep -c "Codex"   # vs. grep -c "Claude"

If Claude commits dominate over a sustained period, the rule has drifted again. The trailer is the source of truth - git log --author is useless because both tools commit as the local git config user.

See Also


Timeline

  • 2026-05-05 | observed (user) - User noticed Codex Pro dashboard at 98–99% remaining despite “dozens of commits this week.” Triggered audit.
  • 2026-05-05 | derived (git log) - 7-day audit: Claude 57 commits, Codex 11. Original CLAUDE.md “Codex first” rule with “trivial one-liners” exception had silently drifted.
  • 2026-05-05 | observed (user) - Decision: extension-keyed hard rule, no judgment exception. Bumped global Codex default to gpt-5.5 + high reasoning. Logged as feedback_codex_implements_not_claude.md in flat-file memory + this concept page.
  • 2026-05-05 | derived (commit 349eb8b) - First commit using gpt-5.5 landed within minutes of the config change. Co-author trailer reads Co-Authored-By: Codex (gpt-5.5) <noreply@openai.com>.