memory-system
Multi-layer memory system for sessions, daily rollups, and per-project knowledge via /recall, /rollup-day, /note-session commands
What this skill does
# Claude Memory System
A three-layer memory architecture for capturing session work, distilling daily patterns, and querying across projects.
## The three layers
| Layer | What's stored | Writer | Reader | Grain |
|---|---|---|---|---|
| **Raw sessions** | All turn-by-turn conversation, unchanged | `/note-session` (auto on PreCompact + SessionEnd via the memory plugin hook) | Raw JSONL grep (fallback in `/recall`) | Per-session |
| **Daily distilled** | Did/Decided/Open/Touched/Worth-remembering, deduplicated | `/rollup-day` (daily at 09:00 via launchd) | `/recall` (preferred for date ranges) | Per-day |
| **Per-project topical** | Class-level knowledge, setup docs, debugging guides | Auto-improve background review + user hand-written | `/recall` (project-scoped queries) | Class-level (umbrella skills) |
## Commands
### `/note-session` — checkpoint the current session
Runs automatically on `PreCompact` and `SessionEnd` via the memory plugin's hook (`hooks/checkpoint-session.sh`). Trivial `SessionEnd` events (under 50 new transcript lines) are skipped, and the checkpoint summarizes on Haiku by default. Appends a summary to `$CLAUDE_CONFIG_DIR/memory/sessions/<YYYY-MM-DD>.md` with:
- Timestamp (HH:MM)
- Project tag (`[project-name]`)
- Session title
- Did / Decided / Open / Touched sections
- Worth remembering bullet points (preserved verbatim)
No args. Re-runs are idempotent (appends to the daily file, don't overwrite).
### `/rollup-day [YYYY-MM-DD | yesterday | today]` — distill a full day
Compresses a day's raw session log into curated form. Defaults to yesterday.
Input: `$CLAUDE_CONFIG_DIR/memory/sessions/2026-05-25.md` (or whatever date you pass)
Output: `$CLAUDE_CONFIG_DIR/memory/daily/2026-05-25.md`
Format: By-project grouping, deduped Opens, worth-remembering excerpts (verbatim), high-level Touched list.
Compression: typically 4-6x (22KB session log → 7.6KB rollup).
Model: Sonnet (preserves idempotency, respects anti-capture rules). Fires idempotently (always overwrites, even if file exists).
**Scheduling:** Can fire daily (e.g. 09:00 local time) via launchd.
### `/recall [natural language question]` — search memory
Queries all three layers:
1. Daily distilled (preferred if available)
2. Raw session logs (fallback if no rollup exists for the date)
3. Per-project memory files (MEMORY.md + topical files)
Examples:
- `/recall "what was I doing yesterday in claude-plugins"`
- `/recall "what did we decide about JWT tokens"`
- `/recall "open items this week"`
Output: quoted excerpts with dates/project context.
## Anti-capture rules
`/rollup-day` and auto-improve's background review refuse to capture:
- **Negative tool claims** ("X tool is broken", "can't use Y") — these harden into self-imposed refusals that persist months after the tool is fixed
- **Session-specific one-off narratives** (summaries, analyses, task descriptions) — these decay fast and pollute the memory
- **Environment failures** (missing binaries, "command not found", unconfigured credentials) — the user can fix these; they're not durable rules
- **Transient errors that resolved before session end** — if retrying worked, the lesson is the retry pattern, not the original failure
What DOES get captured:
- Techniques (non-obvious workflows, tricky fixes)
- User preferences and frustrations (correct approach after user feedback)
- Decisions (why something was done a certain way)
- Lessons from errors (the insight gained, not the error itself)
- Worth-remembering insights (preserved verbatim from the raw session)
## Per-project isolation
Memory writes go to project-specific directories:
```
$CLAUDE_CONFIG_DIR/projects/<slug>/memory/
├── MEMORY.md (index of all per-project topical files)
├── feedback_*.md (lessons from user corrections)
├── project_*.md (state of ongoing work)
└── user_*.md (who this user is in this context)
```
The `/recall` command searches all projects and returns project-tagged results. Auto-improve and the background review write to the same dirs, so learned skills and memories integrate cleanly.
## Integration with auto-improve
The background review agent (from `auto-improve` plugin) writes to these same memory directories after every session. The review:
- Checks anti-capture rules (skips noisy one-offs, environment errors)
- Writes class-level skills to `$CLAUDE_CONFIG_DIR/skills/<name>/` (tagged `created_by: auto-improve`)
- Updates project memory files with durable lessons
- Respects per-project isolation
So memory and skills are two faces of the same system: memory captures who and what, skills capture how.
## See also
- `references/architecture.md` — detailed layer breakdown, directory structure, `/recall` search order
- `references/recall-search-patterns.md` — how `/recall` queries the three layers
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.