ยท Jonathan Mondaut

CLAUDE.md vs AGENTS.md: one source for both agents

I use Claude Code and Codex on the same repos, often on the same day. For a while, each repo had two instruction files: CLAUDE.md for Claude Code and AGENTS.md for Codex.

They started identical. Within a few weeks they weren't. I'd fix a test command in one after a bad session and forget the other. Then Codex would run the old command, and I'd wonder why it kept failing on something Claude Code got right.

Two files with the same job will drift. Here's how I got down to one, and what I do when one repo isn't the problem anymore.

Who reads what

Skills follow the same split. Claude Code looks in .claude/skills/, and Codex looks in .agents/skills/. Same idea, same format, two folders.

So by default, every rule you want both agents to follow lives in two places.

Fix 1: make one file import the other

Claude Code supports imports. A line that starts with @ followed by a path pulls that file in. So the simplest fix is to make AGENTS.md the real file and reduce CLAUDE.md to this:

@AGENTS.md

Now both agents read the same text. Put anything that only matters to Claude Code (a hook, a tool it should prefer) below the import line, and keep everything shared in AGENTS.md.

For skills, a symlink does the same job:

ln -s ../.agents/skills .claude/skills

This is what I'd tell anyone with one repo and two agents. It costs nothing and it works today.

Fix 2: decide what goes in the file at all

Once there's one file, it tends to grow. Mine kept growing until I noticed that half of it wasn't about the repo. It was about me: how I like commits written, which test runner I prefer, "never push to main".

Those rules belong to me, not to the repo, so they should follow me everywhere. A rough way to sort them:

Where one file stops being enough

The import trick fixes two agents in one repo. It doesn't fix the same conventions across many repos.

Every repo still has its own AGENTS.md. Every one starts as a copy and drifts on its own. When Codex writes a good skill in one repo, the others never hear about it. Your user-level files help, but only on your machine, and they can't tell a backend repo from a frontend one.

That's the problem I built Baudrier for. Your instructions, skills and subagents live in one GitHub repo you own, called a harness, and Baudrier serves it to Claude Code and Codex over MCP in every repo you connect.

In each repo, it writes a short Baudrier block in AGENTS.md, and CLAUDE.md imports it, the same trick as above. Repo-specific facts stay in the file, outside the block. Everything shared comes from the harness, so there's nothing to copy.

If you already have a good AGENTS.md or CLAUDE.md somewhere, start from it:

uv tool install baudrier
baudrier import --name my-harness --out ~/my-harness --write

import reads both files, plus your skills and subagents, and writes them into a separate harness repo. It doesn't touch the originals. Push that repo to GitHub, then in any other repo:

baudrier use <you>/my-harness

Both agents now read the same harness, in every repo you connect. When one of them improves a skill, it comes back as a pull request on the harness, and you decide whether to merge it.

The short version

Baudrier is in closed Alpha, for Claude Code and Codex. Request an invite and tell me your setup: how many repos, which agents, and where your rules live today.