Build a Self-Improving AI Second Brain with Claude Code and Obsidian in One Evening
Preface
Your best ideas are now scattered across a dozen places: note-taking apps, dozens of browser tabs, and AI conversations that disappear once you close them. Every time you start work, you have to reconstruct context from memory—and you're bound to forget most of it.
A "Second Brain" solves this: it lets an AI remember who you are and what you're working on over the long term, turning your notes, to-dos, and inspirations into a system that organizes itself and understands you better the more you use it.
Who this is for: people who don't want to be locked into a single model and want to spend one evening getting their knowledge management completely sorted out. You can follow along even if you've never opened Claude Code or Obsidian.
Problem Analysis
First, let's clarify what this system actually solves.
Core contradiction: AI is powerful, but every conversation starts with amnesia. If you don't actively feed it, it will never know who you are.
Solution: Write "who you are" and "what you've accumulated" to disk as plain text files, and have the AI automatically load and read/write them every time it starts working. Two key points:
- Storage layer uses Obsidian—notes live as plain text on your own computer, linking to each other. Over time, they grow into a graph, a map showing "how your ideas connect." The files always belong to you.
- Brain layer uses Claude Code—it reads the entire vault, files new information into the right place, creates links to existing content, and answers your questions based on everything it has. You never have to reintroduce yourself again.
Why plain text? Because plain text doesn't lock you into any single AI. Point a different model at it next year, and it still works—you own the brain itself, not the tool.
Going deeper, it's a pipeline where four folders each play their role:
Inputs (raw ideas/material) →
Process (Claude processing) →
Outputs (finished work) →
Feedback (results & metrics)
↑________feedback feeds the next round________|
Solution: 9 Steps to Build from Scratch
One overall premise first: no MCP needed. The vault is just a regular folder. cd into it and run claude, and it directly reads and writes the Markdown inside.
Step 1: Install Claude Code + CC Switch, connect DeepSeek
First, install Claude Code (CLI tool). Open a terminal, make sure Node.js ≥ 18:
node -v
Then install:
npm install -g @anthropic-ai/claude-code
Next, install CC Switch (used to manage/switch models, i.e., run Claude Code on more cost-effective models): go to cc-switch.cc or GitHub Releases, download the installer for your system (Windows .msi / Mac .dmg), install and open it.
In CC Switch, click + to add a provider, select Anthropic Compatible, and fill in:
- Name:
DeepSeek - Base URL:
https://api.deepseek.com/anthropic - API Key: Apply at platform.deepseek.com and paste it in
- Main model:
deepseek-v4-pro[1m](for complex tasks); for lightweight tasks, usedeepseek-v4-flash
After saving, click Enable. Claude Code supports hot-switching, so you usually don't need to restart the terminal. Open an empty folder, run claude, and ask "Who are you?"—if it answers normally, DeepSeek is connected.
Step 2: Install Obsidian and create a vault
Download and install from obsidian.md (free). On the welcome page, click Create new vault, name it something like brain, choose a folder, and click Create. From now on, this folder is your second brain.
Manually create a note first to feel the core mechanism: create a new note, write a random sentence, then type [[goals]]. The word inside the double brackets becomes a link.
Notes pointing to notes—that's the entire core mechanism. Later, Claude will do this for you automatically.
Step 3: Enter the vault, open Claude Code
The second brain is just a bunch of text files on disk. No Local REST API needed, no separate wiring for Claude—just enter the directory and start a session:
cd your-vault-folder-path
claude
Test it: "List the files in the current directory." If it can list them, it's standing at the root of your brain. Paste the prompts from the following steps into this session.
Habit: Obsidian is for viewing the graph and manually editing notes; Claude Code is for reading, writing, and organizing. Both point at the same folder. Closing Obsidian doesn't stop Claude from working.
Step 4: Load "yourself" into the brain
Now Claude can read and write the vault, but it knows nothing about you. An empty brain is useless. And don't type it out yourself—let Claude interview you. Paste this into the current session:
You are now going to help me build my second brain. Please ask me one question at a time to build my personal profile. You need to ask: who I am and what I do; my goals for this year; how I want you to talk to me; my strengths and weaknesses; the projects I'm currently working on. Wait for my answer after each question before asking the next. After you've asked everything, write all the content into a file called CLAUDE.md in the root of the vault, organized with headings, so you automatically load it every time you start a new session.
When answering, treat it like giving a background handover to a new co-founder. The more honest your answers, the better the brain will understand you. When it's done, open CLAUDE.md in the vault root—your entire context is now on disk. From now on, no more self-introductions.
Step 5: Build projects with the correct structure
CLAUDE.md is the strategy layer; projects are where the work gets done. Each project gets its own folder so Claude can focus on one thing at a time instead of facing your entire life. Let it build the structure:
Create a project folder called youtube-channel in my vault. Inside it, create four subfolders: Inputs, Process, Outputs, Feedback. Then write a CLAUDE.md inside this project folder explaining what this project is, its single goal, and your specific role in helping me achieve that goal. If you need more details, interview me.
Replace youtube-channel with whatever you're working on. Content, finances, clients—repeat once per domain.
Step 6: Only open a single project to work
This is the key action that keeps the whole system sharp: don't work inside the giant master vault. Only open the current project so Claude only sees that one thing.
Claude Code: exit the current session, enter the project directory, and start again:
cd your-vault/youtube-channel
claude
Obsidian (optional, handy for viewing the graph): click the vault name in the bottom-left → Manage vaults → Open folder as a vault → select the same project folder → Trust.
Now Claude only reads that project's CLAUDE.md and ignores everything else. The big vault is for planning; a single project is for delivery.
Step 7: Turn it into a skill so you never repeat yourself
A skill is a saved workflow that runs when you call it. Anything you've done more than twice should become a skill. Paste this into the project session:
I want to turn this into a reusable skill. Here's how I do [this task], with an example: [paste your example or steps]. Save it as a markdown skill file in this project's skills folder, give it a clear name, and specify when it should be triggered.
Next time, just say "Run the [name] skill," and it executes your way immediately. Writing client emails, preparing a video episode, categorizing bank transactions—give every repeat task a skill.
Step 8: Feed "changing information" into the brain
Static notes are only half a brain. Calendar events, to-dos, promises made in chats also need to land in the vault. Principle: turn live information into text, and let Claude file it.
Method A: Before starting work each day, copy today's schedule and to-dos from Feishu / DingTalk / WeCom / your phone calendar into the vault—for example, create Inputs/today.md—then say in the session:
Read Inputs/today.md. Organize today's schedule and to-dos into the tasks project: write out the next action for each item; mark any that lack a clear next step; link to existing notes using [[links]] where relevant.
Method B: Export .ics or a spreadsheet from your calendar app, drop it into Inputs/, and have Claude parse and archive it.
Remember: The brain eats text. Once information is in the vault, the organizing is up to Claude.
Step 9: Hook up "daily organizing"
Make maintenance a fixed action, and the brain will tidy itself up.
Plan A (enough for most people): First save the organizing workflow as a skill. Every day, enter the vault, start claude, and call it:
Turn "daily organizing" into a skill: check the vault, file new content from Inputs into the right places and create links, mark expired notes, write a 3-line summary of overnight changes to Outputs/daily-summary.md. After saving, I just say "run daily organizing" to execute.
Plan B (want to see results when you wake up): Use the system task scheduler to run it automatically at a set time. First, create daily.ps1 in the vault (Windows):
Set-Location "your-vault-folder-path"
claude -p "Check my vault. File new content from Inputs into the correct locations and create links; mark expired notes; write a 3-line summary of overnight changes into Outputs/daily-summary.md." --permission-mode acceptEdits
Open Task Scheduler → Create Basic Task → every day at 7:00 AM → start a program, choose powershell.exe, arguments:
-NoProfile -ExecutionPolicy Bypass -File "your-vault\daily.ps1"
Mac / Linux use cron: cd your-vault && claude -p "……" --permission-mode acceptEdits. Note: the computer must be awake when the scheduled task runs.
Pitfalls & Precautions: Govern with permissions, not prompts
This is the one unbreakable rule of the entire system. Telling an agent "don't delete this file" is just a suggestion—assume that anything it is technically capable of doing, it will eventually do. Implement the following:
Keep keys in tools, not in the vault. DeepSeek / any API Key only goes in CC Switch (or system environment variables). Do not write them into
CLAUDE.md,Inputs/, exported chat logs, or commit them to Git. The vault is for notes, not a password book.Only open the directory you're working in. Use
cdto enter the current project folder before startingclaude. Don't start from the disk root or home directory. The fewer files it can reach, the smaller the blast radius. Keep sensitive materials (ID scans, bank exports) outside the vault, or in a separate folder that never touches Claude.Use Claude Code's permission modes; don't disable confirmations. Keep the default for interactive sessions: it asks before modifying files or running commands, and you approve before it executes. Type
/permissionsin a session to view and tighten rules.- Want to assess the situation without modifying files →
claude --permission-mode plan - Scheduled organizing script → can use
--permission-mode acceptEdits(only auto-approves file reads/writes, still safer than full open) - Never use
--dangerously-skip-permissions/bypassPermissions
- Want to assess the situation without modifying files →
Grant minimum permissions when connecting external services. If you later connect calendars, email, or company APIs: issue a dedicated key with read-only scope. Never hand an agent a master account token that can send mail or delete cloud drives. A revocable key is ten thousand times more effective than "please don't send" written in a prompt.
Use Git as a safety net for the vault. Run
git initin the vault root, commit at important milestones. If Claude messes something up, you can roll back. This is the last safety net beyond permissions.
Keys, not prompts. Controls live in tool configuration and permission switches, not in sentences that start with "Please make sure to…"
Lazy Path: Three ready-made open-source repos
If you don't want to wire everything from scratch, the community has packaged solutions. Search these names on GitHub:
- claude-obsidian (AgriciDaniel) — A self-organizing second brain based on the Karpathy wiki pattern. Sets up the vault skeleton, configures connections, and comes with several presets: executive / builder / creator / researcher.
- obsidian-second-brain (eugeniughelbur) — Comes with 43 ready-made commands like
/obsidian-save,/obsidian-daily,/obsidian-find. Supports Claude, Codex, and Gemini simultaneously—not locked into a single tool. - second-brain-starter (coleam00) — First interviews you, then generates a "proactive assistant" plan, and then actually builds it using plain text + Python + an Obsidian vault.
All three are essentially just text files and scripts. Clone one down, then reshape it into your own private version.
Summary
The same set of tools, but two completely different ways of using them—before and after setting this up:
- Before: Every conversation feels like meeting for the first time. Details are lost once you close the window. Your own brain carries the real context—and it constantly leaks.
- After: A vault holds your profile, projects, and notes.
cdin, startclaude, and it readsCLAUDE.mdto know who you are. New information enters Inputs, gets organized and linked into the graph, growing denser with use. And it's all plain text on your computer—switch models and it still works.
A few closing points:
- The core is one thing: Write "who you are" to disk as
CLAUDE.mdand have the AI load it automatically every time—this is the watershed between an amnesiac chatbot and one that understands you better the more you use it. - Plain text is the baseline: No model lock-in. You own the brain itself, not the tool.
- Govern with permissions, not prompts: Keys, least privilege, Git safety net. Don't count on a "please make sure to" for security.
- Just get it running: One evening, 9 steps, and it operates automatically. Don't get stuck choosing tools.
You're not configuring a Claude; you're building your own memory—it gets a little smarter every day it's fed. Almost no one will actually do it, but those who start today will open their graph a month later and freeze: because it remembers things they've long forgotten.
Top 1 from juejin.cn, machine-translated. The original thread is authoritative.
Learned something [thumbs up]