Keep working records in searchable files you control. Retrieval can miss relevant material.
Agent sessions can lack the records needed for a task. Keep decisions and working context in files you control. Select relevant files before reasoning begins.
Copy-pasting context does not scale. Context grows. Conversations vary. What Task A requires differs from Task B.
Structure your knowledge base as searchable memory for an LLM. Files become addressable thoughts. Folders become domains of knowledge. Context files act as memory indexes. Logs preserve continuity.
The vault becomes the brain. The LLM reads what it needs, when it needs it.
YourVault/
├── CLAUDE.md # Memory index (always loaded first)
├── _RECENT.md # Short-term memory (last 24h)
├── .claude/ # Claude Code config
│ └── settings.local.json
├── 00 - System/ # LLM working memory
│ ├── _context.md # Self-referential context
│ ├── _log.md # Activity trace
│ ├── Sessions/ # Captured outputs worth keeping
│ ├── Patterns/ # Reusable solutions
│ └── Reference/ # Persistent knowledge
├── 01 - Work/ # First knowledge domain
│ ├── _context.md # Domain memory index
│ └── _log.md # Domain activity trace
├── 02 - Personal/ # Second knowledge domain
│ ├── _context.md
│ └── _log.md
└── ...
Every folder is a memory region. Every _context.md is an index into that region. Every _log.md preserves what happened there.
The master index. The LLM reads this first. It answers: who are you working with, what do they care about, where is everything stored?
Contains:
| Section | Purpose |
|---|---|
| WHO | User identity, roles, schedule |
| WHEN | Current date (timestamp for this memory state) |
| WHAT | Domain routing table (keyword triggers to memory regions) |
| VOICE | Output calibration rules |
| NOW | Current state snapshot (live memory of what's active) |
| HOW | Operating instructions |
| RULES | Universal constraints |
Keep this file between 200-400 lines. Dense and scannable.
Each domain has its own index. The routing hook points at the matching file. The model or user reads it after selection. The files tell the LLM what to know about a specific region:
- Domain purpose and scope
- Active projects/entities
- Domain-specific rules
- Tool/API access notes
- Current blockers or warnings
Think of these as table of contents for memory regions.
Reverse-chronological activity logs. Preserve what happened so future sessions can recall it.
## 2026.01.15
**Work Done**
- Completed database migration for Project Alpha
- Files: `01 - Work/Projects/alpha-migration.md`
- Decision: chose PostgreSQL over MySQL (latency benchmarks in Reference/)
**Blockers/Notes**
- Staging environment down until ThursdayThe reference includes a recency note. The following command lists Markdown files modified in the last 24 hours. Run it explicitly to inspect recent changes.
find "/path/to/vault" -name "*.md" -type f -mmin -1440 \
| grep -v node_modules | grep -v ".obsidian"The LLM's own memory region for persisting outputs worth keeping:
| Folder | Purpose |
|---|---|
Sessions/ |
Captured outputs worth finding later |
Patterns/ |
Solutions that worked once, searchable for reuse |
Reference/ |
Persistent knowledge: decisions, preferences, specs |
This is where the LLM writes to memory, not just reads from it.
The core mechanism. Your words trigger memory access.
CLAUDE.md contains a routing table:
| Domain | Context File | Load when prompt mentions... |
|--------|--------------|------------------------------|
| **Work** | `01 - Work/_context.md` | project, client, deadline, sprint |
| **Personal** | `02 - Personal/_context.md` | budget, health, family, task |
| **Research** | `03 - Research/_context.md` | paper, hypothesis, dataset, experiment |The hook matches keywords in your prompt to domains, then emits the candidate _context.md path. context_loaded stays false. You say "client," it names the client file. The model or user reads that file if the domain is correct.
YourVault/
├── CLAUDE.md
├── _RECENT.md
├── 00 - System/
│ ├── _context.md
│ ├── _log.md
│ ├── Sessions/
│ ├── Patterns/
│ └── Reference/
├── 01 - [DOMAIN-1]/
│ ├── _context.md
│ └── _log.md
├── 02 - [DOMAIN-2]/
│ ├── _context.md
│ └── _log.md
- Fill in WHO section with your identity/roles
- Define your domains and routing keywords
- Establish VOICE rules (how the LLM should write)
- Document date format, file naming, etc.
- Add universal rules that apply everywhere
For each domain:
- One-line purpose statement
- Current active work
- Domain-specific rules and constraints
- Tool access notes
- Known issues or warnings
cd /path/to/YourVault
claudeClaude Code auto-reads CLAUDE.md on session start.
After significant sessions, tell Claude: "Log this session."
The LLM updates domain _log.md with work done, the NOW section if state changed, and any session artifacts worth preserving.
# [Your Name]'s Vault
---
## WHO
[Your name]. [Brief role description].
## WHEN
Today: YYYY.MM.DD
## WHAT (Domains)
| Domain | Context File | Load when prompt mentions... |
|--------|--------------|------------------------------|
| **[DOMAIN-1]** | `01 - [Name]/_context.md` | keyword1, keyword2, keyword3 |
| **[DOMAIN-2]** | `02 - [Name]/_context.md` | keyword1, keyword2, keyword3 |
## VOICE
1. No sycophancy — don't open with agreement or praise
2. Dense output — no filler phrases
3. [Your rules]
## NOW (Current State)
**[DOMAIN-1]:** [Current status, blockers, active work]
**[DOMAIN-2]:** [Current status, blockers, active work]
## HOW
1. Route first — use the hook pointer, then READ the selected _context.md
2. Check recency — READ _RECENT.md for recently modified files
3. Update state — after significant work, update NOW section
## RULES
1. Read before edit — never modify without reading first
2. No assumptions — ask if unclear
3. Date format — YYYY.MM.DD (dots not dashes)# [Domain Name] Context
> [One-line purpose]
---
## CURRENT STATE
**Active:** [What's in progress]
**Blocked:** [Any blockers or warnings]
**Next:** [Upcoming priorities]
## RULES (Domain-Specific)
1. [Rule 1]
2. [Rule 2]
## TOOLS & ACCESS
| Tool | Access | Notes |
|------|--------|-------|
| [Tool] | [How to access] | [Constraints] |
## KEY ENTITIES
| Entity | Context |
|--------|---------|
| [Person/Project] | [Brief context] |Under 400 lines. Use tables. The LLM reads this every session. Make it fast to parse.
More keywords = better routing accuracy. Include proper nouns (people, projects, tools), verbs you use (cleanup, review, schedule), and domain jargon.
Pick one format. Use it everywhere. YYYY.MM.DD recommended — sorts correctly, no ambiguity.
The NOW section is live memory. Update it after significant work. Next session reads it.
Logs are for searchable continuity, not documentation. Reference material belongs in Reference/. Reusable patterns belong in Patterns/. Logs are timestamped activity traces.
Knowledge bases with cloud sync are fragile to bulk file operations. Moving/renaming/deleting files can corrupt indexes. Warn the LLM about this in RULES.
Symptom: LLM gets confused, mixes domains, gives generic responses. Cause: Too much loaded at once. Fix: Tighten routing keywords. Make domain boundaries clearer.
Symptom: LLM references outdated information. Cause: NOW section not updated. Fix: Update NOW after significant sessions. Make it a habit.
Symptom: LLM doesn't load context when it should. Cause: Keywords don't match prompt language. Fix: Add more keywords to routing table. Use terms you actually use.
Symptom: Logs become unreadable, too much noise. Cause: Logging trivial activity. Fix: Only log state changes, decisions, blockers. Not every action.
- Searchable memory — every file has an address, keywords trigger retrieval
- Progressive disclosure — a candidate path is selected on-demand, then that file is read
- Persistent state — NOW section and logs carry information forward
- Two-way memory — the LLM reads from and writes to the vault
- Self-indexing — context files explain the vault to the LLM
The vault becomes a shared brain. You write for yourself and for the LLM. The LLM searches for what it needs and writes what should persist.