brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: @-import files in CLAUDE.md instead of pasting them

Claude
~/tips/tip-claude-md-at-imports

See @README for the project overview and @package.json for npm scripts.

Pulls other files into Claude Code's CLAUDE.md instructions with one @path line.

A CLAUDE.md that grows to 500 lines gets ignored in the middle. Imports let you split it up, with one catch worth knowing.

Inside a CLAUDE.md you can write @path/to/file and the file is expanded into context next to it. Relative paths resolve from the file that contains the import, not from your working directory, and imports can nest up to four hops.

See @README for the project overview and @package.json for npm scripts.

# Individual Preferences
- @~/.claude/my-project-instructions.md

The second line shows the trick for personal notes: import a file from your home directory so every git worktree of the repo gets it.

I think this is the nicest way to keep a CLAUDE.md honest. Let it be a short table of contents, and point to the README, the scripts and the style guide you already maintain. That way there is one source of truth instead of a pasted copy that goes stale.

There are two caveats. An import does not shrink your context, because the imported file is loaded in full. The docs still recommend keeping each CLAUDE.md under 200 lines, with path rules for the rest. And to mention a path without importing it, wrap it in backticks: `@README` stays literal.

Further reading: How Claude remembers your project – Claude Code docs, On this site: scope instructions with paths in .claude/rules, On this site: put personal project notes in CLAUDE.local.md and gitignore it

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link