Rules
Do all your agents read the same instructions? Many projects keep a CLAUDE.md for
Claude Code and an AGENTS.md for Codex and others, and over time the two disagree.
Yardmaster finds every rule file, tells you which agents read each one, flags pairs that
have drifted apart, and edits a file only after showing you a diff and taking a backup.
It never edits a symlink or a file it cannot read back, and it never writes without your
confirmation.
Find rule files and drift
Section titled “Find rule files and drift”Open ConfigRules. Each row is a rule file with the agents
that read it, its scope, an estimated token count, and its size. A drift mark appears
beside a file whose AGENTS.md partner is different. The states are same, linked,
imported, and different.


yardmaster config --what rulesyardmaster config --what rules --project ~/code/storefrontyardmaster rules show ~/code/storefront/CLAUDE.mdRULES┌──────────────────────────────┬─────────────┬───────┬────────┬───────────────┬───────────────────┐│ FILE ┆ READ BY ┆ LINES ┆ SIZE ┆ TOKENS (est.) ┆ LOADED IN │╞══════════════════════════════╪═════════════╪═══════╪════════╪═══════════════╪═══════════════════╡│ ~/code/storefront/CLAUDE.md ┆ Claude Code ┆ 38 ┆ 908 B ┆ ~227 tokens ┆ ~/code/storefront ││ ~/code/storefront/AGENTS.md ┆ Codex ┆ 52 ┆ 1.4 KB ┆ ~350 tokens ┆ ~/code/storefront │└──────────────────────────────┴─────────────┴───────┴────────┴───────────────┴───────────────────┘CLAUDE.md ↔ AGENTS.md in ~/code/storefront: DIFFERENTCLAUDE.md ↔ AGENTS.md in ~/code/api: importedrules show <FILE> prints the text exactly as stored.
Tool: check_rules (read-only). Pass project (an absolute path) to keep user-level
files plus one folder’s.
{ "name": "check_rules", "arguments": { "project": "/Users/you/code/storefront" } }{ "rules": [{ "kind": "CLAUDE.md", "readers": ["Claude Code"], "scope": "project", "path": "~/code/storefront/CLAUDE.md", "lines": 38 }], "drift": [ { "left": "CLAUDE.md", "right": "AGENTS.md", "state": "different", "lines_dropped": 12, "fix": { "command": "yardmaster rules fix ...", "import_line": "@AGENTS.md" } } ], "drifted": 1}Each drift carries a diff preview and the command for you to run. The tool changes nothing.
Ask your agent: “Check whether my CLAUDE.md and AGENTS.md have drifted apart.”
Fix drift
Section titled “Fix drift”A fix replaces the CLAUDE.md (or GEMINI.md) with one line that imports the
AGENTS.md next to it, such as @AGENTS.md, so every agent loads the same text from then
on. The diff shows what is dropped, and the old text stays in the backup.
In ConfigRules, click Fix drift… on the file. The preview shows the diff and a warning that lists how many lines will stop loading. Click apply to write it.


cd ~/code/storefrontyardmaster rules fix CLAUDE.md # dry run: diff onlyyardmaster rules fix CLAUDE.md --yesRun it inside the project so the project’s file is found, or pass the path the
config --what rules table shows.
~/code/storefront/CLAUDE.md (CLAUDE.md, project ~/code/storefront, read by Claude Code) becomes `@AGENTS.md`warning: 12 lines only in this file will no longer load (kept in the backup)
+1 −38...┌─────────────┬───────────┬────────┬────────┐│ AGENT ┆ ITEM ┆ ACTION ┆ DETAIL │╞═════════════╪═══════════╪════════╪════════╡│ Claude Code ┆ CLAUDE.md ┆ fix ┆ ... │└─────────────┴───────────┴────────┴────────┘1 change to make. Run again with --yes to apply.Not available over MCP. check_rules shows the diff and the rules fix command, and
leaves the writing to you.
Gemini CLI imports only from its own folder, so a GEMINI.md is fixed only when the
AGENTS.md is next to it.
Edit a rule file
Section titled “Edit a rule file”In ConfigRules, click Edit… on a file. Change the text and click Preview changes. Nothing is written until you review the diff and save.


yardmaster rules show CLAUDE.md > new.md# edit new.md, then:yardmaster rules edit CLAUDE.md --from new.md # dry run: diff onlyyardmaster rules edit CLAUDE.md --from new.md --yescat new.md | yardmaster rules edit CLAUDE.md --from - --yes--from takes a file or - for standard input. The output has the same shape as
rules fix.
Not available over MCP. The server has no write tools.
Backups and restore
Section titled “Backups and restore”Every change backs up the current text first, in Yardmaster’s rule-backups folder.
Restoring is an ordinary edit: it shows a diff, backs up the text it replaces, writes
atomically, and reads the file back.
In ConfigRules, click Backups on a file to list its backups with the lines each would add and remove. Pick one to preview putting it back. A backup identical to the file now cannot be picked.


yardmaster rules backupsyardmaster rules backups ~/code/storefront/CLAUDE.mdyardmaster rules restore 1733500000 --yesrestore takes the backup’s full name or its leading digits when they are unique.
Without --yes it prints the diff only.
┌─────────────────────────────┬───────────────────────┬──────────────────┬───────┬──────────────┬─────────┐│ FILE ┆ BACKUP ┆ TAKEN ┆ SIZE ┆ RESTORE ADDS ┆ REMOVES │╞═════════════════════════════╪═══════════════════════╪══════════════════╪═══════╪══════════════╪═════════╡│ ~/code/storefront/CLAUDE.md ┆ 1733500000-CLAUDE.md ┆ 2026-12-04 10:12 ┆ 908 B ┆ +38 ┆ −1 │└─────────────────────────────┴───────────────────────┴──────────────────┴───────┴──────────────┴─────────┘1 backup in ~/.local/share/yardmaster/rule-backups. `yardmaster rules restore <backup>` previews putting one back.Not available over MCP. The server has no write tools.