打造第二大脑:在你的 Obsidian 笔记里使用 Claude Code
在你的 Obsidian 库中运行 Claude Code,用 CLAUDE.md 里的规矩和三个命令 /daily、/weekly-review、/find-ideas,帮你规划一天、回顾一周并串联想法,而不会改写你的笔记。
- 难度 进阶
- 用时 1-2 小时
- 适用于
- Claude Code
- Claude Desktop
本页内容13 个部分
“第二大脑”是一套让你足够信任、不必再把一切都记在脑子里的笔记系统。Obsidian 是一款免费的笔记应用,它把每条笔记都以纯 Markdown 文本文件的形式,保存在你电脑上一个普通的文件夹里。这个文件夹叫作库(vault)。因为笔记只是文件,Claude Code 可以读取它们,也可以写入新的笔记。
在这份指南中,你将搭建一个由 Claude 协助运转、并且必须遵守规矩的库。最终你会得到三个命令:
/daily根据你未完成的任务、收集箱和项目,写出今天的计划。/weekly-review为你的这一周写一份回顾。/find-ideas <topic>查找相关的笔记,并提出新的关联。
最终你会得到什么
- 一个带有
Inbox、Daily、Projects、Notes、Reviews和Templates文件夹的 Obsidian 库。 - 一个
CLAUDE.md文件。这是 Claude Code 在每次会话开始时都会读取的一组长期指令。 - 库内
.claude/skills/中的三个技能(保存好的命令)。 - 一份备份,让你可以撤销任何改动。
你需要准备什么
| 你需要 | 详情 |
|---|---|
| Obsidian | 可从 obsidian.md 免费获取。定价页面写的是“Free without limits”(无限制免费)。Sync 和 Publish 是可选的付费附加服务。 |
| Claude Code | 需要 Pro、Max、Team、Enterprise 或 Console 账号。免费方案不包含它。可以在终端中使用,也可以在 Claude Desktop的 Code 标签页中使用。 |
| Git(可选) | 用于可以逐步撤销的备份。你也可以直接复制文件夹来代替。 |
每个命令都会读取多条笔记,这会消耗你方案的一部分用量。在大型库里运行 /weekly-review 消耗最多。
第 1 步:创建库
- 安装并打开 Obsidian。
- 如果想从头开始,点击 Create new vault 旁边的 Create。输入一个名称(例如
MyVault),点击 Browse 选择保存位置,然后点击 Create。 - 如果你已经有笔记,点击 Open folder as vault 旁边的 Open,选择那个文件夹。请先备份(见第 6 步)。
Obsidian 的帮助文档提醒不要在另一个库里面再创建库,所以请让这个库独立存放。
第 2 步:在库中打开 Claude Code
终端。如果还没装 Claude Code,请先安装。在 macOS 或 Linux 上运行下面这行(Windows 的命令见安装页面):
curl -fsSL https://claude.ai/install.sh | bash
然后进入你的库并启动它:
cd ~/Documents/MyVault
claude
Claude Desktop。打开 Code 标签页。在 Environment 下选择 Local,在 Project folder 下选择你的库文件夹。
也请保持 Obsidian 处于打开状态。Obsidian 会读取其他应用对你笔记所做的更改,所以你会看到 Claude 新建的笔记出现。
第 3 步:写下规矩(CLAUDE.md)
Claude Code 会自动读取它启动所在文件夹里名为 CLAUDE.md 的文件。Anthropic 建议把它控制在 200 行以内。把下面这条提示词粘贴到 Claude Code 中,紧接着粘贴文件内容:
Create CLAUDE.md in this folder with exactly the content below. Don't change anything else.
# How to work in this vault
This folder is my Obsidian vault. Every note is a plain Markdown file. You are my note assistant: you help me plan, review and connect ideas. You don't reorganize my notes.
## Folders
- Inbox/ – quick captures, not sorted yet
- Daily/ – one note per day, named YYYY-MM-DD.md
- Projects/ – one note per active project
- Notes/ – everything else worth keeping: ideas, reading notes, people, meetings
- Reviews/ – weekly reviews, named YYYY-Www.md (for example 2026-W43.md)
- Templates/ – note templates. Don't edit these unless I ask.
## Rules
- Never delete a note. Never move or rename a note unless I ask in this session.
- Don't rewrite my words. In an existing note you may only add [[links]], or add a section at the end headed "## From Claude".
- Link with Obsidian wiki links, like [[Workshop-November]]. Only link to notes that exist.
- When you use something from my notes, say which note it came from.
- Dates are YYYY-MM-DD. Weeks start on Monday.
- Ignore the .obsidian/ and .claude/ folders.
- If you're unsure, ask before you change anything.
“don’t rewrite my words”这条规矩最重要。它让你的笔记始终属于你,Claude 只会在上面添加内容。
第 4 步:设置文件夹和每日模板
This folder is my Obsidian vault. Please set it up as a second brain. Follow the rules in CLAUDE.md.
1. Create these folders if they don't exist: Inbox, Daily, Projects, Notes, Reviews, Templates.
2. Create Templates/Daily.md with exactly this content:
---
date: {{date:YYYY-MM-DD}}
---
# {{date:YYYY-MM-DD}}
## Notes
## Tasks
- [ ]
3. Don't move, rename or edit any note I already have.
4. Tell me what you created, then list my existing top-level folders with how many notes each holds, and suggest (don't do) where they could fit in the new structure.
Claude 会请求创建文件夹的权限。请逐一批准。
接着,在 Obsidian 里关联这个模板,让你手动创建的每日笔记看起来也一样:
- 前往 Settings > Core plugins,确认 Daily notes 和 Templates 已开启。
- 在 Core plugins > Templates 下,把 Template folder location 设为
Templates。 - 在侧边栏的 Plugin options 下点击 Daily notes。把 New file location 设为
Daily,把 Template file location 设为Templates/Daily。
第 5 步:添加三个命令
在 Claude Code 中,技能就是一个里面有 SKILL.md 文件的文件夹。把它放在库里的 .claude/skills/<name>/SKILL.md,它就成了一个 /name 命令。disable-model-invocation: true 这一行表示它只会在你输入时运行,Claude 不会自行启动它。
以点开头的文件夹是隐藏的,所以创建这些文件最简单的办法是请 Claude 来做。对下面每个文件,先粘贴提示词,紧接着粘贴文件内容:
Create .claude/skills/daily/SKILL.md with exactly the content below.
---
name: daily
description: Create or update today's daily note with a short plan from my open tasks, inbox and projects. Use when I type /daily or ask Claude to plan my day.
disable-model-invocation: true
---
# Plan my day
Extra context from me for today (may be empty): $ARGUMENTS
1. Work out today's date. Today's note is `Daily/YYYY-MM-DD.md`.
2. Read the last 3 notes in `Daily/`, every note in `Inbox/`, and every note in `Projects/`.
3. Collect open tasks (lines that start with `- [ ]`). Remember which note each one came from. Treat the same task in two notes as one task.
4. If today's note doesn't exist, create it from `Templates/Daily.md` and replace `{{date:YYYY-MM-DD}}` with today's date.
5. Add this section at the end of today's note. If a "## From Claude" section is already there, replace only that section.
## From Claude
**Top 3 today**
- [ ] task ([[source note]])
**Also open**
- task ([[source note]])
**Waiting in Inbox** (number of notes)
- [[note]]: one-line summary. Suggested home: Projects/ or Notes/
**Stuck**
- tasks that appear in daily notes from 3 or more days ago and are still open
6. Pick the top 3 by due dates mentioned in the notes first, then by what my extra context says.
7. Don't change any other note and don't move inbox notes. Only suggest.
8. Reply with the top 3 and the path of today's note.
$ARGUMENTS 会被替换成你在命令后面输入的任何内容。所以 /daily I only have the afternoon free 会把这句话传进去。
Create .claude/skills/weekly-review/SKILL.md with exactly the content below.
---
name: weekly-review
description: Write a weekly review note from the last 7 days of daily notes and recently changed notes. Use when I type /weekly-review or ask for my weekly review.
disable-model-invocation: true
---
# Weekly review
1. Work out this week's ISO week number. The review goes in `Reviews/YYYY-Www.md`. If it already exists, show me what you'd change and ask first.
2. Read every note in `Daily/` from the last 7 days, and every note in `Projects/`, `Notes/` and `Inbox/` changed in the last 7 days.
3. Write the review with these sections:
- **Done**: finished tasks (`- [x]`), with [[links]] to where they came from
- **Still open**: open tasks, oldest first
- **Themes**: 2–4 topics I kept coming back to, each with the notes that mention it
- **Decisions and commitments**: anything I agreed to, with who and when
- **Inbox**: how many notes are waiting, and a suggested home for each
- **Next week's top 3**: your suggestion, with one line on why
- **Questions for me**: up to 3 things only I can answer
4. Use only what's in my notes. If a section has nothing, write "Nothing this week."
5. Don't change any other note. Reply with the path of the review and the top 3.
Create .claude/skills/find-ideas/SKILL.md with exactly the content below.
---
name: find-ideas
description: Search my vault for notes related to a topic and suggest connections and new ideas. Use when I type /find-ideas followed by a topic.
disable-model-invocation: true
argument-hint: "[topic]"
---
# Find ideas about: $ARGUMENTS
1. If no topic was given, ask me for one and stop.
2. Search every note in the vault (not `.obsidian/` or `.claude/`) for the topic, similar words and related ideas. Read the notes that match.
3. Write a new note at `Inbox/Ideas - <topic> - YYYY-MM-DD.md` with:
- **Related notes**: each as a [[link]] with one line on how it relates
- **Connections**: 3–5 links between notes that I may not have noticed, each naming both notes
- **New ideas**: 3 ideas that combine what's in the notes. Mark each one as your suggestion.
- **Gaps**: questions my notes don't answer yet
4. Quote my notes only word for word. If you paraphrase, don't use quotation marks.
5. Then list [[links]] you'd add to existing notes, and ask me before adding any.
Claude Code 通常无需重启就能识别新技能。输入 / 可以在菜单里看到它们。如果缺少某个命令,请退出 Claude Code 后重新启动。
第 6 步:在 Claude 接触真实笔记之前先备份
任选其一:
- 复制。现在就把库文件夹压缩成 ZIP,之后每周再做一次。
- Git。Git 会保存每一次改动的历史,所以你可以只撤销其中一次。装好 Git 后,请 Claude 帮你设置:
Set up git in this vault so I can undo your changes. Add .obsidian/workspace.json and .obsidian/workspaces.json to .gitignore, then commit everything with the message "Before Claude".
Obsidian 的帮助文档建议忽略这两个工作区文件,因为每次打开笔记它们都会变。Obsidian 内置的 File recovery 插件也会保存笔记的快照。Obsidian 说它“不是完整的备份方案”,所以请把它和备份搭配使用,而不是用它代替备份。
第 7 步:用起来
/daily I only have the afternoon free
我们在 Claude Code 中,用一个虚构的小型库做了测试。测试库里有两条每日笔记、两条项目笔记和两条收集箱笔记。/daily 根据模板创建了 Daily/2026-10-19.md。它选出的 Top 3 把周三截止的任务排在最前,给每个任务都链接到了它来源的笔记,把出现在两条笔记里的“Book dentist”当作同一个任务,并且让其他所有笔记保持原样。我们的测试涵盖了设置提示词和 /daily。请先在已备份的库上运行 /weekly-review 和 /find-ideas,并仔细阅读它们写出的内容。
改用 Claude Desktop聊天
如果你更想聊天,而不用 Code 标签页,Filesystem MCP 服务器可以让 Claude Desktop访问你的库文件夹。不过,.claude/skills/ 中的技能是 Claude Code 的功能。在聊天里,你需要把这些步骤作为提示词粘贴进去。若要在 Customize > Skills 中把某个技能作为技能上传,请先删掉 disable-model-invocation 和 argument-hint 这两行,因为 claude.ai 会拒绝它们。Code 标签页则无需额外设置,就能让你用上本指南中的一切。
可能出什么问题
- Claude 改写了某条笔记。CLAUDE.md 的规矩会降低这种可能,但它们并不是锁。在桌面版中使用 Manual 权限模式,或在终端中保留默认的确认提示,这样每项改动发生前你都能看到。用 git 或你的副本来撤销。
- 链接失效。Claude 可能会链接到一条不存在的笔记。规矩禁止这样做,但还是要检查:如果你点击一个指向不存在笔记的链接,Obsidian 会新建一条空白笔记。
- 日期或周数不对。Claude 在运行时才会算出今天的日期。如果文件名看起来不对,告诉它,它会改正。
- 大型库消耗更多。每个命令都会读取笔记,有几千条笔记的库会消耗你更多的方案用量。如果累积起来太多,请让命令只针对特定的文件夹。
- 隐私。Claude 读取的笔记会被发送给 Anthropic 处理。请阅读 Claude Code 的数据使用页面,并检查你的模型训练设置。把非常私密的笔记放在一个你从不用 Claude 打开的单独的库里。
- 同步冲突。如果在 Claude 写入时 Obsidian Sync、iCloud 或 Dropbox 正在同步,你可能会得到冲突副本。运行命令之前,请先让同步完成。
做成你自己的
- 会议笔记。添加一个
/meeting技能,把粘贴的会议转录变成Notes/里的一条笔记,写明决定,并为每项行动生成一个- [ ]任务。 - 清空收集箱。添加一个
/sort-inbox技能,为每条收集箱笔记建议存放位置,只有在你说可以之后才移动它们。 - 读书笔记。添加一个
/book技能,把你的划线整理出来,并链接到相关笔记。 - 你自己的栏目。按你的喜好调整
/daily的栏目,例如“我一直在回避的一件事”或“今天的精力”。 - 每个库都能用。把技能文件夹移到
~/.claude/skills/,这些命令就能在你用 Claude Code 打开的任何文件夹里使用。
下一步
- 把你总在重新输入的提示词变成一键技能,学习如何编写和测试这类技能。
- 让 Claude 读取并更新你的 Notion:如果你的部分笔记存放在那里。
来源
- help.obsidian.md/vault(在新标签页中打开)
- help.obsidian.md/data-storage(在新标签页中打开)
- help.obsidian.md/plugins/daily-notes(在新标签页中打开)
- help.obsidian.md/plugins/templates(在新标签页中打开)
- help.obsidian.md/plugins/file-recovery(在新标签页中打开)
- obsidian.md/pricing(在新标签页中打开)
- code.claude.com/docs/en/setup(在新标签页中打开)
- code.claude.com/docs/en/memory(在新标签页中打开)
- code.claude.com/docs/en/skills(在新标签页中打开)
- code.claude.com/docs/en/desktop(在新标签页中打开)
- code.claude.com/docs/en/data-usage(在新标签页中打开)
相关指南
适合非开发者的最佳 MCP 服务器:先连接哪些
适合不写代码的人的最佳 MCP 服务器和连接器:邮件、日历、文件、笔记、会议、设计和自动化,附套餐、设置方法和安全须知。
入门挑选需要 10 分钟,每个连接器设置大约 5 分钟
Claude 技能 vs MCP vs 插件:你需要哪一个?
技能教 Claude 怎样完成任务,MCP 连接器让它触达你的应用和数据,插件把两者打包在一起。附决策表、套餐说明和一个实测示例。
入门做决定需要 10 分钟,动手示例大约 30 分钟
Claude Design 还是 Figma MCP:做 UI 该用哪一个
Claude Design 替你起草界面;Figma MCP 让 Claude 读取和编辑你的 Figma 文件。对比套餐、限制和交接方式,再把两者用在同一个工作流程里。
入门做决定需要 10 分钟,动手工作流程大约 30 分钟