Install any skill in seconds. Free to start, no credit card required.
Get Started Free →This skill should be used when the user asks to 'set up memory', 'create memory files', 'create MEMORY.md', 'set up topic files', 'improve memory organization', 'what should I remember', 'how to structure memory files', 'MEMORY.md is too long', 'what goes in memory vs topic files', 'memory best practices', or wants to establish a persistent knowledge base across Claude Code sessions. Triggers on: memory setup, MEMORY.md, topic files, cross-session knowledge, persistent notes, memory maintenance,
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-20 | ✗→✓ | ▲ Improved | -22% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 106% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 155% | 0% |
Use persistent auto memory to retain project knowledge across Claude Code sessions. The memory directory (~/.claude/projects/<path>/memory/) stores a concise index file (MEMORY.md) and detailed topic files, creating a structured knowledge base that grows with the project.
text~/.claude/projects/<project-path>/memory/ ├── MEMORY.md # Always loaded into system prompt (~200 lines max) ├── architecture.md # Topic file: system architecture decisions ├── patterns.md # Topic file: code patterns and conventions ├── debugging.md # Topic file: debugging insights ├── workflows.md # Topic file: development workflows └── known-issues.md # Topic file: bug tracking
The directory is created automatically by Claude Code, but to initialize manually:
bashmkdir -p ~/.claude/projects/<project-path>/memory/
The <project-path> typically mirrors the working directory with slashes replaced by dashes (e.g., /workspaces/my-app becomes -workspaces-my-app).
Start with a minimal index and expand as patterns emerge. Include:
See examples/MEMORY.md for a starter template.
Create topic files only when a domain accumulates enough detail to warrant its own file. Common topic files:
| File | Purpose | |------|---------| | architecture.md | System design decisions, component relationships | | patterns.md | Code conventions, naming, file organization | | debugging.md | Solutions to recurring problems | | workflows.md | Build, test, deploy procedures | | known-issues.md | Bug tracking, open/fixed issues | | release-process.md | Version management, release checklists | | dependencies.md | Package versions, compatibility notes |
See examples/topic-file.md for the recommended structure.
Organize by topic, not by date. "Architecture decisions" is better than "Session notes 2026-02-15". When new information arrives, integrate it into the appropriate topic rather than appending chronologically.
MEMORY.md answers "what do I need to know right now?" Topic files answer "what are all the details about X?" Keep the index scannable — use bullet points, tables, and bold for key terms.
Always include a table in MEMORY.md linking to topic files with guidance on when to consult each:
markdown## Topic Files | File | When to consult | |------|----------------| | `architecture.md` | Working on system design, component changes | | `patterns.md` | Writing new code, reviewing conventions | | `debugging.md` | Investigating bugs, error messages |
Each file covers one domain. If a file grows beyond ~5,000 words or covers multiple unrelated topics, split it. A file named misc.md or notes.md is a sign of poor organization.
Periodically review memory files against the actual project state. Stale entries (wrong counts, outdated paths, fixed bugs still listed as open) erode trust in the memory system. Mark fixed issues as fixed rather than deleting them — the history of what went wrong is itself valuable.
For detailed patterns, anti-patterns, and advanced techniques:
Working examples ready to adapt:
Other measured skills in the registry, with their headline benchmark lift.