Codex reads AGENTS.md, not CLAUDE.md. So on that small task it never saw your rules at all.
You don't have to write them twice. Move the rules into AGENTS.md and turn CLAUDE.md into a one-liner that points at it:
Read AGENTS.md for the project rules.
Claude Code follows the pointer, Codex reads AGENTS.md directly, and there's one file to keep up to date. A symlink (ln -s AGENTS.md CLAUDE.md) works too, but a pointer is easier to understand for the next person who opens the repo.
A few other tools read AGENTS.md these days as well, so check the docs of whatever you use before writing a third file.