Vault-Scoped CLAUDE.md
You are inside
/home/opsadmin/openclaw-vault/. This file is read by any Claude session that opens this folder as a workspace. The root project CLAUDE.md still applies — this file LAYERS on top of it with vault-specific rules.
What this vault is
Unified Karpathy LLM Wiki / Claude-Code-in-Vault pattern for the OpenClaw system. The vault is a mirror + workspace that:
- Mirrors canonical content from
~/.claude/plans/,~/.claude/projects/-home-opsadmin/memory/,~/.openclaw/workspace/system-map/, and~/.openclaw/workspace/knowledge-base/(rsynced every 15 min byopenclaw-vault-sync.timer) - Hosts new content I (Claude) write directly when working in vault context: agent status pages, architecture diagrams, synthesis pages
- Pushes to GitHub
traewayrer/openclaw-vault(private) every 15 min for distribution to Henry’s Mac + iPhone via Obsidian
Critical rules
1. The vault is NOT the canonical source for mirrored zones
Files under plans/, memory/, sources/kb/ are rsync mirrors of canonical paths elsewhere. Edits to these files inside the vault will be wiped on next 15-min sync (rsync overwrites them with the canonical version).
If you need to update a plan or memory file, edit the canonical path (~/.claude/plans/... or ~/.claude/projects/-home-opsadmin/memory/...), NOT the vault mirror. The next sync will propagate.
2. Zone ownership
| Zone | Canonical source | Editable from vault? |
|---|---|---|
sources/kb/ | ~/.openclaw/workspace/knowledge-base/ | NO — wiped on sync |
plans/ | ~/.claude/plans/ | NO — wiped on sync |
memory/ | ~/.claude/projects/-home-opsadmin/memory/ | NO — wiped on sync |
wiki/system-map/ | ~/.openclaw/workspace/system-map/ | NO — wiped on sync |
wiki/agents/, wiki/architecture/, wiki/operations/ | THIS IS the canonical (vault-native) | YES — agents write here directly |
personal/ | THIS IS the canonical (Henry-only) | DO NOT WRITE — Henry’s space |
logs/ | THIS IS the canonical | YES — append-only |
Default rule: if you’re unsure, treat the file as mirror-not-canonical and find the canonical path before editing.
3. Frontmatter ownership marker (required for vault-native files)
When you create a file in wiki/ or logs/, include this frontmatter:
---
owner: claude-opus-4-7 | claude-sonnet-4-6 | henry | shared
type: agent-output | human-knowledge | log | diagram
created: 2026-05-02T14:30:00Z
last-updated: 2026-05-02T14:30:00Z
last-updated-by: claude-opus-4-7
locked-for-human-editing: false
locked-for-agent-modification: false
---Henry edits files marked owner: henry or locked-for-agent-modification: true. You leave them alone.
4. Mermaid is the default diagram language
For any system architecture, data flow, or component diagram, write Mermaid in a markdown fenced block (```mermaid). Obsidian renders it natively on Mac/iPhone/iPad. See wiki/system-map/_mermaid-test.md for the template.
Patterns:
graph TD— hierarchical (system topology)flowchart LR— sequential (data flows)subgraphblocks — grouping for 50+ node diagramsclick NodeID "[[Other-Note.md]]"— cross-document linking (renders as clickable in Obsidian)
Keep individual diagrams under 30 nodes (mobile rendering perf cliff). Split larger systems into linked overview + detail diagrams.
5. The activity log is append-only
logs/activity.md records significant changes. Append entries in this format, never delete or rewrite past entries:
## [2026-05-02 14:30] claude-opus-4-7 | Created vault structure
- Source: Phase 1 of openclaw-obsidian-vault-2026-05-02 plan
- Files: CLAUDE.md, AGENTS.md, dirs, schema
- Confidence: highHow my work flows through the vault
- I author content (plan files, memory files, system maps) at canonical paths.
openclaw-vault-sync.timerrsyncs canonical → vault every 15 min, thengit add -A && git commit && git push.- Mac’s Obsidian Git plugin pulls the GitHub repo every 5 min.
- Obsidian Sync propagates from Mac to iPhone/iPad in real time.
- Reverse flow: phone/Mac edits → Obsidian Sync → Obsidian Git push → GitHub → VPS
openclaw-vault-pull.timer(5 min cron) pulls back. Edits land inpersonal/zone (Henry’s) — they stay in the vault, never touch canonical paths.
What to do when
| Situation | Action |
|---|---|
| Henry asks “is X in the vault?” | Search wiki/, plans/ (mirror), memory/ (mirror) directly via Read/Grep. |
| Henry asks for a system map | Write or update Mermaid in wiki/system-map/. Cross-link via [[wikilinks]]. |
| You author a new plan | Write to canonical ~/.claude/plans/ and matching ~/.claude/projects/-home-opsadmin/memory/project_*.md. Sync mirrors to vault/plans/ + vault/memory/ automatically. |
| You spot a stale mirror file | Don’t edit the vault copy. Find the canonical, edit there, wait for next sync. |
Henry adds a note in personal/ from his phone | Read it on next session for context. Don’t edit it. |
Diagnostic commands (run from vault root)
# When was last sync?
journalctl --user -u openclaw-vault-sync.service --since "1h ago" | tail
# Is auto-push working?
git log --oneline -5
# What changed since the canonical paths last touched?
git status
# Force sync now
~/.openclaw/tools/openclaw-vault-sync.shRelated governance
- Plan: openclaw-obsidian-vault-2026-05-02.md (root project plans dir)
- Project memory: project_openclaw_obsidian_vault_2026-05-02.md
- Feedback rule: feedback_obsidian_sync_external_changes_unreliable.md — explains why we DON’T use rclone-into-Sync