Claude Code forgets everything between sessions. Built-in auto-memory exists but: - It's opaque (Claude decides what's "meaningful") - Limited to 200 lines loaded at startup - Not tightly integrated into the agentic loop - No hierarchical organization (scales poorly) A skill-based memory protocol with: - Hierarchical storage: core.md summaries → topics/ .md details - Background agents: Memory ops
Add this skill
npx mdskills install hanfang/claude-memory-skillWell-structured hierarchical memory system with clear architecture but lacks actual skill implementation details
╔══●══●══●══════════════════════════════════════════════╗
║ ║
║ > tree ~/.claude/memory ║
║ ║
║ ├── core.md claude-memory-skill ║
║ ├── topics/ ─────────────────── ║
║ │ └── *.md a skill is all you need ║
║ └── me.md ║
║ ║
╚═══════════════════════════════════════════════════════╝
An embarrassingly simple and minimal implementation for agentic memory.
No databases. No embeddings. No semantic search. Just markdown files and a skill that teaches Claude when to read and write.
Claude Code forgets everything between sessions. Built-in auto-memory exists but:
A skill-based memory protocol with:
core.md summaries → topics/.md detailscurl -fsSL https://raw.githubusercontent.com/hanfang/claude-memory-skill/main/install.sh | bash
Or clone and run locally:
git clone https://github.com/hanfang/claude-memory-skill.git
cd claude-memory-skill
./install.sh
~/.claude/
├── CLAUDE.md # Hook added (or created)
├── commands/
│ └── mem.md # The memory skill
└── memory/
├── core.md # Summaries + pointers (always loaded)
├── me.md # About you (always loaded)
├── topics/ # Detailed entries by topic
│ └── .md
└── projects/ # Project-specific memories
└── .md
┌─────────────────────────────────────────────────────┐
│ Main Agent │
│ - Focuses on user's task │
│ - Spawns memory agent when needed │
│ - Doesn't wait (background) │
└─────────────────────┬───────────────────────────────┘
│ spawn (background)
▼
┌─────────────────────────────────────────────────────┐
│ Memory Agent │
│ - Reads core.md + relevant topics │
│ - Writes to topic files │
│ - Updates core.md summaries │
└─────────────────────────────────────────────────────┘
These run automatically — you don't invoke them:
| Action | When | Blocking |
|---|---|---|
load | Session start | No |
save | Claude learns something useful | No |
recall | Claude needs context | No |
These are for you to inspect and manage memory:
| Command | Description |
|---|---|
/mem show | Display memory structure and contents |
/mem forget | Remove a topic or specific entries |
Just say it naturally:
Edit ~/.claude/memory/me.md with facts about yourself:
# About the User
- AI researcher, focus on agents and RL
- Prefer explicit code over clever abstractions
- Python, PyTorch, JAX
core.md (always loaded):
# Core Memory
## Debugging
Mostly async/timing issues. Prefer explicit logging.
→ topics/debugging.md
## RL Research
PPO tuning, reward shaping experiments.
→ topics/rl.md
topics/debugging.md (loaded on demand):
## Async race condition fix [2024-01-15]
Added explicit locks around shared state access.
## Redis timeout debugging [2024-01-10]
Default timeout was too short for large payloads.
## block = one memoryrm -rf ~/.claude/memory
rm ~/.claude/commands/mem.md
# Manually remove the memory hook from ~/.claude/CLAUDE.md
MIT
Install via CLI
npx mdskills install hanfang/claude-memory-skillClaude Memory Skill is a free, open-source AI agent skill. Claude Code forgets everything between sessions. Built-in auto-memory exists but: - It's opaque (Claude decides what's "meaningful") - Limited to 200 lines loaded at startup - Not tightly integrated into the agentic loop - No hierarchical organization (scales poorly) A skill-based memory protocol with: - Hierarchical storage: core.md summaries → topics/ .md details - Background agents: Memory ops
Install Claude Memory Skill with a single command:
npx mdskills install hanfang/claude-memory-skillThis downloads the skill files into your project and your AI agent picks them up automatically.
Claude Memory Skill works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.