Import DESIGN.md in CLAUDE.md
Claude Code reads ./CLAUDE.md or ./.claude/CLAUDE.md at the start of every session. An @path line expands another file into that context, so one import keeps your design rules loaded without pasting them in.
TipImports inside backticks or code blocks are ignored. Write @DESIGN.md as plain text.
# Project instructions
## Design
Follow the design system in @DESIGN.md for all UI work.
- Use its color, typography, spacing and radius tokens. No new hex values.
- Reuse components in src/components before creating new ones.
- If DESIGN.md has no rule for a case, ask before inventing one.
- After UI changes, list the tokens and components you used.
How @ imports resolve
- Paths resolve from the file that holds the import, not from where you launched Claude
- Keep DESIGN.md in a subfolder? Write @docs/DESIGN.md, or use an absolute path
- Imported files can import others, up to four hops deep
- For a path with spaces, put a backslash before each space; quoted paths aren’t imported
- Files outside the project trigger a one-time approval prompt
- Imports organize files but don’t save context: the whole file loads every session
Already using AGENTS.md?
Claude Code (version 2.1.277 or later) reads AGENTS.md only when there is no CLAUDE.md or CLAUDE.local.md in your working folder or above it. If both exist, it reads CLAUDE.md. To share one setup with Codex or Cursor, put @AGENTS.md in CLAUDE.md and keep the DESIGN.md line in AGENTS.md.
Load design rules only for UI files
In a large repository, move the design rules into .claude/rules/ui.md and add a paths list to its front matter, such as src/components/**/*.tsx. Claude Code loads that rule only when it reads or edits a matching file. Tell it there to read DESIGN.md first.
Check what Claude built
- Ask which DESIGN.md tokens it used, and look for raw hex values in the diff
- Open the page at a phone width and a desktop width
- Compare buttons, headings and spacing with the Components and Typography sections
- When the same miss repeats, add a Do or Don’t to DESIGN.md
- After editing DESIGN.md, run npx @google/design.md lint DESIGN.md
