HomeClaude Code CLICLAUDE.md and Memory System
intermediate12 min read· Module 4, Lesson 6

📝CLAUDE.md and Memory System

Teach Claude about your project and let it remember across sessions

CLAUDE.md — Your Project's Instruction Manual

CLAUDE.md is a markdown file you add to your project root. Claude Code reads it at the start of every session. Think of it as a briefing document for your AI assistant.

Creating CLAUDE.md

The easiest way:

Terminal
claude /init

This generates a starter CLAUDE.md based on your project. Or create it manually:

Markdown
# Project: My Awesome App ## Overview This is a Next.js e-commerce application with a Node.js backend. ## Tech Stack - Frontend: Next.js 14, TypeScript, Tailwind CSS - Backend: Express.js, PostgreSQL - Testing: Jest, React Testing Library ## Code Style - Use functional components with hooks - Prefer const over let - Use TypeScript strict mode - File naming: kebab-case for files, PascalCase for components ## Architecture - /src/app — Next.js app router pages - /src/components — Reusable UI components - /src/lib — Utility functions and API clients - /src/types — TypeScript type definitions ## Commands - npm run dev — Start development server - npm test — Run tests - npm run lint — Run ESLint - npm run build — Production build ## Important Notes - Never use any as a TypeScript type - All API calls go through /src/lib/api-client.ts - Database migrations are in /prisma/migrations

CLAUDE.md Best Practices

DoDon't
Include architecture decisionsWrite a novel — keep it concise
List coding conventionsRepeat what's obvious from package.json
Note important patternsInclude secrets or API keys
Mention common gotchasDuplicate your README
Specify preferred librariesList every file in the project

Where to Put CLAUDE.md

LocationScope
Project rootApplies to the whole project
SubdirectoryApplies when working in that folder
~/.claude/CLAUDE.mdApplies to ALL your projects (personal preferences)

Auto Memory

Claude Code also has an auto memory system. As it works with you, it automatically saves learnings like:

  • Build commands that work
  • Project-specific debugging insights
  • Patterns it discovered in your codebase

You can view saved memories with:

Terminal
claude /memory

Memory vs CLAUDE.md

CLAUDE.mdAuto Memory
You write itClaude writes it automatically
Static instructionsDynamic learnings
Version controlledPersonal to your machine
Team-shareableOnly for you

Next up: Learn about custom commands (skills) and hooks.