cd /news/ai-agents/how-to-sync-agents-md-and-claude-md-… · home › topics › ai-agents › article
[ARTICLE · art-168874] src=gethrbr.com ↗ pub= topic=ai-agents verified=true sentiment=· neutral

How to sync AGENTS.md and CLAUDE.md across all your repos

A November 13, 2026 blog post lays out three ways to keep AGENTS.md and CLAUDE.md rules consistent across repositories: the repo-file-sync-action GitHub Action, which copies listed files into listed repos and opens a pull request in each by default; the rulesync command-line tool, which writes each agent's rules file from one source in a .rulesync/ folder and can pull shared rules from another GitHub repo pinned in a lockfile; and per-vendor admin settings. The post recommends keeping shared text in AGENTS.md and having each CLAUDE.md import it with an @AGENTS.md line so only one file is synced, and notes repo-file-sync-action's last release, v1.21.1, dates from May 2024 and requires a personal access token or GitHub App installation token because the default GITHUB_TOKEN cannot write to other repos. It also notes Codex has no documented organization-wide instructions setting, leaving most teams syncing a file anyway.

by read5 min views1 publishedNov 13, 2026
How to sync AGENTS.md and CLAUDE.md across all your repos
Image: Gethrbr (auto-discovered)

Blog

Published: November 13, 2026

To sync AGENTS.md and CLAUDE.md across repos, keep the shared rules in one repository and send them to every other repo as a pull request: either a GitHub Action that copies the file out on each push, or rulesync, which installs rules from a shared repo and writes each agent's file. Put the shared text in AGENTS.md, and have each CLAUDE.md import it, so you sync one file, not two.

Sync one file: AGENTS.md #

Codex, Cursor and Copilot read AGENTS.md. Claude Code reads it when the repo has no CLAUDE.md, and otherwise through a line that says @AGENTS.md at the top of the CLAUDE.md (Does Claude Code read AGENTS.md?). So the shared rules belong in AGENTS.md, and CLAUDE.md keeps the import plus anything only Claude needs. Which file each tool reads is in AGENTS.md vs CLAUDE.md.

Push: a GitHub Action that opens a pull request in every repo #

repo-file-sync-action runs in the rules repo on every push and copies the files you list into the repos you list. By default it opens a pull request in each one, so every team still decides what merges:

group:
  - files:
      - source: AGENTS.md
        dest: AGENTS.md
    repos: |
      acme/payments
      acme/web
      acme/api
  • It needs its own token. The defaultGITHUB_TOKEN cannot write to other repos. Its README asks for a personal access token with full repo scope, or a GitHub App installation token.
  • It copies the whole file. A repo's own root rules are overwritten on the next sync, so this suits repos whose root rules are all shared. To mix in each repo's own, use rulesync, below.
  • Check it is still maintained. Its last release, v1.21.1, is from May 2024. A short workflow of your own withgh pr create does the same job.

Pull: rulesync and a shared rules repo #

rulesync is a command-line tool that writes the rules file for each agent (Claude Code, Codex, Cursor, Copilot and dozens more) from one source in a .rulesync/ folder. It can also pull rules from another GitHub repo and pin them in a lockfile:

npx rulesync add acme/ai-standards --rules team-rules
npx rulesync install && npx rulesync generate

npx rulesync install --outdated

Each repo keeps its own rules next to the shared ones, and rulesync combines them into one AGENTS.md, so nothing is overwritten. The pull runs when someone runs it, so add the --outdated check to CI to see which repos are behind.

Without touching the repos: each vendor's admin setting #

An admin setting reaches every repo on a machine or in an organization, one tool at a time:

Tool Organization-wide instructions Reaches
Claude Code A managed CLAUDE.md at/Library/Application Support/ClaudeCode/ (macOS) or/etc/claude-code/ (Linux), or aclaudeMd key in managed settings Every session on that machine. You ship the file with MDM or similar
Codex None documented. Managed configuration covers approvals, sandbox, network and telemetry Each person's ~/.codex/AGENTS.md is the closest thing
Cursor Team Rules , on Teams and Enterprise Every member, and an admin can enforce them
Copilot Organization custom instructions, in the organization’s Copilot settings Cloud sessions on GitHub and code review, not local sessions in an editor

That is three admin consoles, each on its own plan, and nothing for Codex, which is why most teams end up syncing a file anyway.

What a sync does not do #

  • Edits in one repo do not travel back. Someone fixes a rule inacme/web , and the next sync either overwrites it or conflicts with it. Only edits made in the rules repo reach everyone.
  • Nobody writes the new rule down. A correction typed in an agent session, or a review comment on a pull request, stays where it was said unless a person copies it into the rules repo.
  • A file grows until it stops working. One shared file for every repo gets long, and agents follow a long file less well (why a growing CLAUDE.md stops working ).

With Harbor: one source the agents read, no copies #

Harbor keeps the team's rules in one place and hands them to Claude Code, Codex, Cursor and Copilot at the start of each session, through hooks that npx harborloop init installs, so there is no file in each repo to keep in step. Each session gets the rules that apply to its repo and task, not the whole set. New rules come from where the team already decides (agent sessions, pull request reviews, Slack threads and docs), and you set the gate on which go live without a person. The AGENTS.md and CLAUDE.md files you already have are imported when you set it up, and each of their rules waits for a person to review it (rules files). The steps are in the quickstart, and the wider picture in sharing memory across Claude Code, Codex and Cursor.

Questions #

How do I share one AGENTS.md across many repositories?

Keep it in a rules repo and send it out as pull requests. A GitHub Action such as repo-file-sync-action copies the file into each repo you list on every push. rulesync instead lets each repo pull named rules from the shared repo, pins them in a lockfile and combines them with the repo's own.

Do I need to sync CLAUDE.md as well as AGENTS.md?

No. Put the shared rules in AGENTS.md and start each CLAUDE.md with a line that says @AGENTS.md. Claude Code then reads the shared file, and CLAUDE.md keeps only what Claude alone needs. Claude Code also reads AGENTS.md by itself when a repo has no CLAUDE.md.

Can an admin set CLAUDE.md for the whole organization?

Yes, per machine. Claude Code reads a managed CLAUDE.md from /Library/Application Support/ClaudeCode/ on macOS or /etc/claude-code/ on Linux, or a claudeMd key in managed settings, shipped to each machine with MDM or a similar tool. Developers cannot exclude it.

Does Codex have organization-wide instructions?

Not in its docs as of 13 November 2026. Codex managed configuration covers approvals, sandbox, network and telemetry. Each person can keep ~/.codex/AGENTS.md for their own repos, and the shared text otherwise has to be in each repo's AGENTS.md.

── more in #ai-agents 4 stories · sorted by recency
── more on @repo-file-sync-action 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-sync-agents-m…] indexed:0 read:5min 2026-11-13 · —