Pi reads AGENTS.md in every folder above you
Pi loads one context file from each folder between the filesystem root and where you start it, and AGENTS.md wins over CLAUDE.md in the same folder. Pi doesn’t ask before running tools, so when the rules tell it to run ultracite fix and check, it runs them.
Pi by EarendilChecked against Pi 1.1.0
# Ultracite Code Standards
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
## Quick Reference
- **Format code**: `npx ultracite fix`
- **Check for issues**: `npx ultracite check`
- **Diagnose setup**: `npx ultracite doctor`
Oxlint + Oxfmt (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
…- 1
~/.pi/agent/AGENTS.mdYour instructions for every project.AGENTS.override.mdorCLAUDE.mdthere work too. - 2
AGENTS.override.mdIn any folder, replaces that folder’sAGENTS.mdorCLAUDE.md. Other folders still load. - 3
AGENTS.md, root to working folderUltraciteOne per folder from the filesystem root down to where you started, outermost first. - 4
CLAUDE.mdUsed in a folder only when it has noAGENTS.md.
How Pi reads the rules
Pi takes your global file from ~/.pi/agent, then one context file from each folder between the filesystem root and your working folder. In each folder the first of AGENTS.override.md, AGENTS.md and CLAUDE.md wins.
- One per folder
- Pi loads the first of
AGENTS.override.md,AGENTS.md,AGENTS.MD,CLAUDE.mdandCLAUDE.MDin each folder. - Past the repo
- The walk doesn’t stop at the git root, so an
AGENTS.mdin a parent folder applies too. - Not below
- Only the working folder and its parents count. Pi doesn’t load
AGENTS.mdfiles from subfolders. - Trust
- Context files load whether or not you trust the project. Trust covers
.pisettings, extensions and skills. - Turn it off
--no-context-files(-nc) skips discovery for one run.- Reload
- Run
/reloadafter editing instructions; Pi picks them up without a restart.
No prompts and no hooks, just the rules
Pi has no built-in approval prompts and no hook files, so the commands in AGENTS.md run as soon as the model decides to run them. Extensions can change tool results with a tool_result handler, but Ultracite doesn’t ship one for Pi yet.
- **Format code**: `npx ultracite fix`
- **Check for issues**: `npx ultracite check`
- **Diagnose setup**: `npx ultracite doctor`- 01Pi changes a file with its
editorwritetool. - 02Following
AGENTS.md, the model runsnpx ultracite fixornpx ultracite checkwithbash. - 03Pi runs the command without an approval prompt.
- 04The model reads the output and fixes what’s left.
Worth knowing about Pi
The Ultracite skill asks for trust
A project
.agents/skillsfolder is trust-gated, so afterinitinstalls the skill, Pi asks whether to trust the project. Print, JSON and RPC modes can’t ask, so they skip it unless you pass--approveor setdefaultProjectTrustto"always".Extensions see every tool result
An extension in
.pi/extensions/or~/.pi/agent/extensions/can register atool_resulthandler that changes what the model gets back from a tool. Handlers run in load order and see each other’s changes. Ultracite doesn’t provide one yet.No approvals, so isolate it
Pi runs tools with the permissions of the account that started it and has no built-in sandbox. Its docs recommend running it inside a container, VM or sandbox, and giving it only the files and credentials the task needs.
The Ultracite skill
Pi loads skills from
.pi/skills/and from.agents/skills/in the working folder and its parents up to the repo root, so it finds the Ultracite skillinitinstalls once you grant project trust. Run/skill:ultraciteto load it yourself.
Pi questions, answered
- Does Pi read AGENTS.md?
- Yes. Pi loads
~/.pi/agent/AGENTS.mdand one context file from each folder between the filesystem root and where you start it, preferringAGENTS.mdoverCLAUDE.md. - Does Pi still read my CLAUDE.md?
- Only in folders without an
AGENTS.md. Pi takes one file per folder, so onceinitwritesAGENTS.mdbeside yourCLAUDE.md, Pi readsAGENTS.mdthere and skips theCLAUDE.md. Move anything Pi still needs intoAGENTS.md. - Does Pi support hooks?
- Not as config files. Pi’s extensions are TypeScript modules that subscribe to events with
pi.on(), includingtool_result, which can change what a tool returns to the model. Ultracite doesn’t provide one yet. - How do I run Pi with Ultracite in CI?
pi --print "…"runs the prompt and exits, and--mode jsonstreams events as JSONL instead. Add--approveso trust-gated project resources, the Ultracite skill among them, load without a prompt.
Keep going
- AgentCrushCharm’s terminal coding agent that works with many model providers, with LSP context and MCP.
- AgentAiderTerminal pair programmer that edits files in your git repo, lints each one and commits the change.
- AgentMistral VibeMistral AI’s open-source terminal coding agent, also usable in editors over ACP.
- DocsAgent rulesWhat
initwrites for every agent, and how to keep it current.
Ship less slop
One command sets up your linter, formatter, editor and agents. Works with Oxlint, Biome and ESLint.