A tech pack that gives Claude Code persistent memory across sessions — capturing debugging discoveries, architectural decisions, and project conventions into a searchable knowledge base that makes Claude increasingly effective over time.
Built for the mcs configuration engine.
identifier: memory
requires: mcs >= 2026.3.22
Claude Code has no memory between sessions. Every conversation starts from zero — solutions discovered yesterday, architecture decisions made last week, debugging breakthroughs from last month — all gone. You end up re-explaining the same context, re-discovering the same workarounds, and re-making the same decisions.
This pack implements a closed-loop knowledge system that captures valuable insights during work and resurfaces them automatically when they're relevant again.
CONTINUOUS LEARNING LOOP
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ SESSION │ │ KNOWLEDGE │ │ WORK │ │ CAPTURE │
│ START │────>│ RETRIEVAL │────>│ SESSION │────>│ (save) │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
| ^ |
| | .claude/memories/ |
| | ┌──────────────────────────────┐ |
| | │ learning_swiftui_... │ |
| | │ decision_arch_... │ |
| +-----│ learning_coredata_... │<----+
| │ decision_testing_... │
| └──────────────────────────────┘
| ^
| |
| ┌──────────────────────────────────┐
| │ Ollama Embeddings │
+──────────────>│ (nomic-embed-text) │
background │ + Semantic Index │
re-index on └──────────────────────────────────┘
session start
| Piece | What | How |
|---|---|---|
| Activator Hook | Triggers evaluation after every prompt | A UserPromptSubmit hook reminds Claude to check if the current task produced extractable knowledge |
| Continuous Learning Skill | Structures and saves knowledge | A Claude Code skill with extraction rules, quality gates, naming conventions, and ADR-inspired templates |
| Memory Files | Persistent storage | Structured markdown files in .claude/memories/ — version-controlled, human-readable, editable |
| Semantic Search | Retrieval at session start | docs-mcp-server + Ollama embeddings index memory files and serve them via natural-language search |
-
Session starts — the Ollama status hook detects
.claude/memories/and re-indexes all memory files into a vector store usingnomic-embed-textembeddings (runs in the background, doesn't block the session) -
Before any task — a
CLAUDE.local.mdinstruction tells Claude to search the knowledge base first (search_docswith the project name), surfacing relevant past learnings and decisions -
During work — the activator hook fires on every prompt, reminding Claude to evaluate whether the current interaction produced knowledge worth saving
-
After valuable work — the continuous learning skill extracts structured memories, checks for duplicates against the existing KB, and writes them to
.claude/memories/ -
Next session — the new memories are indexed, and the loop continues
Over time, the project accumulates a searchable knowledge base that makes Claude increasingly effective — debugging patterns don't need to be rediscovered, architectural decisions don't need to be re-justified, and conventions don't need to be re-explained.
The system captures two categories of knowledge:
Learnings — non-obvious discoveries from debugging and investigation:
.claude/memories/learning_swiftui_task_cancellation_on_view_dismiss.md
.claude/memories/learning_core_data_batch_insert_memory_spike.md
.claude/memories/learning_xcode_preview_crash_missing_environment.md
Each learning follows a structured template: Problem > Trigger Conditions > Solution > Verification > Example > Notes > References.
Decisions — deliberate architectural and convention choices:
.claude/memories/decision_architecture_mvvm_coordinators.md
.claude/memories/decision_testing_snapshot_strategy.md
.claude/memories/decision_codestyle_naming_conventions.md
Decisions use an ADR-inspired template: Decision > Context > Options Considered > Choice > Consequences > Scope > Examples.
| Server | Description |
|---|---|
| docs-mcp-server | Semantic search over project memories using local Ollama embeddings |
| Skill | Description |
|---|---|
| continuous-learning | Extracts learnings and decisions from sessions into structured memory files |
| Hook | Event | What It Does |
|---|---|---|
| sync-memories.sh | SessionStart |
Checks Ollama health and syncs docs-mcp-server library on session start |
| sync-memories.sh | UserPromptSubmit |
Reindexes docs-mcp-server library when memories have changed mid-session |
| continuous-learning-activator.sh | UserPromptSubmit |
Reminds Claude to evaluate knowledge extraction after each prompt |
| Section | Instructions |
|---|---|
| continuous-learning | Always search the KB before starting any task |
| Setting | Value | Purpose |
|---|---|---|
autoMemoryEnabled |
false |
Disables built-in memory in favor of the continuous learning system |
- macOS (Apple Silicon or Intel)
- Claude Code CLI
- Ollama — local LLM runtime for embeddings
# 1. Install mcs
brew install mcs-cli/tap/mcs
# 2. Register this tech pack
mcs pack add mcs-cli/memory
# 3. Sync your project
cd ~/Developer/my-project
mcs sync
# 4. Verify everything is healthy
mcs doctormemory/
├── techpack.yaml # Manifest — defines all components
├── config/
│ └── settings.json # Disables built-in auto-memory (autoMemoryEnabled)
├── hooks/
│ ├── sync-memories.sh # Ollama health + memory indexing/reindexing
│ └── continuous-learning-activator.sh # Knowledge extraction reminder
├── skills/
│ └── continuous-learning/
│ ├── SKILL.md # Extraction rules and workflow
│ └── references/
│ └── templates.md # Learning + Decision memory templates
└── templates/
└── continuous-learning.md # "Search KB before any task"
| Pack | Description |
|---|---|
| dev | Foundational settings, plugins, and git workflows |
| ios | Xcode integration, simulator management, and Apple documentation |
- MCS — the configuration engine
- Creating Tech Packs — guide for building your own
- Tech Pack Schema — full YAML reference
MIT