Instruction files are guidance you write once and every session reads, such as AGENTS.md, CLAUDE.md or Cursor rules. Notes a harness saves on its own are on the Memories page.
What gets loaded
| Question | Codex CLIchecked at 0.162.1 | Claude Codechecked at 2.1.299 | Cursor Agentchecked at 2026.10.12-d47ca18 | OpenCodechecked at 2.0.28 | pichecked at 1.2.0 |
|---|---|---|---|---|---|
| Which files it reads | Codex reads Fallback names apply only to project directories, not to Fallback entries must be plain file names; entries containing | Claude Code reads
| Project rules are
| Only | Pi reads context files named
|
| Where it looks, and when nested files load | Global: In an untrusted project Codex skips project AGENTS.md files entirely and keeps only the global file.
Codex reads | At launch it loads the managed file (macOS Directories added with Subdirectory files and path-scoped rules don't appear under Memory files in | At startup the CLI walks from the workspace directory up to the filesystem root, loading The docs describe CLAUDE.md and AGENTS.md at the project root and in subdirectories; the CLI's walk up through parent directories is wider than the editor docs suggest. Source | At startup it loads If the workspace is outside the project root, only the global file is loaded. Inside home the walk can go past the repository root, so an | At startup Pi loads one file from the agent directory ( If a linked git worktree sits inside its main checkout, the worktree's own context file replaces the main repo's copy so the same instructions don't load twice. Source |
| When several apply, which wins | All applicable files are concatenated: the global file first, then project files from the root down to the working directory, separated by blank lines (with a Instructions you type in the prompt, and | Every applicable file is concatenated into context; nothing overrides anything. Order is managed, user, then project files from the filesystem root down to your working directory, with CLAUDE.md content is sent as a user message after the system prompt, and Claude treats it as guidance, not enforced configuration; use hooks or permissions for hard rules. Source | All applicable rules are merged into the context; none replaces another. When guidance conflicts, Team Rules beat Project Rules, which beat User Rules, and a nested | All applicable files are combined, not overridden: the global file first, then project files nearest-first, each as an | Every context file found is added in full to the system prompt, each in its own block labelled with its path, in this order: agent-directory file first, then from the filesystem root down to the working directory. Pi does not resolve conflicts, so the model sees all of them; the file closest to the working directory comes last. A trusted project |
| Size limits | Project files share a combined budget of Raise it with Because the root file is read first, an oversized root file can push out deeper, more specific files. Some config docs describe the limit as per file; in 0.162.1 the budget is shared by all project files. Source | Claude Code loads a CLAUDE.md of up to 4 MiB in full and skips any larger file entirely. Files over the recommended length (about 200 lines) trigger a startup and The 200-line / 25KB truncation applies only to auto memory's | Partly There is no hard size limit or truncation of rule bodies; Cursor recommends keeping each rule under 500 lines and splitting larger ones. A rule's Every always-applied rule, AGENTS.md and CLAUDE.md uses context window on every request, so long files cost tokens. Source | There is no size limit or truncation. Each file is included whole. Source | There is no size limit. Each file is read in full and pasted into the system prompt without truncation, so very large files use up the model's context window. Source |
Writing them
| Question | Codex CLIchecked at 0.162.1 | Claude Codechecked at 2.1.299 | Cursor Agentchecked at 2026.10.12-d47ca18 | OpenCodechecked at 2.0.28 | pichecked at 1.2.0 |
|---|---|---|---|---|---|
| One file for several harnesses | Partly Codex natively reads only
| Yes. With the default Project instructions mode Direct AGENTS.md reading needs v2.1.277+ and the built-in plugin enabled; before v2.1.281 it didn't work on Bedrock/Vertex/Foundry or with telemetry off. Before v2.1.285 the plugin ID was Other tools' files such as | Yes. The CLI reads Claude Code's | Partly
| Yes. Pi reads Pi also discovers skills in a project's |
| Rules for some paths, or only on request | Partly The only scoping is by directory: put an Files deeper than the working directory are not injected; the model is only told to look for them itself. Source | Yes: a If the frontmatter YAML doesn't parse, the rule loads unconditionally; Path-scoped rules that live in a symlinked directory outside the project don't load even after external imports are approved; only unscoped ones do. Path-scoped rules are summarized away by compaction and reload on the next matching file access. Source | Yes. In a
| Partly There are no glob or frontmatter rules. A nested | Not supported No. Context files have no globs or frontmatter and always apply to Pi runs in their directory or below it. For guidance that should load only when it's relevant, write a skill: the model loads it on demand, or you can force it with |
| Include other files | Not supported No. Codex inserts each file's text exactly as written, so | Yes: write Imports organize content but don't save context: imported files load in full at launch. An external import inside a directly-read AGENTS.md loads only if external imports were already approved for the project, with no prompt. Source | Not supported No. Writing | Not supported No. | Not supported No. Context files are inserted as plain text, so |
| Add instructions from config or flags | Set The older | Use
In resumed conversations the recorded system prompt is reused; pass | Partly There is no flag or environment variable that injects instruction text. You can load extra rules with | Partly Not from config yet: the |
|
| Generate a starter file | Yes:
|
|
| Yes. | Not supported There is no |
Control
| Question | Codex CLIchecked at 0.162.1 | Claude Codechecked at 2.1.299 | Cursor Agentchecked at 2026.10.12-d47ca18 | OpenCodechecked at 2.0.28 | pichecked at 1.2.0 |
|---|---|---|---|---|---|
| See what loaded, and apply edits | Run When instructions change mid-session, Codex sends the model a note that the new AGENTS.md text replaces the old one. The docs say to restart Codex to pick up changes; there's no reload command. Source | Run
Changing the Project instructions mode applies from your next message. Source | Partly Run In the editor, Customize → Rules shows every rule and its status. Source | Partly There is no command that prints the loaded files; each one appears in the model context as an | The interactive startup header has a Context section listing every file loaded: |
| Turn them off or skip some | Partly There's no dedicated flag.
| To skip instruction files for a run, use
The built-in Explore and Plan subagents skip CLAUDE.md at startup. Source | Partly There is no flag to skip instruction files for a run. To exclude a file, list an | Partly Set Nested | Run
|
| Enforce instructions for an organisation | Yes. Admins set Admins can't lock or block a repository's own AGENTS.md files; the managed text is added alongside them. Source | Partly Admins can deploy a managed A user can still start with Instructions are guidance, not enforcement; use managed In | Yes, on Team and Enterprise plans. Admins create Team Rules in the dashboard and tick Enforce this rule so members cannot turn them off; enforced and enabled Team Rules apply to every repository, including CLI sessions. Admins can also mark a plugin that ships rules as Required so it cannot be uninstalled. Non-enforced Team Rules can be switched off by each member in Customize. Source | Not supported No. Managed config in | Not supported No. Pi has no managed or admin policy layer. Every instruction source is a user-editable file or a command-line flag, and any of them can be switched off with |