AITraining2U

Programs

Resources

Case Studies

Quick Links

Enquire Now
Domain 2 · 20%% of exam

Imports, AGENTS.md and exclusions

Composing memory files across repos and tools.

4 min read · Lesson 5 of 11 in this domain

Imports let you compose memory from several files, which is good for organisation — but it is worth being clear about what they do not do. An @path import is expanded at launch, so splitting one long CLAUDE.md into five imported files leaves exactly the same amount of text in context. If your goal is a smaller context, imports are the wrong tool and path-scoped rules are the right one. Imports are for structure and reuse: sharing a conventions file across repos, or pulling in a file another tool already owns.

Key points
  • @path/to/file imports a file, expanding it into context at launch. Relative paths resolve against the file containing the import.
  • Imports can nest to a maximum depth of four hops.
  • Import parsing skips code spans and fenced blocks — wrap a path in backticks to mention it literally without importing.
  • Splitting into imports helps organisation but does not reduce context, since imported files load at launch anyway. Use path-scoped rules for that.
  • Claude Code reads CLAUDE.md, not AGENTS.md. If your repo uses AGENTS.md, create a CLAUDE.md whose first line is @AGENTS.md.
  • claudeMdExcludes takes glob patterns matched against absolute paths, configurable at any settings layer, with arrays merging across layers. Managed policy CLAUDE.md cannot be excluded.
Exam trap

Renaming AGENTS.md to CLAUDE.md — it breaks the other agent. Import it instead.

Check your understanding

Does splitting CLAUDE.md into @imports reduce context usage?

Correct answer: B — No — imports expand at launch
Imports help organisation, not context size. Use path-scoped rules to reduce context.

Your repo already has AGENTS.md. Best approach?

Correct answer: B — Create a CLAUDE.md that starts with @AGENTS.md
Renaming breaks the other tool; Claude Code reads CLAUDE.md, not AGENTS.md.

Practise this domain with 20%%-weighted questions in the study app.

Open in study app

Source: Claude Code Docs — Memory · Independent study aid, not affiliated with or endorsed by Anthropic.