- Added support for Claude plugins + npx packaging
Most memory systems inject context at session start and hope Claude remembers. This doesn't work because:
- Context compaction loses early instructions
- Claude has no obligation to follow suggestions
- Long sessions forget the protocol
Unsevered Memory solves this with enforcement:
| Hook | When | Purpose |
|---|---|---|
SessionStart |
Session begins | Load full context |
UserPromptSubmit |
Every prompt | Inject state reminder |
SessionEnd |
Session ends | Archive + remind |
The UserPromptSubmit hook survives context compaction by being injected fresh on every message.
Enforcement Layer
βββ SessionStart ββββββ> Load context.md + scratchpad
βββ UserPromptSubmit ββ> [Memory] Task: X | Scratchpad: Y lines
βββ SessionEnd ββββββββ> Archive scratchpad, remind to update
File Structure
βββ .claude/memory/ # Dynamic (every session)
β βββ context.md # Current state, next steps
β βββ scratchpad.md # Live session operations
β βββ decisions.md # Architectural choices
β βββ sessions/ # Daily archives
β
βββ .ai/ # Static (when patterns emerge)
βββ core/ # Tech stack, architecture
βββ patterns/ # Reusable solutions (after 3+ uses)
βββ workflows/ # Dev processes
Choose your preferred method:
# Add marketplace
/plugin marketplace add blas0/UnseveredMemory
# Install plugin
/plugin install unsevered-memory@blas0Then per-project:
cd /path/to/your/project
/unsevered-memory project# Global setup
npx unsevered-memory init
# Per-project setup
cd /path/to/your/project
npx unsevered-memory projectgit clone https://github.com/blas0/UnseveredMemory.git
cd UnseveredMemory
./setup-global.shThen per-project:
cd /path/to/your/project
~/.claude/setup-project.shGlobal (~/.claude/):
CLAUDE.md- Global memory protocolsettings.json- Hook configuration (3 hooks)hooks/- memory-load, memory-remind, memory-saveskills/orchestrate/- Workflow instructionscommands/orchestrate.md- Orchestrator command
Per-Project:
project/
βββ CLAUDE.md # Project instructions
βββ .ai/ # Static documentation
β βββ core/
β β βββ technology-stack.md
β β βββ architecture.md
β βββ patterns/
β βββ workflows/
βββ .claude/
βββ memory/
βββ context.md # Cross-session state
βββ scratchpad.md # Live session log
βββ decisions.md # Decision log
βββ sessions/ # Daily archives
- Hook loads
context.mdandscratchpad.md - Claude sees current state and any unfinished work
- Hook hints about
.ai/documentation
Every prompt shows:
[Memory] Task: Fix auth bug | Scratchpad: 24 lines | .ai/ updated: 2024-01-15
Claude writes to scratchpad.md as it works:
## Session: 2024-01-15 14:30
### Operations
- [14:35] Found issue in validateToken() at src/auth.ts:142
- [14:40] Fixed: was comparing wrong field
### Decisions
- Keep backward compatibility by checking both fieldsClaude updates .ai/ when patterns emerge (3+ uses).
- Hook archives scratchpad to
sessions/YYYY-MM-DD.md - Hook reminds to update
context.md - Claude updates context with current state
For complex multi-step tasks:
/orchestrate Implement user authentication with JWT
The orchestrator:
- Reads all memory files
- Breaks task into subtasks
- Delegates to specialized agents
- Updates memory after each step
- Never loses context
| File | Content | Update Frequency |
|---|---|---|
context.md |
Current state, next steps | End of session |
scratchpad.md |
Operations, findings | During session |
decisions.md |
Architectural choices | When decisions made |
.ai/core/ |
Tech stack, architecture | When they change |
.ai/patterns/ |
Reusable solutions | After 3+ uses |
UnseveredMemory/
βββ .claude-plugin/ # Plugin manifest
β βββ plugin.json
β βββ marketplace.json
βββ package.json # npm package
βββ bin/cli.js # npx entry point
βββ src/commands/ # CLI commands
βββ setup-global.sh # Manual installer
βββ scripts/ # Hook scripts (plugin)
βββ hooks/ # Hook scripts + hooks.json
βββ skills/
β βββ orchestrate/
β βββ SKILL.md
βββ commands/
β βββ orchestrate.md
βββ templates/
βββ [all templates]
- Enforced - UserPromptSubmit hook survives context compaction
- Simple - Bash + markdown, no databases, no APIs
- Offline - Everything is local files
- Native - Uses Claude Code's built-in hooks system
- Proactive - Claude updates .ai/ during work, not after
| Approach | Reliability |
|---|---|
| CLAUDE.md only | ~30% |
| + SessionStart | ~50% |
| + UserPromptSubmit | ~75% |
| + /orchestrate orchestrator | ~95% |
# npx
npx unsevered-memory uninstall
# Manual
rm -rf ~/.claude/hooks/memory-*.sh
rm -rf ~/.claude/skills/orchestrate
rm -rf ~/.claude/commands/orchestrate.md
# Project files (optional)
rm -rf .claude/memory
rm -rf .ai