Video coming soon
Use @ imports to split your project memory across focused files, and learn the AGENTS.md pattern for team-shared context.
A single CLAUDE.md works great for small projects. But as your conventions grow, testing standards, component patterns, API guidelines, deployment rules, that file gets long and hard to maintain. In this lesson, we split project memory across focused files using the @ import syntax, and introduce a pattern for keeping everything organised.
After the last lesson, your CLAUDE.md might already have 50+ lines of conventions. Now imagine adding:
A 300-line CLAUDE.md is hard to read, hard to maintain and hard to review in pull requests. When everything is in one file, a change to your testing conventions shows up in the same diff as your component rules.
Claude Code supports an @ syntax inside CLAUDE.md that imports content from other files. The referenced file gets loaded as if its content were inlined at that position.
# CLAUDE.md
@AGENTS.mdThat single line pulls in the entire contents of AGENTS.md at load time. You can reference multiple files:
# CLAUDE.md
@docs/architecture.md
@docs/api-standards.mdHow references work:
@ import@~/.claude/personal-prefs.mdCLAUDE.mdAGENTS.md is the universal equivalent of CLAUDE.md. While CLAUDE.md is specific to Claude Code, AGENTS.md is recognised by most AI coding tools including GitHub Copilot, Cursor, Gemini CLI and others.
Claude Code doesn't natively read AGENTS.md yet. It looks for CLAUDE.md. But here's the thing: since Claude Code supports @ file references, we can get the best of both worlds. Keep your CLAUDE.md as a minimal entry point that references AGENTS.md:
# CLAUDE.md
@AGENTS.mdNow your project conventions live in AGENTS.md, a file that most AI tools already understand, and Claude Code picks it up through the reference. If a teammate uses Cursor, Copilot or any other agent that supports the standard, they get the same conventions automatically without needing a separate config file for each tool. One file, every agent.
Move the project context that /init generated in the previous lesson into AGENTS.md. This is the same content, just in a different file. Open your CLAUDE.md, cut everything out, and paste it into a new AGENTS.md file. Then update CLAUDE.md to just reference it with @AGENTS.md, as shown above.
Why split it this way?
CLAUDE.md stays tiny. It's just the entry point. Easy to see at a glance.AGENTS.md is the real document. It holds the structured project context, and it's where most edits happen.AGENTS.md is recognised by Copilot, Cursor, Gemini CLI, Codex and others. Your conventions aren't locked into one tool.AGENTS.md makes it clear this file is for AI agents, not humans reading a README. Anyone browsing the repo understands its purpose immediately.AGENTS.md commits, separate from other project changes.In the next lesson, we'll add focused rules for specific areas like testing and UI development.