r/codex • u/Spirited-Ad-3342 • 21d ago
Showcase Built a tool that makes Codex follow my rules all the time
Freelance DevOps/data consultant here. Half my clients are on Codex and half on Claude Code, so I was maintaining the same rules in AGENTS.md and CLAUDE.md in a bunch of repos, and they kept drifting apart.
AGENTS.md definitely helps. I ran some tests and Codex followed the rules in 12 out of 18 runs with it, versus 6 without. But that still means one run in three broke something, and nothing stops it. Long sessions are the worst.
So I made Stele (open source). You write your rules once and it generates the AGENTS.md section for you, plus CLAUDE.md if you need that too. Then it hooks into Codex. Before Codex edits a file, it gets stopped and shown the rules for that file. After it writes, Stele checks the new code, and if it broke a rule Codex has to fix it before moving on. The same rules run in CI too.
With Stele it was 18 out of 18. It does use more tokens, about 28% more than plain AGENTS.md, mostly because there's usually one extra turn.
Things to know:
- you need to approve the hooks with /hooks the first time
- only rules with a check attached get checked after a write, the rest are just shown before the edit
- Codex only reads the first 32 KB of AGENTS.md, so if your rules are huge some can get cut off (Stele still shows them before edits)
- writes through the shell are only partly caught, CI is the real safety net
Curious if anyone else is dealing with this, especially across multiple client setups.
stele.lictorlabs.com
•
u/dexterthebot 21d ago
You might want to consider listing your project on the weekly Show-Us-What-You-Built post. Look out for it on Tuesday/Wednesday. Highest commented project wins a week promotion on r/Codex and gets on the Hall of Fame sidebar. See below for last week's winner.**
Light Wars AR: real-life laser tag app with no extra gear. Your phone is the gun and your room is the map. Play up to 6 friends in the same room, or fight drone waves and bosses solo. The vision models run on the phone, and camera frames never leave it. Free on iPhone and Android.
Website: https://lightwarsar.com
iPhone: https://apps.apple.com/us/app/light-wars-ar-laser-tag-party/id6508168951
Android: https://play.google.com/store/apps/details?id=com.lasertag.lightwars.
Contact: contact@lightwarsar.com
1
u/Discordbothost 21d ago
the 12/18 vs 18/18 runs are the most useful part tbh. the shell gap is the one i'd worry about, codex loves sed -i and python -c to patch files. a git diff check in a stop hook catches those too since it doesn't care how the file changed