| name | clawvault |
| version | 1.5.1 |
| description | Structured memory system for OpenClaw agents. Context death resilience (checkpoint/recover), structured storage, Obsidian-compatible markdown, local semantic search, and session transcript repair. |
| author | Versatly |
| repository | https://github.com/Versatly/clawvault |
ClawVault 🐘
An elephant never forgets. Structured memory for OpenClaw agents.
Built for OpenClaw — install via clawhub install clawvault
Install
npm install -g clawvault
Setup
clawvault init ~/my-vault
export CLAWVAULT_PATH=/path/to/memory
clawvault shell-init >> ~/.bashrc
Quick Start for New Agents
clawvault wake
clawvault capture "TODO: Review PR tomorrow"
clawvault checkpoint --working-on "PR review" --focus "type guards"
clawvault sleep "PR review + type guards" --next "respond to CI" --blocked "waiting for CI"
clawvault doctor
Core Commands
Wake + Sleep (primary)
clawvault wake
clawvault sleep "what I was working on" --next "ship v1" --blocked "waiting for API key"
Store memories by type
clawvault remember decision "Use Postgres over SQLite" --content "Need concurrent writes for multi-agent setup"
clawvault remember lesson "Context death is survivable" --content "Checkpoint before heavy work"
clawvault remember relationship "Justin Dukes" --content "Client contact at Hale Pet Door"
Quick capture to inbox
clawvault capture "TODO: Review PR tomorrow"
Search (requires qmd installed)
clawvault search "client contacts"
clawvault vsearch "what did we decide about the database"
Context Death Resilience
Wake (start of session)
clawvault wake
Sleep (end of session)
clawvault sleep "what I was working on" --next "finish docs" --blocked "waiting for review"
Checkpoint (save state frequently)
clawvault checkpoint --working-on "PR review" --focus "type guards" --blocked "waiting for CI"
Recover (manual check)
clawvault recover --clear
Handoff (manual session end)
clawvault handoff \
--working-on "ClawVault improvements" \
--blocked "npm token" \
--next "publish to npm, create skill" \
--feeling "productive"
Recap (bootstrap new session)
clawvault recap
Auto-linking
Wiki-link entity mentions in markdown files:
clawvault link --all
clawvault link memory/2024-01-15.md
Folder Structure
vault/
├── .clawvault/ # Internal state
│ ├── last-checkpoint.json
│ └── dirty-death.flag
├── decisions/ # Key choices with reasoning
├── lessons/ # Insights and patterns
├── people/ # One file per person
├── projects/ # Active work tracking
├── handoffs/ # Session continuity
├── inbox/ # Quick captures
└── templates/ # Document templates
Best Practices
- Wake at session start —
clawvault wake restores context
- Checkpoint every 10-15 min during heavy work
- Sleep before session end —
clawvault sleep captures next steps
- Use types — knowing WHAT you're storing helps WHERE to put it
- Wiki-link liberally —
[[person-name]] builds your knowledge graph
Checklist for AGENTS.md
## Memory Checklist
- [ ] Run `clawvault wake` at session start
- [ ] Checkpoint during heavy work
- [ ] Capture key decisions/lessons with `clawvault remember`
- [ ] Use wiki-links like `[[person-name]]`
- [ ] End with `clawvault sleep "..." --next "..." --blocked "..."`
- [ ] Run `clawvault doctor` when something feels off
Session Transcript Repair (v1.5.0+)
When the Anthropic API rejects with "unexpected tool_use_id found in tool_result blocks", use:
clawvault repair-session --dry-run
clawvault repair-session
clawvault repair-session --session <id> --agent <agent-id>
clawvault repair-session --list
What it fixes:
- Orphaned
tool_result blocks referencing non-existent tool_use IDs
- Aborted tool calls with partial JSON
- Broken parent chain references
Backups are created automatically (use --no-backup to skip).
Troubleshooting
- qmd not installed — run
bun install -g github:tobi/qmd or npm install -g qmd
- No ClawVault found — run
clawvault init or set CLAWVAULT_PATH
- CLAWVAULT_PATH missing — run
clawvault shell-init and add to shell rc
- Too many orphan links — run
clawvault link --orphans
- Inbox backlog warning — process or archive inbox items
- "unexpected tool_use_id" error — run
clawvault repair-session
Integration with qmd
ClawVault uses qmd for search:
bun install -g github:tobi/qmd
qmd collection add /path/to/vault --name my-memory --mask "**/*.md"
qmd update && qmd embed
Environment Variables
CLAWVAULT_PATH — Default vault path (skips auto-discovery)
Links