Memory Kit
Current State
![ -f MEMORY.md ] && echo "MEMORY.md: $(wc -l < MEMORY.md) lines, last modified $(date -r MEMORY.md '+%Y-%m-%d %H:%M')" || echo "No MEMORY.md found"
![ -f tasks/current-task.md ] && echo "Active task file found" || echo "No task file"
Overview
Claude Code sessions lose context on compaction and restart. Memory Kit persists
session state (goals, decisions, patterns, open questions) to a MEMORY.md file
that survives across sessions.
Five commands cover the full lifecycle:
/memory-save — snapshot before compaction
/memory-load — restore at session start
/memory-update — log a decision mid-session
/memory-share — push to git for teammates
/memory-audit — prune stale entries
Prerequisites
- A git repository (for
/memory-share)
- Write access to the project root (MEMORY.md lives there)
Instructions
- On session start — check for existing
MEMORY.md in project root. If found, read and summarize the saved state. Ask the user whether to resume previous context or start fresh.
- On save (
/memory-save) — scan the current conversation for goals, decisions, patterns, and open questions. Write a structured snapshot to MEMORY.md with timestamped sections.
- On update (
/memory-update) — append the user's decision or note to the appropriate section in MEMORY.md without overwriting existing content.
- On share (
/memory-share) — commit MEMORY.md and push to the remote branch so teammates can load the same context.
- On audit (
/memory-audit) — review all entries in MEMORY.md, flag stale items (older than 7 days or referencing completed work), and prompt the user to confirm removal.
Output
The skill produces and maintains a MEMORY.md file containing:
- Session metadata: Timestamp, branch, and project name
- Goals: Current objectives carried across sessions
- Decisions: Key choices made with rationale
- Patterns: Recurring approaches or conventions discovered
- Open questions: Unresolved items requiring future attention
Output Format
For the MEMORY.md template structure, see output-format.md.
Error Handling
For error scenarios and recovery behavior, see error-handling.md.
Examples
Save before compaction:
"Save my memory" → reads current context, writes snapshot to MEMORY.md
Load at session start:
"Load memory" → reads MEMORY.md, summarizes state, asks to resume or start new
Quick mid-session log:
"Log decision: using Postgres over SQLite for concurrent writes" → appends to Decisions section
Team sync:
"Share memory" → runs scripts/memory-share.sh, confirms push
Resources
- output-format.md — MEMORY.md template structure and section schema
- error-handling.md — error scenarios, recovery behavior, and edge cases
1---2name: memory-kit3description: |4 Persistent context management for Claude Code sessions. Save, load, update,5 share, and audit session memory via MEMORY.md. Prevents context loss on6 compaction or session restart. Use when starting a session, before compaction,7 syncing context across teammates, or pruning stale memory entries.8 Trigger with "save memory", "load memory", "memory audit", "memory share".9allowed-tools: Read, Write, Edit, Bash(git:*)10version: 1.1.011author: builtbyzac12license: MIT13compatible-with: claude-code14tags: [productivity, audit, memory-kit]1516---1718# Memory Kit1920## Current State21!`[ -f MEMORY.md ] && echo "MEMORY.md: $(wc -l < MEMORY.md) lines, last modified $(date -r MEMORY.md '+%Y-%m-%d %H:%M')" || echo "No MEMORY.md found"`22!`[ -f tasks/current-task.md ] && echo "Active task file found" || echo "No task file"`2324## Overview2526Claude Code sessions lose context on compaction and restart. Memory Kit persists27session state (goals, decisions, patterns, open questions) to a `MEMORY.md` file28that survives across sessions.2930Five commands cover the full lifecycle:31- `/memory-save` — snapshot before compaction32- `/memory-load` — restore at session start33- `/memory-update` — log a decision mid-session34- `/memory-share` — push to git for teammates35- `/memory-audit` — prune stale entries3637## Prerequisites3839- A git repository (for `/memory-share`)40- Write access to the project root (MEMORY.md lives there)4142## Instructions43441. **On session start** — check for existing `MEMORY.md` in project root. If found, read and summarize the saved state. Ask the user whether to resume previous context or start fresh.452. **On save** (`/memory-save`) — scan the current conversation for goals, decisions, patterns, and open questions. Write a structured snapshot to `MEMORY.md` with timestamped sections.463. **On update** (`/memory-update`) — append the user's decision or note to the appropriate section in `MEMORY.md` without overwriting existing content.474. **On share** (`/memory-share`) — commit `MEMORY.md` and push to the remote branch so teammates can load the same context.485. **On audit** (`/memory-audit`) — review all entries in `MEMORY.md`, flag stale items (older than 7 days or referencing completed work), and prompt the user to confirm removal.4950## Output5152The skill produces and maintains a `MEMORY.md` file containing:53- **Session metadata**: Timestamp, branch, and project name54- **Goals**: Current objectives carried across sessions55- **Decisions**: Key choices made with rationale56- **Patterns**: Recurring approaches or conventions discovered57- **Open questions**: Unresolved items requiring future attention5859## Output Format6061For the MEMORY.md template structure, see [output-format.md](references/output-format.md).6263## Error Handling6465For error scenarios and recovery behavior, see [error-handling.md](references/error-handling.md).6667## Examples6869**Save before compaction:**70> "Save my memory" → reads current context, writes snapshot to MEMORY.md7172**Load at session start:**73> "Load memory" → reads MEMORY.md, summarizes state, asks to resume or start new7475**Quick mid-session log:**76> "Log decision: using Postgres over SQLite for concurrent writes" → appends to Decisions section7778**Team sync:**79> "Share memory" → runs `scripts/memory-share.sh`, confirms push8081## Resources8283- [output-format.md](references/output-format.md) — MEMORY.md template structure and section schema84- [error-handling.md](references/error-handling.md) — error scenarios, recovery behavior, and edge cases85