← Back to Journal

Why Claude Code Felt Dumber Than CodexIt wasn't the model. It was my own instruction files.

For months I had the same complaint: Claude Code builds the wrong thing, fast. Codex, on the same Mac and with the same person giving instructions, mostly did what I meant. I assumed one model was simply better. When I finally compared the two setups side by side, the gap was in files I had written myself.

The symptom

The pattern was consistent. I would describe a task to Claude Code and it would start editing files right away. The result was often reasonable code that solved a slightly different problem from the one I had in mind. Codex, given similar requests, tended to ask questions first, propose options and only start once we had agreed on something.

It is easy to turn that into a verdict about the models. Before doing that, I compared what each agent was actually told at the start of every session.

What I compared

Both agents read a personal instruction file on startup: AGENTS.md for Codex and CLAUDE.md for Claude Code. I had written both over time, and I assumed they said roughly the same thing. They did not.

The comparison turned up more gaps:

In other words, I had given one agent a process and the other a personality. The one with the process looked smarter.

Fix 1: add the missing gate

Of the options I considered, I chose the smallest: add only the gate, not a full copy of the other setup. Two new sections went into CLAUDE.md:

One detail worth knowing: the instruction file is loaded when a session starts. Editing it mid-session changes nothing until the next session.

Fix 2: instructions are not enforcement

The second problem was subtler. My CLAUDE.md already said "route every non-trivial request through the skill router first". In practice Claude Code often went through a whole session without loading a single skill. Twice in one day I asked it to "give me options" and it never entered the discussion skill built for exactly that.

When I looked, the router had no teeth. There were no hooks configured at all, so routing depended entirely on the model remembering a paragraph in a long file. Worse, routing was never measured on the Claude side: every logged routing event came from Codex, so the gap was invisible in my reports. Codex was not perfect either — its own measured hit rate for the discussion skill was only 2 out of 6 in the same period.

The fix was a UserPromptSubmit hook: a small script that runs on every message before the model sees it.

I tested it against a nine-case matrix — each trigger alone, both together, and three ordinary edit requests that must stay silent — and all nine passed.

One trap while testing: piping JSON into the hook with echo in zsh failed with a parse error, because zsh's built-in echo expands \n into real newlines. That looked exactly like a bug in the hook. Using printf, or passing input from a script, fixed it. The tool was wrong, not the code.

What changed afterwards

Since the gate went in, Claude Code opens most tasks by saying which workflow it chose and whether it can start yet, and it asks before building. I have not run a formal before-and-after benchmark, so I will not claim a number. The visible change is in the order of work: a decision comes first, then the edit.

Check your own setup

  1. Diff your instruction files. Put your CLAUDE.md and AGENTS.md side by side. Look for rules one agent has and the other doesn't — especially rules about when not to act.
  2. Separate style from process. Tone rules make answers nicer. Gate rules change what the agent does. If one file only has style, expect that agent to act first and ask later.
  3. Write exceptions into the gate. Read-only work and explicitly specified edits should not need a discussion, or you will start ignoring the gate yourself.
  4. Enforce what matters with hooks. A rule the model must remember is a suggestion. A hook that runs on every message is a mechanism.
  5. Measure both sides. If only one agent's behaviour is logged, the other one's failures are invisible.
  6. Start a new session after editing instructions.

Before you conclude that one coding agent is dumber than another, check what each one is told. Mine were not running the same race.

Claude CodeCodexCLAUDE.mdHooksAgent Workflow