跪拜 Guibai
← All articles
Artificial Intelligence

Build a Self-Improving AI Second Brain with Claude Code and Obsidian in One Evening

By 野小生 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Persistent AI memory that lives in local plain text sidesteps vendor lock-in and gives developers a knowledge base that outlasts any single model or tool. The permission-first security model is the practical difference between a toy and something safe enough to run unattended.

Summary

The system solves AI amnesia by storing personal context, projects, and daily inputs as plain-text Markdown files. Claude Code reads the vault directly, files new information, creates cross-note links, and answers questions without needing a re-introduction. A four-folder pipeline—Inputs, Process, Outputs, Feedback—keeps work flowing, while reusable skills automate repeat tasks.

Setup swaps Anthropic's model for DeepSeek via CC Switch to cut costs, then walks through building a personal profile, structuring projects, and hooking up a daily auto-organizer. The vault stays pure text, so switching models later requires no migration.

Security hinges on one rule: govern with permissions, not prompts. API keys stay in tool configs, Claude runs scoped to a single project directory, and Git provides a rollback net. Three open-source starter repos offer pre-built skeletons for those who want a faster start.

Takeaways
Claude Code reads and writes an Obsidian vault directly—no MCP server, no Local REST API, just cd into the folder and run claude.
CC Switch lets Claude Code run on DeepSeek's API by presenting an Anthropic-compatible endpoint, cutting per-token costs.
A CLAUDE.md file in the vault root acts as persistent system prompt: Claude loads it every session and never needs a re-introduction.
Each project gets its own folder with Inputs, Process, Outputs, and Feedback subfolders so Claude focuses on one domain at a time.
Reusable skills are saved as Markdown files in a project's skills folder and triggered by name to automate any task done more than twice.
Daily organizing can run as a scheduled task via cron or Windows Task Scheduler, using --permission-mode acceptEdits for unattended file writes.
API keys belong in CC Switch or environment variables, never in the vault, CLAUDE.md, or Git.
Always cd into a single project directory before launching Claude; the fewer files it can reach, the smaller the blast radius.
Three open-source repos—claude-obsidian, obsidian-second-brain, second-brain-starter—provide pre-built vault skeletons and command sets.
Conclusions

Plain-text vaults decouple the knowledge base from the model, which means the brain survives API deprecations and pricing changes that would kill a proprietary solution.

The permission-mode hierarchy—plan, acceptEdits, and the deliberately avoided bypassPermissions—is a practical security gradient that most agent workflows still lack.

Treating the vault as a Git repo is a cheap, universal safety net that works across operating systems and doesn't depend on any AI tool's built-in undo.

The interview pattern for building CLAUDE.md offloads self-documentation to the AI, which produces a more structured and queryable profile than a human would write unprompted.

Concepts & terms
CC Switch
A desktop tool that lets Claude Code talk to non-Anthropic models by presenting an Anthropic-compatible API. It handles model switching and key management so Claude Code can run on providers like DeepSeek without changing the CLI.
Obsidian vault
A folder of interlinked Markdown files managed by the Obsidian app. Notes link to each other with [[double-bracket]] syntax, forming a graph that visualizes how ideas connect.
CLAUDE.md
A Markdown file placed in a vault or project root that Claude Code automatically loads as context at the start of every session, functioning as a persistent system prompt.
Skill (in this system)
A saved Markdown workflow file inside a project's skills folder that encodes a repeatable task. Invoking the skill by name makes Claude execute the steps without re-prompting.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗