Harness Notes

Instructions

Updated 2026-11-22,

On this page

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

Questionpichecked at 1.2.0
Which files it reads

Pi reads context files named AGENTS.override.md, AGENTS.md, AGENTS.MD, CLAUDE.md or CLAUDE.MD, using only the first one it finds in each directory, in that order. Separately, SYSTEM.md replaces Pi's default system prompt and APPEND_SYSTEM.md adds to it; both live in ~/.pi/agent/ or the project's .pi/ folder. There is no rules directory.

AGENTS.override.md only replaces the other file in the same directory. Context files in other directories still load.

Where it looks, and when nested files load

At startup Pi loads one file from the agent directory (~/.pi/agent, or $PI_CODING_AGENT_DIR), then one from the working directory and from every parent directory up to the filesystem root. Files in subdirectories below the working directory are never loaded, not even when Pi works on files there. SYSTEM.md and APPEND_SYSTEM.md are read only from <cwd>/.pi/ and ~/.pi/agent/, not from parent directories.

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

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 .pi/SYSTEM.md or .pi/APPEND_SYSTEM.md replaces the user file of the same name rather than being combined with it.

Size limits

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

Questionpichecked at 1.2.0
One file for several harnesses

Yes. Pi reads AGENTS.md, so a file written for Codex or other AGENTS.md tools works as is, and it falls back to CLAUDE.md in any directory that has no AGENTS.md. No setting is needed. If a directory has both, only AGENTS.md is used. Pi does not read ~/.claude/CLAUDE.md, .cursor/rules, GEMINI.md or similar files.

Pi also discovers skills in a project's .agents/skills directory, which other harnesses share. Skills are loaded on demand, not as instruction files.

Rules for some paths, or only on request

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 /skill:name. Setting disable-model-invocation: true in a skill's frontmatter means it loads only when you call it explicitly.

Include other files

Not supported

No. Context files are inserted as plain text, so @path lines and links are not expanded. The model can still read a linked file with its tools if the instructions tell it to.

Add instructions from config or flags

--append-system-prompt <text|path> adds text or a file's contents and can be repeated; it replaces any discovered APPEND_SYSTEM.md for that run. --system-prompt <text|path> replaces Pi's base prompt, but context files are still added after it. Extensions can add or change prompt sections in a before_agent_start handler, and SDK users can add virtual context files with agentsFilesOverride. There is no settings key or environment variable for instruction text, and no way to load it from a URL.

Generate a starter file

Not supported

There is no /init or similar command. Create AGENTS.md by hand, or ask Pi to write one with its file tools.

Control

Questionpichecked at 1.2.0
See what loaded, and apply edits

The interactive startup header has a Context section listing every file loaded: SYSTEM.md, APPEND_SYSTEM.md, then the context files. It is hidden when quietStartup is true or "header", and --verbose shows it anyway. Edits are not picked up automatically; run /reload to re-read context files and update the system prompt in the current session.

Turn them off or skip some

Run pi --no-context-files (-nc) to skip every AGENTS.md/CLAUDE.md file for that run. You can't exclude a single file or directory, but adding an AGENTS.override.md to a directory replaces that directory's file. Project .pi/SYSTEM.md and .pi/APPEND_SYSTEM.md load only in trusted projects, so --no-approve (-na) skips them; context files load whether or not you trust the project.

--no-context-files does not affect SYSTEM.md or APPEND_SYSTEM.md.

Enforce instructions for an organisation

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 --no-context-files or replaced with --system-prompt.

Notes and sources

pi, 12 sources
Which files it reads, 2
Where it looks, and when nested files load, 3
When several apply, which wins, 3
Size limits, 2
One file for several harnesses, 2
Rules for some paths, or only on request, 2
Include other files, 1
Add instructions from config or flags, 4
Generate a starter file, 1
See what loaded, and apply edits, 4
Turn them off or skip some, 3
Enforce instructions for an organisation, 1