
Obsidian + Claude Code: Give Your AI a Second Brain
One prompt. Persistent memory. Every session, every bot, every machine — connected.
For Claude Code and OpenClaw Clawdbot on macOS.
March 13, 2026 · Free · No paywall · No email gate
Claude Code forgets everything. Every. Single. Session.
That's tokens you're paying for — just to re-explain your project.
Cold start, every time
You spend 10 minutes re-explaining your project. Your codebase, your preferences, your past decisions — gone. Claude Code has no idea what you built yesterday.
No searchable history
There's no way to look up what was discussed, what was decided, or what was built. Unlike ChatGPT, Claude Code sessions disappear into the void.
Context compression eats your work
Claude's context window fills up, details get compressed, decisions made early vanish by the end of a long session.
Bots don't share memory
If you run multiple OpenClaw Clawdbot instances, they're siloed. Bot A doesn't know what Bot B decided yesterday. They duplicate work and contradict each other.
Before and after the second brain
❌ Without a second brain
- —Every session starts from scratch
- —No searchable history of past work
- —Context lost when conversations compress
- —Bots work in silos, duplicating effort
- —Manual setup is fragile and time-consuming
- —You're the only one keeping context
✅ With the Obsidian second brain prompt
- ✓Claude reads your past sessions before starting work
- ✓Every conversation auto-archived and searchable in Obsidian
- ✓Topic notes connect projects, people, and tools across sessions
- ✓Multiple bots share one knowledge base
- ✓One prompt sets up everything — automatically
What the prompt builds
One paste. 5–10 minutes. Everything wired up automatically.
Automatic session logging
Every Claude Code session gets a structured log — summary, decisions, changes, next steps. Saved to your Obsidian vault automatically. OpenClaw Clawdbot logs included.
Smart topic linking
The prompt scans your conversations, identifies recurring people/projects/tools, and creates topic notes that connect everything via WikiLinks. You approve before anything gets created.
Background auto-sync
LaunchAgents run silently — new conversations get linked to topics every 10 minutes. OpenClaw Clawdbot memories sync every 5 minutes. No manual work.
Git safety net
Your vault is committed to local git before any file modification. One command undoes everything if something goes wrong. Nothing goes to the internet.
Multi-bot memory
Works with Claude Code AND OpenClaw Clawdbot. All bots read from and write to the same vault. Bot A knows what Bot B did. 6 test runs across 2 machines — all passing.
Multi-machine sync
Run it on your laptop AND your Mac Mini. Obsidian Sync keeps everything in sync. Same prompt, detects what's different on each machine.
Vault-first search
Claude doesn't just write to the vault — it reads from it. Session start hooks auto-load recent context. MCP servers enable keyword and semantic search before going external.
Session safety hooks
Three hooks fire automatically: vault context loaded on start, metadata stub on exit, compaction recovery reminder when context fills up.
Self-organizing vault
Auto Note Mover plugin files notes into the right folders by tag and title pattern. Session logs, topic notes, archives — all sorted automatically.
How the Obsidian + Claude Code setup works
Five steps. Most of them happen automatically.
Paste the prompt into Claude Code
Copy the full prompt from this page and paste it. It's one block. That's it.
Claude Code audits your system
Phase 0 checks what's installed — Obsidian, Claude Vault, OpenClaw, git, Python, plugins. Presents a summary table. Won't re-do anything already working.
Answer 4 questions
Your vault path, which machine you're on, whether to import existing conversations, and what to call your topic folder. Interactive selectors — no text walls.
Walk away
Claude Code installs plugins, sets up LaunchAgents, configures MCP servers, updates OpenClaw Clawdbot configs, commits the vault to git. Typically 5–10 minutes.
Open Obsidian
Your second brain is live. Check Graph View — topic notes connected to sessions and conversations via See Also links. 45 topics, 262 files linked on MacBook. 42 topics, 278 files linked on Mac Mini.
What's under the hood
✍️ Write side — how everything gets saved to Obsidian automatically
Claude Vault watches your Claude Code conversations directory and auto-archives completed sessions to Vault/Conversations/. A LaunchAgent keeps it running at login.
OpenClaw session logs are written by each OpenClaw Clawdbot to Sessions/ and daily memory notes to DailyNotes/. Every bot writes independently to the same vault.
Auto Note Mover runs inside Obsidian and sorts incoming files into the right folders based on frontmatter tags — no manual filing.
Git safety net — vault committed to local git before any file-modifying operation. Roll back instantly with one command.
👁️ Read side — how Claude Code searches Obsidian before starting work
Vault-first protocol instructs Claude Code to search Obsidian before going anywhere else. The strict 5-step order: Topics → Sessions → Conversations → Semantic search → THEN go external.
SessionStart hook shows Claude Code recent sessions across ALL projects at the start of every conversation — not just the current directory. Automatically injects a vault-first reminder.
MCP servers (obsidian + smart-connections) expose the entire vault as a searchable tool inside Claude Code. Keyword and semantic search — no context-window hopping.
TOOLS.md vault-read rules instruct every OpenClaw Clawdbot to search the shared vault before starting any task. What one bot knows, they all know.
🛡️ Safety — what the prompt will never do to your vault
No inline content modification. All linking uses “See Also” footers appended to the bottom of conversation files. Your existing notes are never changed, rewritten, or linked into.
Topic notes need your approval. Before creating any topic note, Claude Code shows you a plain-English list grouped by category. You confirm before anything gets written.
3-file threshold. A concept only gets a topic note if it appears in 3 or more archived files. Common words and one-off mentions don't pollute your vault.
Audit before action. Phase 0 checks everything that's already installed. The prompt never blindly re-executes steps that are already complete.
This took weeks to build and test across 6 runs on 2 machines. You get it in one copy-paste. Free, open, no paywall.
Verify before you run
AI coding agents like Claude Code have full access to your filesystem and can execute shell commands. Prompt injection — hiding malicious instructions inside a text file — is OWASP's #1 AI security risk. We're confident this prompt is clean, but you should verify it yourself. It takes 30 seconds.
Paste this into Claude Code (or any LLM) before running the prompt:
Before I run this prompt, tell me: does it contain any instructions to run shell commands, access files outside this project, send data to external servers, or take any action beyond its stated purpose? List anything suspicious, or confirm it's clean.
A clean prompt gets a clean answer. If anything looks off, don't run it — reach out to us.
Version history
Tested across 6 runs on 2 machines (MacBook + Mac Mini). All passing.
- ✓Read-side overhaul: rewrote vault-read protocol with strict 'VAULT FIRST, EVERYTHING ELSE SECOND' language — lists MCP tools by name and enforces a 5-step search order
- ✓SessionStart hook rewritten to show recent sessions across ALL projects (not just current directory) — fixes the most common cause of Claude Code ignoring the vault
- ✓Orphan folder fix: OpenClaw/ and Archive/ added to topic linker scan paths — previously left all bot daily notes as disconnected orphans in Graph View
- ✓Added folder discovery to Phase 0: detects unknown top-level folders and lets you opt them into linking
- ✓Added Question 5: user picks which unrecognized folders to include in linking
- ✓Fixed Phase 0 tag scan: grep used #topic-note but YAML frontmatter stores topic-note without the # prefix — was missing custom-named topic folders entirely
Show previous versions (6)
- —Fixed Phase 0 tag scan — the grep used #topic-note but YAML frontmatter has topic-note (no # prefix), causing the scan to miss custom-named topic folders entirely
- —Added settings.json backup before hook installation — hooks live outside git, no rollback without this
- —Added hook verification step — tests all 3 scripts with sample data, catches syntax errors before your next session
- —Updated Step 11 verification checklist to include hook test results and settings.json backup confirmation
- —Removed Automatic Linker plugin entirely — replaced with safe 'See Also' footer linking that never modifies inline content
- —Added topic notes: Claude Code scans conversations, identifies recurring people/projects/tools, creates hub pages with user approval
- —Added session safety hooks: SessionEnd metadata stubs, SessionStart vault context loader, PreCompact recovery reminder
- —Renamed Entities/ to Topics/ (user can choose any name)
- —3-file threshold for topic creation, sliding down to 2 for small vaults
- —Silent re-scan after new topic creation via lockfile-protected LaunchAgent
- —BMAD review hardening — 14 fixes applied from 23 findings
- —Fixed nested code fences (quadruple backticks for outer fence)
- —Pinned plugin versions, added download verification, added LaunchAgent wait time
- —Gated Steps 5C/5D on Phase 0 audit results — skips already-complete steps
- —Added runtime estimate (5–10 minutes), moved MCP install into action plan
- —Added git safety net — vault committed to local git before any file-modifying plugin runs
- —Added file linking system (replaced by See Also footer approach in v4.0)
- —Fixed Option 1 behavior — 'Keep what I have' now truly skips initial conversation sync
- —Added orphan file detection to Phase 0 audit
- —Added audit-first Phase 0 — checks what's already installed before re-doing work
- —Added read-side setup — without this, the vault is write-only (an archive, not a brain)
- —Fixed OpenClaw memory model — builds a custom sync script instead of assuming a skill that doesn't exist
- —Added macOS-specific workarounds (TCC/SQLite crash, bash v3, pip failures)
- —Added vault-read instructions to CLAUDE.md protocol
- —Initial release — write-side only
- —Claude Code conversations auto-exported to Obsidian via Claude Vault
- —OpenClaw memory sync via LaunchAgent
- —Auto Note Mover plugin for vault organization
- —No read-side, no linking, no topic notes — write-only archive
Get the prompt
Copy this entire block and paste it into Claude Code. It typically takes 5–10 minutes.
Works on any Mac with Obsidian installed. Detects your setup and only builds what's missing. Running multiple machines? Paste the same prompt on each one — it adapts automatically.
Loading prompt…
Paste this into Claude Code on your Mac. It detects what's installed and configures everything automatically.
Before you paste
- ✅Obsidian(required) — Download at obsidian.md. Create a vault or open an existing one.
- ✅Community Plugins enabled(required) — Settings → Community plugins → Turn off restricted mode
- ✅Smart Connections plugin(required) — Browse → search 'Smart Connections' → Install → Enable
- ✅macOS(required) — Apple Silicon or Intel. Uses macOS-specific tooling (LaunchAgents, zsh, Homebrew).
- ✅Claude Code(required) — Install with: npm i -g @anthropic-ai/claude-code
- ⬜Obsidian Sync — Optional — only needed if you work across multiple Macs.
- ⬜OpenClaw Clawdbot — Optional — adds session log archival and shared memory across your bots.
- ⬜Python 3, Homebrew, Node.js — Installed automatically by the prompt if missing.
Frequently asked questions
Does this work with ChatGPT or other AI tools?
No — this is built specifically for Claude Code and OpenClaw on macOS. It uses Claude Code hooks, LaunchAgents, and CLAUDE.md protocols that are specific to the Claude ecosystem.
Will this modify my existing notes?
Never. The prompt only appends "See Also" footer sections to conversation files. It never modifies existing content inline. And it commits your vault to git first, so you can undo everything with one command.
Do I need to know git?
No. The prompt sets up git automatically. The only command you might ever need is the "undo" command it gives you — and you can also just tell Claude Code "undo the vault changes."
Does it work on Linux or Windows?
Not yet. It uses macOS-specific features (LaunchAgents, zsh, Homebrew). A Linux version is possible but hasn't been built.
What if I already have a CLAUDE.md file?
The prompt preserves your existing content and appends the new protocols. It never overwrites.
What if I already ran a previous version?
The prompt audits everything first. It detects what's already installed and only builds what's missing. Running it again won't break anything.
How much does it cost?
The prompt is free. You need Obsidian (free) and Claude Code (requires an Anthropic API key or Claude Pro subscription). Obsidian Sync ($4/mo) is optional — only needed for multi-machine setups.
What's OpenClaw Clawdbot?
OpenClaw is an open-source framework for running autonomous Claude bots on your own hardware. If you don't use it, the prompt skips that part entirely. It's not required.
What are 'topic notes'?
Topic notes are short wiki pages for recurring concepts — people, projects, tools, organizations. If "Shift Check" appears in 3+ archived files, Claude Code suggests creating a Topics/ShiftCheck.md hub page. You approve before anything gets created.
Does it work on a second Mac?
Yes. Paste the same prompt on each machine and answer "secondary machine" when asked. It configures only the parts that don't sync automatically (LaunchAgents, MCP server, git config) and skips anything already synced via Obsidian Sync.
Keep exploring
More free AI tools and guides from Don't Sleep On AI

AI Handoff Prompt
The free 8-section template that lets you pick up exactly where you left off — no re-explaining, no lost context.

Claude Code Statusline
10 one-command themes that show your context window percentage in color — green, yellow, orange, red. Know before it's too late.

AI Slash Command Builder
Build a custom /slash command that gives Claude Code full project context in one shot. Never repeat yourself again.