Co-Pilot / 辅助式
更新于 24 days ago

obsidian-claude-code

RRoasbeef
0.2k
roasbeef/obsidian-claude-code
80
Agent 评分

💡 摘要

一个将Claude集成到Obsidian中的插件,用于笔记管理和交互。

🎯 适合人群

希望增强笔记管理的Obsidian用户希望将AI集成到工作流程中的开发者需要帮助总结笔记的学生寻求高效文件操作的内容创作者需要快速访问信息的研究人员

🤖 AI 吐槽:看起来很能打,但别让配置把人劝退。

安全分析中风险

风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);API Key/Token 的获取、存储与泄露风险;文件读写范围与路径穿越风险。以最小权限运行,并在生产环境启用前审计代码与依赖。

obsidian-claude-code

An Obsidian plugin that embeds Claude as an AI assistant using the Claude Agent SDK. Claude gets full access to your vault through the same tools available in Claude Code—read, write, search, and execute commands—plus custom Obsidian-specific actions.

Chat interface showing Claude searching vault

What It Does

Claude operates as a persistent assistant in your Obsidian sidebar. Ask questions about your notes, request summaries, or have Claude modify files directly. Conversations persist across sessions, and Claude can resume where you left off.

Built on the Claude Agent SDK, the plugin gives Claude access to built-in tools (Read, Write, Edit, Bash, Grep, Glob, WebFetch) plus Obsidian-specific tools for opening files, executing commands, and navigating the workspace. If you have skills defined in vault/.claude/skills/, those load automatically too.

This is a desktop-only plugin. The Claude Agent SDK requires Node.js, which is available in Obsidian's Electron environment but not on mobile.

Requirements

You need an Anthropic API key or a Claude Max subscription. Both work equally well—the subscription option is convenient if you're already paying for Claude.

Installation

cd /path/to/your/vault/.obsidian/plugins git clone https://github.com/Roasbeef/obsidian-claude-code cd obsidian-claude-code bun install && bun run build

Then enable the plugin: Obsidian Settings → Community Plugins → obsidian-claude-code.

Authentication

The plugin supports three authentication methods.

API Key in Settings. The simplest option. Open Settings → Claude Code and enter your Anthropic API key. The key is stored locally in Obsidian's plugin data directory.

Environment Variable. Set ANTHROPIC_API_KEY in your shell environment. The plugin reads it automatically.

Claude Max Subscription. If you have a Claude Pro or Max subscription, you can use that instead of an API key. Run claude setup-token in your terminal to authenticate. This creates a CLAUDE_CODE_OAUTH_TOKEN that the plugin detects.

For GUI apps like Obsidian to inherit the token on macOS, add this to your shell profile:

launchctl setenv CLAUDE_CODE_OAUTH_TOKEN "$(echo $CLAUDE_CODE_OAUTH_TOKEN)"

The settings page shows which authentication method is active.

Usage

Toggle the sidebar with the ribbon icon or Cmd+Shift+C. Type your message and press Enter.

Reference specific files using @[[filename]] syntax—the input field provides autocomplete when you type @. Type / for slash commands: /new starts a fresh conversation, /clear clears history, /file adds the active file to context.

When Claude uses tools, the operations appear as collapsible blocks showing what happened and the result. Write operations display a permission modal unless you've enabled auto-approve in settings.

Tools and Skills

Claude has access to all built-in Claude Code tools: Read, Write, Edit, Bash, Grep, Glob, WebFetch, and WebSearch. These handle file operations, code search, and shell commands.

The plugin also exposes Obsidian-specific tools through an MCP server:

  • open_file — Open a file in the Obsidian editor
  • execute_command — Run any Obsidian command
  • show_notice — Display a notification
  • get_active_file — Get info about the current file
  • list_commands — Discover available commands
  • create_note — Create new notes
  • reveal_in_explorer — Show a file in the file explorer
  • get_vault_stats — Query vault statistics
  • get_recent_files — List recently modified files

Skills

Skills in vault/.claude/skills/ load automatically. The repository includes a vault-search skill you can copy to your vault:

cp -r skills/vault-search /path/to/vault/.claude/skills/

This skill provides semantic search via sqlite-vec embeddings and SQL queries over note frontmatter (a Dataview alternative). See skills/README.md for setup instructions.

See docs/architecture.md for full architectural details.

Data Storage

Conversations are stored in .obsidian-claude-code/ at your vault root:

.obsidian-claude-code/
├── conversations.json    # Metadata index
└── history/
    └── {id}.json         # Full message history per conversation

Add this directory to .gitignore if you don't want to sync conversation history.

Development

bun run dev # watch mode with rebuild bun run build # production build make check # typecheck + lint + test

Debug logs are written to ~/.obsidian-claude-code/debug.log.

License

MIT

五维分析
清晰度8/10
创新性8/10
实用性9/10
完整性8/10
可维护性7/10
优缺点分析

优点

  • 与Obsidian无缝集成
  • 持久的对话历史
  • 访问各种内置工具
  • 可定制的技能以增强功能

缺点

  • 仅限桌面插件,限制可访问性
  • 需要API密钥或订阅
  • 数据存储可能存在隐私问题
  • 对外部SDK的依赖可能引入问题

相关技能

pytorch

S
toolCode Lib / 代码库
92/ 100

“它是深度学习的瑞士军刀,但祝你好运能从47种安装方法里找到那个不会搞崩你系统的那一个。”

agno

S
toolCode Lib / 代码库
90/ 100

“它承诺成为智能体领域的Kubernetes,但得看开发者有没有耐心学习又一个编排层。”

nuxt-skills

S
toolCo-Pilot / 辅助式
90/ 100

“这本质上是一份组织良好的小抄,能把你的 AI 助手变成一只 Nuxt 框架的复读机。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 Roasbeef.