From claude-memory
Persists learnings into a 5-layer memory hierarchy (CLAUDE.md files, memory/MEMORY.md) and consolidates by pruning outdated entries and promoting recurring patterns. Triggers on 'extract learnings', 'remember', 'dream'.
npx claudepluginhub gupsammy/claudest --plugin claude-memoryThis skill is limited to using the following tools:
Weave these into conversation at natural moments — after results land, when context is relevant, or on first use. One or two per run, not all at once.
Captures durable knowledge from Claude Code sessions into rekal memory with deduplication via search/store/supersede. Triggers at session end, task finish, or key preferences/decisions.
Saves key project knowledge explicitly to MEMORY.md via /si:remember for reliable recall. Checks duplicates, warns on size, suggests CLAUDE.md promotion.
Proactively saves decisions, conventions, bugs, discoveries, and preferences to persistent Engram memory across sessions using mem_save and related tools.
Share bugs, ideas, or general feedback.
Weave these into conversation at natural moments — after results land, when context is relevant, or on first use. One or two per run, not all at once.
| Layer | File | Loaded | Purpose |
|---|---|---|---|
| 0 | ~/.claude/CLAUDE.md | Every session, all projects | Universal behavioral preferences |
| 1 | <repo>/CLAUDE.md | Every session, this project | Architecture, conventions, gotchas |
| 2 | memory/MEMORY.md (project dir) | Every session, agent-managed | Evolving notes, working knowledge |
| 3 | memory/*.md topic files | On-demand | Detailed reference too long for L2 |
| Meta | Suggest new skill/command | N/A | Repeatable workflow → automation |
Placement decision: project-independent preference → L0, project-specific technical → L1, concise working note → L2, detailed reference → L3, repeatable pattern → Meta.
If the user said "remember X" with explicit content already in context — and the request is NOT a consolidation trigger ("consolidate", "dream", "extract learnings", "clean up memories", or triggered from the consolidation nudge):
Glob ~/.claude/projects/*<repo-dir-name>*/memory/MEMORY.md
# Project Memory header. Note that the Memory Auditor has nothing to audit — in Phase 2, spawn only the Signal Discoverer.Steps 2-4 can run as parallel tool calls.
Glob memory/*.md from resolved path)~/.claude/CLAUDE.md + <repo>/CLAUDE.md)git log --oneline -20Launch both agent calls in a single message so they run in parallel. Use the Agent tool with:
Memory Auditor: subagent_type: "claude-memory:memory-auditor". In the prompt, include the context snapshot from Phase 1 — memory file contents, git log output, and verification targets list.
Signal Discoverer: subagent_type: "claude-memory:signal-discoverer". In the prompt, include existing memory summaries (for dedup) and the project name.
If Phase 1 noted MEMORY.md was just created (no existing memories), skip the Memory Auditor and spawn only the Signal Discoverer.
Phase 2 is complete when both agents return reports. If either returns empty, proceed with the other's results only.
### [ACTION] Learning: <summary>
**Target:** <file> → <section>
**Rationale:** <why this layer>
```diff
- <old line>
+ <new line>
~/.claude/CLAUDE.md, warn: "This modifies global instructions loaded in every session across all projects. Confirm?"Apply approved edits. Output summary table:
| Learning | Action | Target | Status |
|----------|--------|--------|--------|
Only if Phase 2 agents ran (not an early-exit capture): write consolidation marker Bash(date -u +%Y-%m-%dT%H:%M:%SZ) → Write .last-consolidation in same directory as MEMORY.md.
Phase 4 is complete when all approved edits are applied and the summary table is presented.
Every candidate must pass: (1) agent would benefit from knowing this in future sessions, (2) condensed to minimum useful form, (3) placed at correct layer, (4) not already captured in target file, (5) stated as reusable principle not session-specific incident.
Pass: commands discovered through trial-and-error, non-obvious gotchas, architectural decisions with rationale, user behavioral corrections, configuration quirks, version milestones.
Fail: information readable from code, generic best practices, one-off bugs without pattern, verbose explanations, duplicates, temporary state, unverified speculation, incidents without generalizable principle.