memory-system:instruction-file-hierarchy
Instruction File Hierarchy Pattern overview
The canonical instruction-file memory pattern used across coding agents: a filesystem hierarchy of instruction files where project root → nested directories → user home forms a layered scope. Each level can provide, extend, or override instructions from outer scopes. Implementations include CLAUDE.md (Claude Code, Pi), AGENTS.md (Codex, Amp, Gemini CLI, Goose, OpenCode), .cursorrules and .cursor/rules/*.mdc (Cursor), .clinerules (Cline), .windsurfrules (Windsurf), and .roorules (Roo Code). The pattern is version-controllable, diff-readable, and requires no runtime infrastructure. Cross-agent convergence is visible: Cursor added AGENTS.md support, Pi adopted CLAUDE.md. The hierarchy depth and merge semantics (override vs append) vary by agent but the core pattern — scoped instruction files loaded at session start — is universal.
Attributes
Outgoing edges
- layer:12-knowledge-fabric·LayerKnowledge Fabric
Incoming edges
- agent-version:agent-mux@current·AgentVersion
- agent-version:agent-mux-remote@current·AgentVersion
- agentVersion:babysitter-agent:ge-5-0-0·AgentVersionbabysitter-agent
- agent-version:babysitter@current·AgentVersion
- agent-version:babysitter-sdk@current·AgentVersion
- agent-version:claude-agent-sdk@current·AgentVersion
- agentVersion:copilot:ge-0-0-0·AgentVersionGitHub Copilot CLI
- agent-version:v0@current·AgentVersion