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 by openclaw-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

ZoneCanonical sourceEditable 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 canonicalYES — 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)
  • subgraph blocks — grouping for 50+ node diagrams
  • click 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: high

How my work flows through the vault

  1. I author content (plan files, memory files, system maps) at canonical paths.
  2. openclaw-vault-sync.timer rsyncs canonical → vault every 15 min, then git add -A && git commit && git push.
  3. Mac’s Obsidian Git plugin pulls the GitHub repo every 5 min.
  4. Obsidian Sync propagates from Mac to iPhone/iPad in real time.
  5. Reverse flow: phone/Mac edits → Obsidian Sync → Obsidian Git push → GitHub → VPS openclaw-vault-pull.timer (5 min cron) pulls back. Edits land in personal/ zone (Henry’s) — they stay in the vault, never touch canonical paths.

What to do when

SituationAction
Henry asks “is X in the vault?”Search wiki/, plans/ (mirror), memory/ (mirror) directly via Read/Grep.
Henry asks for a system mapWrite or update Mermaid in wiki/system-map/. Cross-link via [[wikilinks]].
You author a new planWrite 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 fileDon’t edit the vault copy. Find the canonical, edit there, wait for next sync.
Henry adds a note in personal/ from his phoneRead 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.sh