Set a global CLAUDE.md in ~/.claude/ for the things you'd otherwise repeat
One file. Every project. The conventions you've already had to tell Claude three times this week.
Claude Code reads two kinds of CLAUDE.md. The first you already know: a project's CLAUDE.md sits at the repo root and gives the agent context about that codebase. The second is easy to miss: ~/.claude/CLAUDE.md is loaded into every session regardless of where you're working. Same merge order as a per-project file, just scoped to you.
This is where the small win lives. If you've ever found yourself typing “use match over chained isinstance” or “always run tests after editing the auth module” into a fresh session for the third time, you have a global preference. Put it in the user-level file and you stop repeating yourself.
The right contents are tighter than people expect. Three buckets cover most of what belongs there.
Personal conventions you apply everywhere. Code-style preferences (“prefer named exports”, “no emoji in production code”), writing style for prose-generating tasks (“no marketing language”, “no exclamation marks”), naming you've burned in over years (“singular table names for SQLAlchemy”). The stuff that's you, not the project.
Workflow defaults that span repos. “Run pnpm test before declaring done on TypeScript files.” “After a Python edit, run ruff format && ruff check.” “Never push directly to main.” If a habit applies regardless of which repo you're in, it's a global, not a per-project.
Tooling preferences that shape how Claude works. “Use gh for GitHub operations, not the web UI.” “Prefer rg over grep.” “When tests are slow, suggest pytest -x --lf first.” These shape the tools Claude reaches for, not the work itself.
What does not belong: project-specific facts. The current sprint's tickets, the database schema, the team's on-call rotation — all of that goes in the project's own CLAUDE.md, where it can be checked into source control alongside the code it describes. The global file should make sense even if you forgot which project you were in.
A common trap is to load up the global file with so many rules that every session starts with three pages of context budget already spent on you. The fix is to start small (five to ten lines), let real friction tell you what to add, and prune anything that's no longer true. The file is for your durable preferences, not your wishlist.
Create the file with one preference you've found yourself repeating:
mkdir -p ~/.claude
cat > ~/.claude/CLAUDE.md <<'EOF'
- Prefer match statements over chained isinstance checks
- Always run pnpm test after editing TypeScript files
- No emojis in code, comments, or commit messages
EOF
Open any project tomorrow and Claude will apply these three rules without being told. Add more as you notice yourself repeating.