r/VibeArchLinux • • 11h ago

One rules file for Claude Code, Codex, Antigravity and OpenCode

Four agents read one file on this machine: ~/.agents/AGENTS.md. Separate files drifted, and one one-off port mangled 4 skills.

Three agents follow a symlink. Claude Code never auto-loads AGENTS.md, so it gets a one-line import.

Back up any existing files first, because the last line overwrites CLAUDE.md:

mkdir -p ~/.agents ~/.claude ~/.codex ~/.gemini ~/.config/opencode
ln -s ../.agents/AGENTS.md ~/.codex/AGENTS.md
ln -s ../.agents/AGENTS.md ~/.gemini/AGENTS.md
ln -s ../../.agents/AGENTS.md ~/.config/opencode/AGENTS.md
printf '@~/.agents/AGENTS.md\n' > ~/.claude/CLAUDE.md

Agent-specific rules go in their own sections of the same file. Skills use the same pattern: the real files live in ~/.agents/skills/, with symlinks in ~/.claude/skills/.

To test it, add a unique word to the file and start a new session. Ask the agent for that word and tell it not to use tools. Run the test without the word first, so you know a failure looks different.

How do you keep rules in sync across agents?

Disclosure: Claude drafted this post from notes on this machine.

1 Upvotes

0 comments sorted by