clawvault
Structured memory system for OpenClaw agents. Context death resilience (checkpoint/recover), structured storage, Obsidian-compatible markdown, local semantic search, and session transcript repair.
- License 许可
- MIT
- 最近更新
- 2026-08-23
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- clawvault
- author
- Versatly
- version
- 1.5.1
- repository
- https://github.com/Versatly/clawvault
- description
- Structured memory system for OpenClaw agents. Context death resilience (checkpoint/recover), structured storage, Obsidian-compatible markdown, local semantic search, and session transcript repair.
02 资源文件 55
- 参考文档_meta.json801 B
- 脚本bin/clawvault.js37.0 KB
- 参考文档CHANGELOG.md4.4 KB
- 参考文档docs/auto-linking.md2.0 KB
- 参考文档docs/context-death.md3.0 KB
- 脚本hooks/clawvault/handler.js6.0 KB
- 参考文档hooks/clawvault/HOOK.md1.2 KB
- 参考文档package-lock.json258.2 KB
- 参考文档package.json2.3 KB
- 参考文档README.md6.0 KB
- 脚本src/commands/checkpoint.test.ts5.1 KB
- 脚本src/commands/checkpoint.ts6.1 KB
- 脚本src/commands/doctor.test.ts4.2 KB
- 脚本src/commands/doctor.ts8.0 KB
- 脚本src/commands/entities.ts1.4 KB
- 脚本src/commands/link.test.ts2.3 KB
- 脚本src/commands/link.ts7.6 KB
- 脚本src/commands/recover.test.ts3.0 KB
- 脚本src/commands/recover.ts4.5 KB
- 脚本src/commands/repair-session.test.ts10.9 KB
- 脚本src/commands/repair-session.ts5.1 KB
- 脚本src/commands/setup.test.ts1.4 KB
- 脚本src/commands/setup.ts3.7 KB
- 脚本src/commands/shell-init.test.ts1.2 KB
- 脚本src/commands/shell-init.ts1.3 KB
- 脚本src/commands/sleep.ts5.9 KB
- 脚本src/commands/status.test.ts4.7 KB
- 脚本src/commands/status.ts7.7 KB
- 脚本src/commands/template.test.ts2.2 KB
- 脚本src/commands/template.ts5.7 KB
- 脚本src/commands/wake.ts1.9 KB
- 脚本src/index.ts1.8 KB
- 脚本src/lib/auto-linker.ts5.9 KB
- 脚本src/lib/backlinks.test.ts2.0 KB
- 脚本src/lib/backlinks.ts5.4 KB
- 脚本src/lib/config.ts315 B
- 脚本src/lib/entity-index.ts2.6 KB
- 脚本src/lib/search.test.ts3.1 KB
- 脚本src/lib/search.ts10.3 KB
- 脚本src/lib/session-repair.ts9.9 KB
- 脚本src/lib/session-utils.ts4.6 KB
- 脚本src/lib/template-engine.test.ts1.1 KB
- 脚本src/lib/template-engine.ts742 B
- 脚本src/lib/time.ts462 B
- 脚本src/lib/vault.ts22.9 KB
- 脚本src/types.ts5.2 KB
- 参考文档templates/checkpoint.md144 B
- 参考文档templates/daily-note.md121 B
- 参考文档templates/daily.md121 B
- 参考文档templates/decision.md147 B
- 参考文档templates/handoff.md148 B
- 参考文档templates/lesson.md128 B
- 参考文档templates/person.md175 B
- 参考文档templates/project.md199 B
- 参考文档tsconfig.json481 B
03 SKILL.md 正文
ClawVault ?
An elephant never forgets. Structured memory for OpenClaw agents.
Built for OpenClaw — install via
clawhub install clawvault
Install
npm install -g clawvault
Setup
# Initialize vault (creates folder structure + templates)
clawvault init ~/my-vault
# Or set env var to use existing vault
export CLAWVAULT_PATH=/path/to/memory
# Optional: shell integration (aliases + CLAWVAULT_PATH)
clawvault shell-init >> ~/.bashrc
Quick Start for New Agents
# Start your session (recover + recap + summary)
clawvault wake
# Capture and checkpoint during work
clawvault capture "TODO: Review PR tomorrow"
clawvault checkpoint --working-on "PR review" --focus "type guards"
# End your session with a handoff
clawvault sleep "PR review + type guards" --next "respond to CI" --blocked "waiting for CI"
# Health check when something feels off
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
# Types: fact, feeling, decision, lesson, commitment, preference, relationship, project
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)
# Keyword search (fast)
clawvault search "client contacts"
# Semantic search (slower, more accurate)
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
# Shows: death time, last checkpoint, recent handoff
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
# Shows: recent handoffs, active projects, pending commitments, lessons
Auto-linking
Wiki-link entity mentions in markdown files:
# Link all files
clawvault link --all
# Link single file
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 wakerestores context - Checkpoint every 10-15 min during heavy work
- Sleep before session end —
clawvault sleepcaptures 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:
# See what's wrong (dry-run)
clawvault repair-session --dry-run
# Fix it
clawvault repair-session
# Repair a specific session
clawvault repair-session --session <id> --agent <agent-id>
# List available sessions
clawvault repair-session --list
What it fixes:
- Orphaned
tool_resultblocks referencing non-existenttool_useIDs - 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/qmdornpm install -g qmd - No ClawVault found — run
clawvault initor setCLAWVAULT_PATH - CLAWVAULT_PATH missing — run
clawvault shell-initand 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:
# Install qmd
bun install -g github:tobi/qmd
# Add vault as collection
qmd collection add /path/to/vault --name my-memory --mask "**/*.md"
# Update index
qmd update && qmd embed
Environment Variables
CLAWVAULT_PATH— Default vault path (skips auto-discovery)
Links
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
git-summary
Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.
agent-constitution
Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.