Portrait of Michael Limberger

Michael Limberger

Need me? Email mike@limberger.ca

AI

Claude.Md - Project Memory

A briefing the model reads every morning

Every conversation starts fresh. The model does not remember yesterday. You give it memory through CLAUDE.md files. Markdown here just means a text file with light headings. Claude Code reads it at the start of every session. No special command required.

There are two homes. ~/.claude/CLAUDE.md is global and applies to all projects. ./CLAUDE.md is for this directory. Both load if both exist. The project file adds to the global one.

Show me. The easy way: cd ~/my-project, run claude, then /init. It scans the codebase and generates a CLAUDE.md with structure, languages, build and test commands, and key directories. Review it. Treat it as a starting point, not gospel.

Write it yourself if you know the house

Be specific. Here is a real-shaped example for a Perl Mojolicious project (historical sample name: techalicious-academy, a pay-per-tutorial platform that no longer exists as a live site). Stack: Perl 5.42, Mojolicious, SQLite, Stripe, Brevo. Dev server: morbo script/academy. Prod: hypnotoad script/academy. URL: localhost:3000. Structure: main app and routes in lib, plus controllers, models, templates, and tutorial text files. Config in config/academy.conf. Database is gitignored. Style: Allman braces, DBI with prepared statements, Test::More. Auth: token-based, no user accounts, master token in config for testing. Keep the whole briefing under about 200 words. That is enough.

Global CLAUDE.md is for coding style, tools you always use, and how you like explanations. Example notes: Allman braces, prefer vim, use regex when it fits, break big ideas into small pieces, macOS with Homebrew, Perl 5.42 from brew, zsh.

During a session, a # note appends to CLAUDE.md. That is a quick way to teach mid-session: "Always use prepared statements for database queries."

Load order, and what not to dump

Load order is global first, then project root, then nested ./subdir/CLAUDE.md. Nested files add or override. Good content: purpose, architecture, build/run/test commands, directory map, standards, quirks, naming, schema overview, API patterns. Bad content: secrets, passwords, API keys, huge code dumps, generic tutorials, and stuff that changes constantly. This file loads every session, so keep it stable.

Everything in CLAUDE.md uses context tokens. A 500-word file is roughly 400 tokens. That is context you cannot use for the conversation itself. Prefer bullet points over paragraphs. Prefer key facts over a novel. /context shows which files loaded and their token cost. claude --ignore-memory starts without them, which is useful for debugging.

Keep it concise, focused, and updated. Next: using Claude Code day to day.