Three names, one idea
Every major CLI converged on the same primitive: a markdown file in your repo that the agent reads before doing anything else. Claude calls it CLAUDE.md, Codex calls it AGENTS.md, Gemini calls it GEMINI.md. Same shape, same purpose: project memory that travels with the code.
Why this exists at all: prompts evaporate, files persist. If every contributor has to retype "we use TypeScript strict mode and never any" at the start of every session, the rule is functionally absent. Move it into a tracked markdown file and the agent reads it on every cold start, every git clone, every CI run. The repo finally has a memory the AI shares.
The hierarchy is the same across CLIs: global (your ~/.claude/, ~/.codex/, ~/.gemini/) → project (repo root) → nested (subdirectory-specific rules layered on top). Files merge, closer-to-cwd wins. Personal style preferences sit at the global level; team architecture sits at the project root; security-sensitive rules sit deeper.