Back/claude code

Claude + Obsidian 第二大脑集成

Updated 2026-04-12
4 min read
808 words

Claude + Obsidian 第二大脑集成

构建一个永不睡眠、永不遗忘、每天都在变得更聪明的第二大脑。

核心体验

每天早上打开笔记本,在你输入一个字之前,Claude 已经知道:

  • 你是谁
  • 你正在做什么项目
  • 你使用的每一个工具
  • 每一个未完成的任务
  • 你写过的每一篇文章
  • 你捕获过的每一个想法

这不是聊天机器人,而是一个真正的第二大脑。

快速设置(5分钟)

1. 安装 Obsidian

下载并安装 Obsidian:https://obsidian.md/

2. 创建 Vault

在 Obsidian 中创建一个新的 vault,命名为你的工作空间(例如 "Leo's workspace")。

3. 安装 Claude Code

下载并安装 Claude Code:https://claude.com/product/claude-code

4. 选择 Vault

在 Claude Code 中选择你的 Obsidian vault 目录作为工作目录。

5. 配置 LLM Wiki Pattern

使用 Andrej Karpathy 的 LLM Wiki 提示词,分为两部分:

第一部分:核心架构

# LLM Wiki

A pattern for building personal knowledge bases using LLMs.

## The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation.

The idea here is different. Instead of just retrieving from raw documents at query time, the LLM **incrementally builds and maintains a persistent wiki** — a structured, interlinked collection of markdown files that sits between you and the raw sources.

This is the key difference: **the wiki is a persistent, compounding artifact.** The cross-references are already there. The contradictions have already been flagged. The synthesis already reflects everything you've read.

## Architecture

Three layers:

1. **Raw sources** — your curated collection of source documents. Immutable — LLM reads but never modifies.
2. **The wiki** — LLM-generated markdown files. Summaries, entity pages, concept pages. LLM owns this layer entirely.
3. **The schema** — CLAUDE.md or AGENTS.md telling the LLM how the wiki is structured.

## Operations

**Ingest.** Drop a new source into raw collection and tell LLM to process it.
**Query.** Ask questions against the wiki. Answers can be filed back as new pages.
**Lint.** Periodically health-check the wiki for contradictions, stale claims, orphan pages.

## Indexing and logging

**index.md** — content-oriented catalog of everything in the wiki.
**log.md** — chronological append-only record of operations.

第二部分:工具与技巧

## Tips and tricks

- **Obsidian Web Clipper** — browser extension to convert web articles to markdown
- **Download images locally** — Settings → Files → Attachment folder path: `raw/assets/`
- **Obsidian's graph view** — best way to see the shape of your wiki
- **Marp** — markdown-based slide decks
- **Dataview** — runs queries over page frontmatter
- The wiki is just a git repo — version history, branching, collaboration for free

## Why this works

The tedious part of maintaining a knowledge base is not the reading or the thinking — it's the bookkeeping. Updating cross-references, keeping summaries current, noting when new data contradicts old claims.

Humans abandon wikis because the maintenance burden grows faster than the value. LLMs don't get bored, don't forget to update a cross-reference, and can touch 15 files in one pass. The wiki stays maintained because the cost of maintenance is near zero.

The human's job is to curate sources, direct the analysis, ask good questions, and think about what it all means. The LLM's job is everything else.

日常操作流程

Ingest(摄取)

用 Obsidian Web Clipper 剪藏文章到 raw sources 文件夹,然后告诉 Claude:

claude -p "I just added an article to /raw-sources.
Read it, extract the key ideas, write a summary page to /wiki/summaries/,
update index.md with a link and one-line description, and update any
existing concept pages that this article connects to.
Show me every file you touched." --allowedTools Bash,Write,Read

一篇文章:Claude 链接 10-15 个 wiki 页面,发现意外连接,标记矛盾,记录所有变更。

Query(查询)

询问 wiki,Claude 扫描 index,拉取相关页面,引用来源回答。然后把最好的输出保存回 wiki——比较、分析、新连接——让洞察不会消失在聊天记录中。

Lint(清理)

每周运行一次:

claude -p "Read every file in /wiki/. Find: contradictions between pages,
orphan pages with no inbound links, concepts mentioned repeatedly but
with no dedicated page, and claims that seem outdated based on newer files
in /raw-sources/. Write a health report to /wiki/lint-report.md with
specific fixes." --allowedTools Bash,Write,Read

你的知识库自动保持健康,维护不再是你的负担。

自动化工作流

每日晨间简报

claude -p "Write a Python script called morning_digest.py that:
1) reads Memory.md and surfaces any open actions due today
2) reads any new files added to /raw-sources in the last 24 hours
3) prints a clean briefing to the terminal.
Then schedule it as a cron job every morning at 7:30am." --allowedTools Bash,Write

设置一次,每天早上自动运行。

会议记录处理

claude -p "Read the transcript in /transcripts/call-today.md.
Extract every decision made, every action item with owner and deadline,
and a 3-bullet summary. Add actions to /Action-Tracker.md, log decisions
to /Decision-Log.md, and create a client note in /clients/ linking back
to this transcript." --allowedTools Bash,Write,Read

每个决定都被归档,每个行动都被追踪,再也不会有东西丢失在聊天记录中。

第二大脑里放什么?

想想过去一年你消费过但消失的内容:

  • 读完就忘的书
  • 改变你思考方式的播客
  • 晚上11点保存却从未重新打开的文章
  • 教你比任何课程都多的 YouTube rabbit holes
  • 你标记却从未再看的 Kindle 高亮
  • 重大决策前的研究
  • 旧项目笔记
  • 从错误中学到的教训

所有这些都坐在某处无所事事。它们属于你的 vault。

Vault 不需要完整才有用。它只需要真实。

为什么这有效

大多数第二大脑项目死于同样的死亡。你开始有组织,但维护堆积:更新标签、保持交叉引用最新、结构演化时重新组织。**这是全职工作之外的额外工作 → 你跳过它,系统退化 → 回到分散的笔记。**六个月后你试图重建它,循环重复。

Claude 永久打破了这个循环——维护只是一个命令。重新组织整个 vault 是一个提示词。从 Notion 迁移?一个命令处理每个导出文件,添加正确的属性,将所有内容重构到你的新系统中。

人的工作是策划来源、提出好问题、思考这一切意味着什么。 Claude 的工作是其他一切——总结、交叉引用、归档和记账,让知识库随着时间真正有用。

Vannevar Bush 在 1945 年描述了类似的东西,一个个人策划的知识存储,文档之间的连接与文档本身一样有价值。他称之为 Memex,他无法解决的部分是谁来做维护。

现在你知道是谁做它了。

Sources

Linked from