2026-07-18·2 min read

Two agents, one set of rules

field-notesariadneclaude-code

Ariadne is the second brain I built so my coding agents remember things between sessions. This note is about a smaller problem inside the same tool: keeping two agents’ house rules from disagreeing with each other.

I run more than one coding agent day to day. Claude Code reads its instructions from a CLAUDE.md. Codex reads the same kind of file but calls it AGENTS.md. Same rules in both: how commits get written, when to ask before touching main, the whole procedural layer of the vault. And they’d started to drift. I’d tighten a rule in one, forget to carry it to the other, and the two agents would end up following slightly different versions of my own conventions. It’s the same failure I wrote about in Loom: two things meant to agree, edited at different times, going stale in different directions.

Generate, don’t duplicate

The fix was to stop hand-maintaining two files. global/CLAUDE.md in the vault is canonical now. AGENTS.md is generated from it by scripts/sync-agent-instructions.mjs, a zero-dependency Node script, out of three inputs: the canonical file, a versioned policy that classifies each section, and a short list of Codex-specific overrides. A “Claude” reference in the canonical file has to become tool-neutral for Codex, so the script adapts the text against the policy rather than copying it wholesale.

Checked, not assumed

--check exits non-zero if the generated file is stale, so it can sit in a gate instead of relying on me to remember to regenerate. --write does the regeneration. The validator is strict on purpose: it refuses to generate if it hits an H2 section the policy hasn’t classified, or a Claude-specific reference whose literal replacement doesn’t match what’s in the file. The rule I hold myself to is never to loosen that validation and never to hand-edit the generated output. If AGENTS.md looks wrong, the fix goes in the canonical file or the policy, not the generated file. And if a write fails partway, the previous AGENTS.md stays on disk and stays authoritative until a later run succeeds.

So the day-to-day loop is: edit global/CLAUDE.md, classify anything new in the policy, run --write, read the diff, run --check, then commit the canonical file, the policy, the overrides, and the generated output together.

This first release does exactly one thing. It doesn’t sync skills yet, and it doesn’t drop per-machine stubs. What it does do is make it impossible for the two instruction files to silently disagree.