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.30 | 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
| 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. | 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. |
| 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. | 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 Since 2.0.30, configured sources follow the global and project files in the baseline instruction list. | 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. | 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. | 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. |
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.30 | 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 | 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. | 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. | Yes. In a
| 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 | 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. | Not supported No. Writing | Partly AGENTS.md content is sent as-is; @path references inside it are not expanded. Since 2.0.30, use the instructions config array to load extra files, glob matches or HTTP(S) URLs. Relative patterns search upward from the workspace to the project root; ~/ and absolute paths are accepted. | 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 | Since 2.0.30, opencode.json instructions entries load files, globs and HTTP(S) URLs. Config entries are combined and deduplicated by source string. URLs are fetched on config load/change with a five-second timeout; a failed fetch retains the last successful copy or skips that URL. Clients can still set per-session instruction entries through the server API. |
|
| Generate a starter file | 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.30 | 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. | Run
Changing the Project instructions mode applies from your next message. | Partly Run In the editor, Customize → Rules shows every rule and its status. | Partly Global and upward AGENTS.md edits are watched. Since 2.0.30, matched configured local instruction files are watched too; config.updated triggers a rescan and URL refetch. Remote content is not polled on every file rescan. These sources appear as Instructions from: <path> blocks; older nested-file evidence remains separately pinned. | 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. | Partly There is no flag to skip instruction files for a run. To exclude a file, list an | Partly Set Nested In 2.0.30, explicit absolute paths and URLs can still load even when discovery scopes are disabled. Relative configured patterns use project discovery when enabled, otherwise the global config directory when global discovery is enabled. Disabling project discovery is not a blanket ban on configured instructions. | 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. | 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. | Partly Since 2.0.30, instructions entries from managed config documents also contribute guidance. The same loader combines entries from other config scopes, so managed instructions do not create an exclusive instruction set. A system-directory AGENTS.md is not automatically discovered. Source establishes loading, not model compliance. | 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 |
Notes and sources
Codex CLI, 17 sources
- At each level, an override file wins over AGENTS.md and configured fallback names.
- Codex skips empty files and applies a configurable combined-byte limit.
- Instructions are persistent context, not skills and not permission grants.
Where it looks, and when nested files load, 4
Add instructions from config or flags, 4
See what loaded, and apply edits, 5
Enforce instructions for an organisation, 4
Claude Code, 9 sources
- User and managed CLAUDE.md and .claude/rules do not suppress AGENTS.md fallback.
- Direct AGENTS.md loads do not fire InstructionsLoaded hooks; imports through CLAUDE.md do.
- Instructions provide context, not enforced operation policy.
Which files it reads, 1
Where it looks, and when nested files load, 1
When several apply, which wins, 1
Size limits, 1
One file for several harnesses, 3
Rules for some paths, or only on request, 2
Include other files, 1
Add instructions from config or flags, 3
Generate a starter file, 2
See what loaded, and apply edits, 4
Turn them off or skip some, 5
Enforce instructions for an organisation, 3
Cursor Agent, 7 sources
- Enforced team rules cannot be disabled by users.
- AGENTS.md is the plain-Markdown alternative to structured project rules.