Skip to content

Definition

The mechanisms for composing memory: @path imports that inline other files into a CLAUDE.md, and path-scoped .claude/rules/*.md files that load instructions only for matching paths.

Key points

  • Imports: @path (relative or absolute) pulls another file's content in; imports resolve up to a max 4 hops deep. Imports inside code spans/fences are skipped.
  • claudeMd (managed scope only) inlines managed content; claudeMdExcludes is a glob array that can exclude memory files — but cannot exclude managed policy.
  • AGENTS.md is not read directly — bridge it with a CLAUDE.md containing @AGENTS.md.
  • Rules: .claude/rules/*.md with paths: frontmatter globs load only when the working path matches. User rules load before project rules, so project rules win on conflict.
  • These are the composition layer on top of the CLAUDE.md Hierarchy concatenation.

Why it matters for the exam

  • D3 (20% of scored content) can test the 4-hop import limit, that AGENTS.md needs an @import bridge, and that rules are path-scoped with project-over-user precedence.

Common gotchas

  • @import chains deeper than 4 hops stop resolving.
  • @path inside a fenced code block or inline code span is not imported — a frequent trap.
  • claudeMdExcludes cannot strip the managed policy file.

See also

Sources