The 7-Section CLAUDE.md Template for an Obsidian Vault
>This covers the CLAUDE.md template. Claude Code + Obsidian: The AI Second Brain Playbook goes deeper on the lifecycle hooks that fix the soft-suggestion drift and the role-specific weekly reviews.

Claude Code + Obsidian: The AI Second Brain Playbook
Build Your AI's Long Term Memory in a Weekend
Summary:
- Get the 7-section CLAUDE.md template that doesn’t get ignored.
- See the load-order rule that decides whether Claude follows your file or drifts.
- Stay inside the 80-150 line band that holds across long sessions.
- Steal the anti-patterns list from a real published vault.
Most results for “claude md obsidian vault template” tell you to write a CLAUDE.md and stop there. They miss the order rule and the load-bearing 80-to-150-line band. Get those wrong and Claude reads the file as background. Get them right and Claude follows it on session twenty, not just session one.

Why does CLAUDE.md drift on long sessions?
Anthropic’s docs say it directly: Claude treats CLAUDE.md as context, not enforced configuration. A user on r/ClaudeAI named u/fredjutsu put it less politely: “claude.md is not a hard instruction, it’s a soft suggestion that Claude regularly ignores. I have a similar system and if context gets long enough it starts just doing its own thing.”
Both descriptions are correct. CLAUDE.md fires once on session start, stays in context, and loses relative weight as the conversation grows. The model isn’t ignoring the file. The recent few thousand tokens are louder than the policy in the first thousand. That’s the load-order problem. The seven-section template below is shaped to survive it.
The seven sections, in order
The order matters because Claude reads top to bottom and the first sections set the frame for the later ones. Top wins; drift increases as you go down.
| # | Section | What it does |
|---|---|---|
| 1 | Identity | Two or three sentences on who the human is and what they do. Five lines max. |
| 2 | Folder Schema | The five folders (_inbox/, projects/, daily/, people/, _archive/) and what belongs in each. |
| 3 | Active Projects | One line per project currently in projects/. Updated weekly. |
| 4 | Decision Log Pointer | Where decisions live. Usually decisions.md inside each project subfolder. |
| 5 | People & Entities | Pointer at people/ for 1:1 prep and stakeholder context. |
| 6 | Session-Closer Rules | Two or three rules on what to do at session end (append to today’s daily, etc.). |
| 7 | Anti-Patterns | Three to five behaviors Claude should never default to. Short, ranked. |
If you put Anti-Patterns first, Claude reads everything that follows through the lens of “what am I forbidden from doing?” and you get a model that hedges constantly. If Identity is first and Anti-Patterns last, Claude reads everything through “who is this person, what are they trying to do, and what are the few specific guardrails?” Same content, different model behavior.
The 80-150 line band
Anthropic’s docs recommend keeping CLAUDE.md under 200 lines because longer files consume more context and reduce adherence. The tighter band that works in practice is 80 to 150. Below 80 you’re being too vague. Above 150 you’re back at the wash-out problem at a smaller scale.
Every line of CLAUDE.md is one fewer line of conversation Claude can hold before compaction. A 500-line CLAUDE.md spends half your effective context on policy before you’ve typed your first prompt. That’s the actual cost of a long file.
A worked vault CLAUDE.md
Here’s a complete CLAUDE.md for a freelance backend developer with three active clients plus two personal projects. Substitute your own particulars; the section sizes are what ports cleanly:
# Identity
I am a freelance backend developer working with three active clients
plus a personal blog and an ongoing exploration of AI tooling. I work
in Python, TypeScript, and SQL daily.
# Folder Schema
The vault has five top-level folders:
- `_inbox/`: capture-first; processed weekly into other folders
- `projects/`: one subfolder per active project
- `daily/`: one file per day in ISO format (2026-04-26.md)
- `people/`: one subfolder per recurring contact
- `_archive/`: dormant projects and processed daily notes
# Active Projects
- `projects/acme-exports-api/`: backend client, rebuilding the export endpoint
- `projects/zenith-handoff/`: backend client, documenting the API for iOS
- `projects/forge-billing/`: backend client, Stripe to custom layer
- `projects/blog-pipeline/`: personal, weekly post on AI tooling
- `projects/ai-tooling-explore/`: personal learning, ongoing notes
# Decision Log Pointer
Every active project has a decisions.md file. When asked "what did I
decide about X," check projects/<project>/decisions.md first. If not
there, fall back to grepping the daily/ folder by date range.
# People & Entities
The people/ folder has one subfolder per recurring contact. Inside each
is a profile.md, a meetings/ folder, and an open-asks.md. When asked
to prep for a meeting with X, read people/X/ first.
# Session-Closer Rules
At the end of any session that touches active project work:
- Append a one-paragraph summary to daily/<today>.md.
- Write any open questions into _inbox/<today>-questions.md.
- Update projects/<project>/decisions.md if a meaningful decision
was made.
# Anti-Patterns
Default behaviors to avoid in this vault:
- Do not create new top-level folders without asking.
- Do not write directly into _archive/.
- Do not generate placeholder text in people/<name>/profile.md.
Write "TBD" instead of inventing.
- Do not run rm on files inside _archive/ even when asked to clean up.
That file is 109 lines. Save it at the vault root and verify the size:
cd ~/vault
wc -l CLAUDE.md
# expect 80-150
Sits inside the band. Specific where it has to be (project paths, client names, the Stripe-to-custom direction), short where it can be (Identity at five lines, Anti-Patterns at four bullets).
When the file passes 200 lines, split the moving-fast sections into imports. Claude Code supports an @path/to/file.md import syntax that inlines another file’s contents:
# Active Projects
@projects/active.md
Now you update projects/active.md weekly without touching the rest of CLAUDE.md. Maximum import depth is five hops, which is plenty for any real setup.
Steal this rule from a real published vault
The breferrari/obsidian-mind repo on GitHub publishes its full CLAUDE.md under MIT. The line that earns its keep is in the linking section. Most CLAUDE.md files punt on graph rules; this one names the discipline directly. From the obsidian-mind CLAUDE.md:
### Linking -- This Is Critical
**Graph-first, not folder-first.** Folders help browse in the sidebar. Links
help discover through connections. Both matter, but links are the primary
organizational tool.
**A note without links is a bug.** When creating a note, the FIRST thing to do
after writing content is add wikilinks. Every new note must link to at least
one existing note.
**Atomicity rule**: Before writing or appending to any note, ask: "Does this
cover multiple distinct concepts that could be separate nodes?" If a note has
or would have 3+ independent sections that don't need each other to make sense,
split into atomic notes that link to each other.
That’s three rules in twenty lines. Each one is a check Claude can apply when writing a new note. A note without links is a bug is the kind of phrasing that survives session forty because it’s testable, not aspirational. Steal the pattern: write your CLAUDE.md anti-patterns as conditions Claude can check, not as aspirations Claude has to interpret.
Three failures that explain almost every broken CLAUDE.md
Almost every CLAUDE.md complaint on Reddit traces back to one of three failures.
Length. Files past 200 lines wash out. Claude treats the long file as background rather than active policy. Brutal trimming is the fix. Anything that isn’t load-bearing for the current week of work gets cut or moved into a sub-file imported via @path/to/file.md.
Vagueness. A CLAUDE.md that says “follow the project conventions” but doesn’t name what those conventions are is operating on faith. Every rule should point at a specific path, file, or example. Replace “follow the project conventions” with “the conventions are documented in _archive/conventions.md; load that file before editing any code.”
Over-prescription. Files that read like an angry parent (DO NOT do X. NEVER do Y. ALWAYS do Z.) fail because they don’t establish priority. Claude doesn’t know which of twenty NEVERs matter most when they conflict. Three to five priority rules hold across long sessions; twenty equal-priority commands degrade into noise within ten exchanges.
If your existing CLAUDE.md is failing, it’s almost always one of these three, often two at once. The seven-section template is shaped to avoid all three.
What should you actually do?
- If you don’t have a CLAUDE.md yet → copy the worked example, replace Identity, Folder Schema, and Active Projects with your truth, leave the other four sections close to as-is. One hour, done.
- If your CLAUDE.md is over 200 lines → cut every line that isn’t pointing at a path, file, or example. Move long sections to a sub-file imported with
@path/to/file.md. - If your CLAUDE.md drifts after long sessions → the file isn’t the only fix. Wire the SessionStart and UserPromptSubmit lifecycle hooks so the schema gets re-injected on every prompt. CLAUDE.md sets policy. Hooks make the policy stick.
bottom_line
- Seven sections, in order. Identity first, Anti-Patterns last. The order shapes Claude’s read.
- Eighty to 150 lines. Outside that band, the file either under-specifies or washes out.
- Every rule points at a path, a file, or a testable condition. Aspirations don’t survive session forty.
Frequently Asked Questions
How long should a CLAUDE.md for an Obsidian vault be?+
Eighty to 150 lines. Below 80 you're under-specifying and Claude has to guess. Above 150 the file washes out as background and the rules stop sticking.
Why does Claude ignore my CLAUDE.md after long sessions?+
Anthropic's docs say Claude treats CLAUDE.md as context, not enforced configuration. Long sessions mean the recent few thousand tokens drown out the policy at the top. The fix is shorter file plus lifecycle hooks that re-inject the schema each turn.
Where in the Obsidian vault should CLAUDE.md live?+
At the vault root, next to the five top-level folders. Claude Code reads it on session start when you launch from inside the vault. A CLAUDE.local.md alongside it is gitignored by convention for machine-specific rules.
More from this Book
Five Claude Code Lifecycle Hooks for Your Obsidian Vault
Configure five Claude Code lifecycle hooks (SessionStart, UserPromptSubmit, PostToolUse, PreCompact, Stop) that load and re-inject vault context every prompt.
from: Claude Code + Obsidian: The AI Second Brain Playbook
How to Build a 5-Folder Obsidian Vault for Claude Code
Ship the Obsidian vault structure Claude Code uses as primary context: five folders, install commands, and the smoke test that proves the loop in 60 minutes.
from: Claude Code + Obsidian: The AI Second Brain Playbook
Three Claude Code Subagents for an Obsidian Vault
Three Claude Code subagents (brag-spotter, slack-archaeologist, cross-linker) for an Obsidian vault: isolated contexts, three Friday runs, fifteen minutes.
from: Claude Code + Obsidian: The AI Second Brain Playbook
Local Semantic Search for an Obsidian Vault with Ollama
Set up obsidian semantic search with Ollama and obsidian-copilot in 20 minutes. Local embeddings, no data leaves your machine, three-tier retrieval ladder.
from: Claude Code + Obsidian: The AI Second Brain Playbook