Skip to content
How it learnsFrom coding sessions, reviews, Slack and docs.Only what fitsEach session gets the few rules its task needs.Pull request reviewEvery PR checked against your team’s rules.Keep it trueA gate, conflicts, disputes and stale rules, handled.HandoffsCarry the work to another session or a teammate.SecurityWhat it sends, what it changes and how to leave.
Engineering teamsOne agent or several: what one person learns, every session uses.PR review onlyInstall the GitHub App. Nothing on anyone’s machine.Teams that mix agentsClaude Code, Cursor, Codex and Copilot, the same rules.On your ownYour corrections follow you across repos, machines and agents.Book a call30 minutes with Roei, if you want a hand. Never required.
DocsPricingSign in
Connect your agents →
For teamsOn your ownPR review onlyHow it learnsOnly what fitsPull request reviewKeep it trueSecurityDocsPricingSign inConnect your agents →
Home/Answers

Answers

Ignores its rule file

  • HTML comments in CLAUDE.md
  • "Read AGENTS.md" does not import
  • Antigravity ignores AGENTS.md
  • Windsurf ignores rules

Rule file too long

  • AGENTS.md too long for Codex
  • Antigravity rule size limit
  • Copilot instructions length
  • Cursor rules too long

Rules drift from the code

  • CLAUDE.md and AGENTS.md drift
  • Directory trees in rule files

Share rules across repos and agents

  • Share CLAUDE.md across repos
  • Share AGENTS.md in Codex
  • Copilot org instructions
  • Gemini CLI and AGENTS.md
  • Share Windsurf rules

Memory between sessions

  • Gemini CLI memory

Answers

Codex shares instructions across repos only through ~/.codex/AGENTS.md, one person at a time

Published November 18, 2026

Codex shares instructions across repositories through one place: the global ~/.codex/AGENTS.md (or $CODEX_HOME/AGENTS.md), which loads first in every project, for the person whose machine it is on. OpenAI documents no organization-wide or managed instructions setting, so a team that wants the same rules everywhere has to put AGENTS.md in each repo and keep the copies in sync.

For Codex. Vendor facts are from the pages linked below, read on November 18, 2026.

The free ways

  • For yourself: write cross-repo habits in ~/.codex/AGENTS.md. It loads in every project, untrusted ones included, and does not count toward the 32 KiB project budget.
  • For a team: keep the shared AGENTS.md in one repo and push it to the others with a sync action, or pull it with rulesync and a lockfile.
  • Keep repo-specific lines in a nested AGENTS.md so the synced root file stays identical everywhere.
  • Use AGENTS.override.md for a temporary local change; it replaces only its own folder’s AGENTS.md.
  • If CODEX_HOME is set, the global file is in that folder, not ~/.codex. Run echo $CODEX_HOME when edits seem to have no effect.
# ~/.codex/AGENTS.md  (loads first, in every project)
- Use pnpm, never npm.
- Open a PR; never push to main.

The numbers

MeasureValueSource
Global instruction files Codex reads1, ~/.codex/AGENTS.md (or AGENTS.override.md)Codex AGENTS.md docs
Project instruction budget32 KiB; the global file is not countedCodex AGENTS.md docs
Public AGENTS.md files on GitHub1,142,784Harbor study, 18 Oct 2026

Study figures are weighted estimates from 1,935 CLAUDE.md and 1,970 AGENTS.md files sampled from public GitHub repositories on 18 October 2026, with GitHub's own counts for the totals. Every figure is in the study's CSV, and the method is in the study.

What the docs say

  • Codex: Custom instructions with AGENTS.md: The global scope defaults to ~/.codex unless you set CODEX_HOME, so every repository inherits your working agreements. Codex reads AGENTS.override.md first and falls back to AGENTS.md. The page documents no organization or managed instructions.

Where Harbor fits

Harbor connects Claude Code, Codex, Cursor and GitHub Copilot (the CLI and VS Code agent mode; the cloud agent is not supported yet) through hooks and an MCP server. Through Codex’s hooks it serves the team’s rules in every repo and every teammate’s session, picked for the task, with nothing to sync. Codex runs a hook only after you trust it; harbor init records that trust. Each rule shows how often it was served and how often an answer cited it. A citation is evidence a rule was used, not proof it was obeyed.

Read next

  • Sync AGENTS.md across repos
  • Why Codex ignores AGENTS.md
  • Share memory across Claude Code, Cursor and Codex
  • Share CLAUDE.md rules across repos with ~/.claude/rules, a symlinked .claude/rules, or a managed CLAUDE.md
  • Copilot organization instructions reach every repo, but only on GitHub.com and in code review
  • Gemini CLI reads AGENTS.md only if context.fileName lists it; Antigravity CLI reads it by default
  • Share Windsurf rules across repos with ~/.devin/rules, and with other agents through AGENTS.md
  • Every answer, by agent and problem

Questions

Does Codex have global instructions?

Yes. ~/.codex/AGENTS.md, or AGENTS.md in the folder CODEX_HOME points to, loads first in every project, before the project files.

Can an organization set AGENTS.md for every Codex user?

OpenAI’s AGENTS.md page documents no organization or managed instructions setting as of 18 November 2026. Its managed configuration covers settings such as approvals and sandboxing, not instructions.

How do I share AGENTS.md across many repositories?

Sync it: push one file to every repo with a GitHub Action, or pull it with rulesync from a shared rules repo. Keep repo-specific lines in nested files so the shared one stays identical.

Your team’s rules, in every agent, checked on every PR.

Harbor is shared memory for your team’s Claude Code, Cursor, Codex and Copilot. Free for you and one teammate. No card. No end date.

Start free →

Product

  • How it learns
  • Only what fits
  • Pull request review
  • Keep it true
  • Handoffs
  • The result
  • Security
  • For coding agents
  • Pricing

Developers

  • Docs
  • Quickstart
  • Install
  • CLI
  • MCP server
  • Served and cited
  • Rule-file checker
  • Blog

Guides

  • Why Claude ignores CLAUDE.md
  • AGENTS.md vs CLAUDE.md
  • Share Claude Code memory with a team
  • Why Codex ignores AGENTS.md
  • Why Cursor ignores rules
  • Copilot instructions vs AGENTS.md
  • Shared memory across agents
  • Copilot Memory and Dreaming

Compare

  • All comparisons
  • vs Mem0
  • vs Zep
  • vs Unblocked
  • vs ByteRover
  • vs Cognee
  • vs Hindsight
  • vs OpenViking
  • vs Supermemory
  • vs Glen
  • vs MemPalace
  • vs Sentra
  • vs Trail-code

Company

  • Questions
  • Contact
  • X
  • LinkedIn
  • Privacy Policy
  • Terms of Service
  • Data Processing Agreement
  • Refund Policy
© 2026 HarborConnect your agents