Today I learned CLAUDE.md supports @ imports to pull in content from other files β including home directory paths. This lets teams share coding standards from a central repo while keeping personal preferences local.
Source: Claude Code Docs β Memory imports
Basic Syntax
Use @path/to/file anywhere in your CLAUDE.md:
# CLAUDE.md
See @README.md for project overview.
## Architecture
@docs/architecture.md
## Coding Standards
@docs/coding-standards.md
@docs/testing-conventions.md
When Claude starts a session, these imports are expanded and the contents are loaded into context.
Path Types
# Relative paths (relative to the file containing the import)
@docs/guidelines.md
@../shared-standards.md
# Home directory
@~/.claude/my-preferences.md
# Absolute paths
@/home/user/.claude/standards.md
Real-Life Team Setup
The Pattern: Shared Standards + Personal Preferences
1. Team commits coding standards to a central repo or shared directory:
shared-standards/
βββ code-style.md
βββ security.md
βββ api-conventions.md
2. Project CLAUDE.md imports them (committed to version control):
# CLAUDE.md β committed, everyone gets this
## Company Standards
@shared-standards/code-style.md
@shared-standards/security.md
@shared-standards/api-conventions.md
## Project Architecture
@docs/architecture.md
Every team member cloning the repo gets the same standards automatically.
3. Personal preferences stay in CLAUDE.local.md (auto-gitignored):
# CLAUDE.local.md β NOT committed, only on your machine
- I prefer 2-space indentation
- Use pnpm instead of npm
- My sandbox test URL: http://localhost:3001
# Pull in personal rules from home directory
@~/.claude/my-debugging-tips.md
Across Multiple Worktrees
If you work with multiple git worktrees of the same project, CLAUDE.local.md only exists in one. Use home directory imports to share personal rules across all of them:
# CLAUDE.md (committed)
@docs/team-standards.md
# Personal rules shared across worktrees
@~/.claude/my-project-preferences.md
Recursive Imports (Up to 5 Levels)
Imported files can import other files, up to 5 levels deep:
CLAUDE.md
βββ @docs/project-standards.md (level 2)
βββ @../shared/company-rules.md (level 3)
βββ @~/.claude/base-rules.md (level 4)
βββ @../global.md (level 5)
βββ @... β stops here
This lets you build layered hierarchies β global rules β company rules β project rules β without repeating yourself.
Example: Hierarchical Standards
<!-- ~/.claude/base-rules.md (personal global) -->
- Use semantic commit messages
- Write tests for new features
<!-- shared-standards/company.md -->
@~/.claude/base-rules.md
Company additions:
- Use the company logger, never console.log
- Follow OWASP security guidelines
<!-- docs/project-standards.md -->
@../shared-standards/company.md
Project additions:
- Use Redux for state management
- All API responses use the standard envelope format
<!-- CLAUDE.md -->
@docs/project-standards.md
Result: Claude loads all four levels of standards in one import chain.
Things to Know
- Code blocks are ignored β
@somethinginside backticks or fenced code blocks wonβt be imported - First-time approval β Claude shows a one-time dialog when a project first uses imports. If declined, imports stay disabled for that project.
- Check whatβs loaded β run
/memoryin a session to see all loaded files including imports - Relative paths resolve from the importing file, not the working directory
How LearnAI Team Could Use This
- Keep shared Claude Code standards in a central LearnAI repo and import them into each project CLAUDE.md.
- Put course-specific, content QA, and publishing rules in separate imported files so Claude loads the right context per workspace.
- Let each team member keep private local preferences in CLAUDE.local.md while still inheriting the same team standards.
Real-World Use Cases
- Shared team standards imported via
@~/team-standards/code-review.mdacross all project repos. - Course-specific rules in
@./course-rules.mdthat only load in that course workspace. - Personal preferences in
CLAUDE.local.mdthat override team defaults without editing shared files.