Obsidian Integration
Obsidian 集成
Expert guidance for integrating Claude workflows with Obsidian vault, including note creation, task management, and knowledge organization using Obsidian's markdown-based system.
本指南提供将Claude工作流与Obsidian知识库集成的专业指导,包括使用Obsidian的Markdown系统创建笔记、管理任务和组织知识。
When to Use This Skill
何时使用该技能
- Creating notes during development sessions with Claude
- Tracking tasks and TODOs in Obsidian
- Documenting decisions and solutions discovered with Claude
- Building a knowledge base of project insights
- Organizing research findings from Claude sessions
- Creating meeting notes or session summaries
- 在与Claude协作的开发会话中创建笔记
- 在Obsidian中追踪任务和待办事项
- 记录与Claude协作时做出的决策和找到的解决方案
- 构建项目洞察知识库
- 整理Claude会话中的研究成果
- 创建会议笔记或会话摘要
- Vault Location - Use environment variable for vault path
- Atomic Notes - Each note focuses on a single concept or topic
- Linking - Use wikilinks to connect related ideas
- Tags - Organize with hierarchical tags like
- Tasks - Use checkbox syntax for actionable items
- Timestamps - Include dates for temporal context
- 知识库位置 - 使用环境变量指定知识库路径
- 原子化笔记 - 每条笔记聚焦单个概念或主题
- 链接 - 使用维基链接关联相关想法
- 标签 - 使用层级标签如进行组织
- 任务 - 使用复选框语法标记可执行项
- 时间戳 - 包含日期以体现时间上下文
The Obsidian vault location is stored in the
environment variable:
Check vault location
检查知识库位置
Should return something like:
应返回类似内容:
/Users/username/Documents/ObsidianVault
/Users/username/Documents/ObsidianVault
If not set, you'll need to configure it in your shell profile:
```bash
如果未设置该变量,需在Shell配置文件中进行配置:
```bash
Add to ~/.zshrc or ~/.bashrc
添加到~/.zshrc或~/.bashrc
export OBSIDIAN_CLAUDE="/path/to/your/vault"
export OBSIDIAN_CLAUDE="/path/to/your/vault"
Obsidian Markdown Syntax
Obsidian Markdown语法
Wikilinks (Internal Links)
维基链接(内部链接)
Link to another note
链接到另一篇笔记
Link with custom display text
带自定义显示文本的链接
[[Note Name|Display Text]]
[[Note Name|Display Text]]
Link to heading in another note
链接到另一篇笔记的标题
#project/feature
#status/in-progress
#type/note
#type/task
#project/feature
#status/in-progress
#type/note
#type/task
Tags in YAML frontmatter
YAML前置元数据中的标签
tags:
- project/feature
- status/active
tags:
- project/feature
- status/active
Task with priority
带优先级的任务
Task with date (if using Obsidian Tasks plugin)
带日期的任务(需使用Obsidian Tasks插件)
Task with metadata
带元数据的任务
Callouts (Obsidian-specific)
提示框(Obsidian专属)
markdown
> [!note]
> This is a note callout
> [!tip]
> Helpful tip here
> [!warning]
> Important warning
> [!todo]
> Task to complete
> [!example]
> Example code or content
> [!quote]
> Quote or citation
markdown
> [!note]
> 这是一条提示笔记
> [!tip]
> 实用技巧
> [!warning]
> 重要警告
> [!todo]
> 待完成任务
> [!example]
> 示例代码或内容
> [!quote]
> 引用或引文
Session Note Template
会话笔记模板
markdown
---
date: {{date}}
type: session-note
tags:
- claude-session
- project/{{project-name}}
---
markdown
---
date: {{date}}
type: session-note
tags:
- claude-session
- project/{{project-name}}
---
Session: {{topic}} - {{date}}
会话:{{topic}} - {{date}}
What we're working on and why
Key points and outcomes from this session
- [[Related Note 1]]
- [[Related Note 2]]
- - Description of code location
Session with: Claude
Duration: {{duration}}
会话对象:Claude
时长:{{duration}}
Technical Note Template
技术笔记模板
markdown
---
date: {{date}}
type: technical-note
tags:
- technical
- {{topic}}
---
markdown
---
date: {{date}}
type: technical-note
tags:
- technical
- {{topic}}
---
Description of the issue or topic
How it was resolved or implemented
Implementation Details
实现细节
- [[Concept 1]]
- [[Concept 2]]
- External links or documentation
Additional thoughts or considerations
markdown
---
date: {{date}}
type: task
tags:
- task
- status/pending
project: {{project-name}}
---
markdown
---
date: {{date}}
type: task
tags:
- task
- status/pending
project: {{project-name}}
---
Task: {{task-name}}
任务:{{task-name}}
- Requirement 1
- Requirement 2
- [[Related Task 1]]
- [[Related Task 2]]
Additional context or considerations
Status: Pending
Priority: Medium
Due: {{date}}
状态:待处理
优先级:中等
截止日期:{{date}}
Working with Claude: Common Patterns
与Claude协作的常见模式
Pattern 1: Creating a Session Note
模式1:创建会话笔记
When starting a work session with Claude:
Create new session note in Obsidian vault
在Obsidian知识库中创建新的会话笔记
cat > "$OBSIDIAN_CLAUDE/Sessions/$(date +%Y-%m-%d)-session.md" <<EOF
date: $(date +%Y-%m-%d)
type: session-note
tags:
cat > "$OBSIDIAN_CLAUDE/Sessions/$(date +%Y-%m-%d)-session.md" <<EOF
date: $(date +%Y-%m-%d)
type: session-note
tags:
Session: $(date +%Y-%m-%d)
会话:$(date +%Y-%m-%d)
Pattern 2: Adding Quick Notes
模式2:添加快速笔记
For quick insights during development:
Append to daily note
追加到每日笔记
echo "## $(date +%H:%M) - Quick Note
Content here
" >> "$OBSIDIAN_CLAUDE/Daily/$(date +%Y-%m-%d).md"
echo "## $(date +%H:%M) - 快速笔记
内容
" >> "$OBSIDIAN_CLAUDE/Daily/$(date +%Y-%m-%d).md"
Pattern 3: Creating Task from Claude Session
模式3:从Claude会话创建任务
TASK_NAME="implement-feature-x"
cat > "$OBSIDIAN_CLAUDE/Tasks/$TASK_NAME.md" <<EOF
date: $(date +%Y-%m-%d)
type: task
tags:
TASK_NAME="implement-feature-x"
cat > "$OBSIDIAN_CLAUDE/Tasks/$TASK_NAME.md" <<EOF
date: $(date +%Y-%m-%d)
type: task
tags:
Task: $TASK_NAME
任务:$TASK_NAME
Claude session on $(date +%Y-%m-%d)
EOF
Claude会话 $(date +%Y-%m-%d)
EOF
Pattern 4: Documenting Code Solutions
模式4:记录代码解决方案
Create solution note
创建解决方案笔记
SOLUTION_NAME="fix-api-error"
cat > "$OBSIDIAN_CLAUDE/Solutions/$SOLUTION_NAME.md" <<EOF
date: $(date +%Y-%m-%d)
type: solution
tags:
SOLUTION_NAME="fix-api-error"
cat > "$OBSIDIAN_CLAUDE/Solutions/$SOLUTION_NAME.md" <<EOF
date: $(date +%Y-%m-%d)
type: solution
tags:
Solution: $SOLUTION_NAME
解决方案:$SOLUTION_NAME
```language
code here
```
Folder Organization for Claude Integration
Claude集成的文件夹组织
Recommended folder structure within Obsidian vault:
$OBSIDIAN_CLAUDE/
├── Daily/ # Daily notes
│ └── YYYY-MM-DD.md
├── Sessions/ # Claude session notes
│ └── YYYY-MM-DD-topic.md
├── Tasks/ # Task tracking
│ ├── active/
│ └── completed/
├── Projects/ # Project documentation
│ └── project-name/
│ ├── index.md
│ ├── architecture.md
│ └── decisions.md
├── Solutions/ # Code solutions and fixes
│ └── solution-name.md
├── Research/ # Research notes
│ └── topic.md
├── Knowledge/ # Permanent notes
│ └── concept.md
└── Templates/ # Note templates
├── session.md
├── task.md
└── solution.md
Obsidian知识库内推荐的文件夹结构:
$OBSIDIAN_CLAUDE/
├── Daily/ # 每日笔记
│ └── YYYY-MM-DD.md
├── Sessions/ # Claude会话笔记
│ └── YYYY-MM-DD-topic.md
├── Tasks/ # 任务追踪
│ ├── active/
│ └── completed/
├── Projects/ # 项目文档
│ └── project-name/
│ ├── index.md
│ ├── architecture.md
│ └── decisions.md
├── Solutions/ # 代码解决方案与修复
│ └── solution-name.md
├── Research/ # 研究笔记
│ └── topic.md
├── Knowledge/ # 永久笔记
│ └── concept.md
└── Templates/ # 笔记模板
├── session.md
├── task.md
└── solution.md
Helper Functions for Obsidian Integration
Obsidian集成的辅助函数
Bash Helper Functions
Bash辅助函数
Add these to your shell profile for easy integration:
将以下函数添加到你的Shell配置文件中,以便快速集成:
Create new session note in Obsidian
在Obsidian中创建新的会话笔记
obs-session() {
local topic="${1:-general}"
local date=$(date +%Y-%m-%d)
local file="$OBSIDIAN_CLAUDE/Sessions/${date}-${topic}.md"
date: $date
type: session-note
tags:
- claude-session
- project/$topic
obs-session() {
local topic="${1:-general}"
local date=$(date +%Y-%m-%d)
local file="$OBSIDIAN_CLAUDE/Sessions/${date}-${topic}.md"
date: $date
type: session-note
tags:
- claude-session
- project/$topic
Session: $topic - $date
会话:$topic - $date
EOF
echo "Created session note: $file"
}
Create task in Obsidian
在Obsidian中创建任务
obs-task() {
local task_name="$1"
local date=$(date +%Y-%m-%d)
local file="$OBSIDIAN_CLAUDE/Tasks/${task_name}.md"
date: $date
type: task
tags:
obs-task() {
local task_name="$1"
local date=$(date +%Y-%m-%d)
local file="$OBSIDIAN_CLAUDE/Tasks/${task_name}.md"
date: $date
type: task
tags:
Task: $task_name
任务:$task_name
$date via Claude session
EOF
echo "Created task: $file"
}
Append to daily note
追加到每日笔记
obs-note() {
local date=$(date +%Y-%m-%d)
local time=$(date +%H:%M)
local daily_note="$OBSIDIAN_CLAUDE/Daily/${date}.md"
# Create daily note if doesn't exist
if [ ! -f "$daily_note" ]; then
cat > "$daily_note" <<EOF
date: $date
type: daily-note
obs-note() {
local date=$(date +%Y-%m-%d)
local time=$(date +%H:%M)
local daily_note="$OBSIDIAN_CLAUDE/Daily/${date}.md"
# 如果每日笔记不存在则创建
if [ ! -f "$daily_note" ]; then
cat > "$daily_note" <<EOF
date: $date
type: daily-note
EOF
fi
# Append note
cat >> "$daily_note" <<EOF
EOF
fi
# 追加笔记内容
cat >> "$daily_note" <<EOF
EOF
echo "Added entry to daily note: $daily_note"
}
EOF
echo "已添加内容到每日笔记:$daily_note"
}
Quick search in Obsidian vault
在Obsidian知识库中快速搜索
obs-search() {
grep -r "$1" "$OBSIDIAN_CLAUDE" --include="*.md"
}
obs-search() {
grep -r "$1" "$OBSIDIAN_CLAUDE" --include="*.md"
}
Integration Workflow with Claude
与Claude的集成工作流
-
Set up environment
bash
echo $OBSIDIAN_CLAUDE # Verify vault location
-
Create session note (optional)
bash
obs-session "feature-implementation"
-
设置环境
bash
echo $OBSIDIAN_CLAUDE # 验证知识库位置
-
创建会话笔记(可选)
bash
obs-session "feature-implementation"
-
Add notes as you go
- Use Claude to create notes for important insights
- Document decisions and reasoning
- Track code locations with references
-
Create tasks for follow-ups
bash
obs-task "refactor-authentication"
-
Link to existing notes
- Reference related documentation
- Build knowledge graph through links
-
随时添加笔记
- 使用Claude记录重要见解
- 记录决策和推理过程
- 使用格式标记代码位置
-
为后续工作创建任务
bash
obs-task "refactor-authentication"
-
关联现有笔记
-
Review and organize
- Add tags to notes
- Create links between related notes
- Update project index
-
Update task status
- Mark completed tasks
- Add new discovered tasks
-
Archive session notes
- Move to appropriate project folder if needed
- Link from project index
-
回顾与整理
- 为笔记添加标签
- 在相关笔记间创建链接
- 更新项目索引
-
更新任务状态
-
归档会话笔记
- 如有需要,移动到对应项目文件夹
- 在项目索引中添加链接
DO:
- ✅ Create notes during the session, not after
- ✅ Use descriptive file names (kebab-case)
- ✅ Include YAML frontmatter with metadata
- ✅ Link to related notes and concepts
- ✅ Add relevant tags for organization
- ✅ Include timestamps for temporal context
DON'T:
- ❌ Create huge monolithic notes
- ❌ Forget to link related concepts
- ❌ Skip metadata and tags
- ❌ Use unclear or generic titles
- ❌ Duplicate information across notes
建议:
- ✅ 在会话过程中创建笔记,而非事后补充
- ✅ 使用描述性文件名(短横线分隔格式)
- ✅ 包含YAML前置元数据
- ✅ 关联相关笔记和概念
- ✅ 添加相关标签用于组织
- ✅ 包含时间戳体现时间上下文
避免:
- ❌ 创建冗长的单体笔记
- ❌ 忘记关联相关概念
- ❌ 忽略元数据和标签
- ❌ 使用模糊或通用标题
- ❌ 在多个笔记中重复信息
DO:
- ✅ Use checkbox syntax for tasks
- ✅ Add priority indicators
- ✅ Link tasks to relevant notes
- ✅ Include context in task description
- ✅ Break down large tasks into subtasks
DON'T:
- ❌ Create tasks without context
- ❌ Leave tasks orphaned (unlinked)
- ❌ Forget to update task status
- ❌ Mix tasks and notes in disorganized way
建议:
- ✅ 使用复选框语法标记任务
- ✅ 添加优先级标识
- ✅ 将任务与相关笔记关联
- ✅ 在任务描述中包含上下文
- ✅ 将大型任务拆分为子任务
避免:
- ❌ 创建无上下文的任务
- ❌ 孤立任务(不添加链接)
- ❌ 忘记更新任务状态
- ❌ 混乱地混合任务和笔记
DO:
- ✅ Use wikilinks liberally
- ✅ Create hierarchical tags
- ✅ Link bidirectionally when relevant
- ✅ Tag by type, status, and project
- ✅ Build a web of knowledge
DON'T:
- ❌ Over-tag (diminishing returns)
- ❌ Use inconsistent tag hierarchies
- ❌ Create links without purpose
- ❌ Forget to use tag search features
建议:
- ✅ 大量使用维基链接
- ✅ 创建层级标签
- ✅ 在相关内容间创建双向链接
- ✅ 按类型、状态和项目添加标签
- ✅ 构建互联的知识网络
避免:
- ❌ 过度添加标签(收益递减)
- ❌ 使用不一致的标签层级
- ❌ 创建无意义的链接
- ❌ 忽略标签搜索功能
Obsidian Plugins for Claude Integration
用于Claude集成的Obsidian插件
- Templater - Advanced templates with dynamic content
- Dataview - Query and display notes dynamically
- Tasks - Enhanced task management
- Calendar - Visual daily note navigation
- Git - Version control for vault (if using)
- Quick Add - Rapid note creation with macros
- Templater - 支持动态内容的高级模板插件
- Dataview - 动态查询和展示笔记
- Tasks - 增强型任务管理插件
- Calendar - 可视化每日笔记导航
- Git - 知识库版本控制(如需使用)
- Quick Add - 通过宏快速创建笔记
Dataview Examples for Claude Sessions
用于Claude会话的Dataview示例
Recent Claude sessions
近期Claude会话
TABLE date, summary
FROM #claude-session
SORT date DESC
LIMIT 10
TABLE date, summary
FROM #claude-session
SORT date DESC
LIMIT 10
Pending tasks from sessions
会话中的待处理任务
TASK
FROM #claude-session
WHERE !completed
TASK
FROM #claude-session
WHERE !completed
Issue 1: $OBSIDIAN_CLAUDE not set
问题1:$OBSIDIAN_CLAUDE未设置
Problem: Environment variable not defined
Solution:
Add to shell profile
添加到Shell配置文件
echo 'export OBSIDIAN_CLAUDE="/path/to/vault"' >> ~/.zshrc
source ~/.zshrc
echo 'export OBSIDIAN_CLAUDE="/path/to/vault"' >> ~/.zshrc
source ~/.zshrc
Issue 2: Note not appearing in Obsidian
问题2:笔记未在Obsidian中显示
Problem: File created but not visible
Solution:
- Ensure file has extension
- Check file permissions
- Verify path is within vault
- Refresh Obsidian file list
问题:已创建文件但不可见
解决方案:
- 确保文件具有扩展名
- 检查文件权限
- 验证路径是否在知识库范围内
- 刷新Obsidian文件列表
Issue 3: Links not working
问题3:链接无法正常工作
Problem: Wikilinks don't navigate correctly
Solution:
- Ensure exact note name match (case-sensitive)
- Check for file extension in link (shouldn't include )
- Verify linked note exists
- Use Obsidian's link autocomplete
问题:维基链接无法正确跳转
解决方案:
- 确保笔记名称完全匹配(区分大小写)
- 检查链接中是否包含文件扩展名(不应包含)
- 验证被链接的笔记是否存在
- 使用Obsidian的链接自动完成功能
Issue 4: Frontmatter rendering in preview
快速参考
Problem: YAML frontmatter shows as text
Solution:
- Ensure frontmatter is first thing in file
- Use proper YAML syntax (three dashes before and after)
- Check for trailing spaces
Creating Notes with Claude
cat > "$OBSIDIAN_CLAUDE/Sessions/$(date +%Y-%m-%d)-topic.md" <<'EOF'
date: 2026-01-23
type: session-note
tags: [claude-session]
cat > "$OBSIDIAN_CLAUDE/Sessions/$(date +%Y-%m-%d)-topic.md" <<'EOF'
date: 2026-01-23
type: session-note
tags: [claude-session]
cat > "$OBSIDIAN_CLAUDE/Tasks/task-name.md" <<'EOF'
date: 2026-01-23
type: task
tags: [task, status/pending]
cat > "$OBSIDIAN_CLAUDE/Tasks/task-name.md" <<'EOF'
date: 2026-01-23
type: task
tags: [task, status/pending]
echo "## 笔记
内容" >> "$OBSIDIAN_CLAUDE/Daily/$(date +%Y-%m-%d).md"
Quick append to daily
核心Obsidian语法
echo "## Note
Content" >> "$OBSIDIAN_CLAUDE/Daily/$(date +%Y-%m-%d).md"
Essential Obsidian Syntax
维基链接
[[笔记名称]]
[[笔记#标题]]
[[笔记|显示文本]]
[[Note Name]]
[[Note#Heading]]
[[Note|Display Text]]
^block-id
[[笔记#^block-id]]
^block-id
[[Note#^block-id]]
本技能可与以下技能配合使用:
- folder-organization - 知识库结构标准
- managing-environments - 开发工作流
- claude-collaboration - 团队知识共享
Integration with Other Skills
参考资料与资源
This skill works well with:
- folder-organization - Vault structure standards
- managing-environments - Development workflow
- claude-collaboration - Team knowledge sharing
记住:我们的目标是构建一个可搜索、互联的知识库,使其随每次Claude会话不断成长。从简单开始,根据需要逐步添加结构。
Remember: The goal is to build a searchable, linked knowledge base that grows with each Claude session. Start simple, add structure as needed.