Skip to content

patrick-yip/obsidian-claude-ide-bridge

Repository files navigation

obsidian-claude-ide-bridge

Let Claude Code see what you see in Obsidian. You edit, Claude follows along.

An Obsidian plugin that implements the Claude Code IDE protocol. When active, Claude Code lists "Obsidian" as a selectable IDE, just like VS Code or JetBrains.

demo.mp4

The problem

Claude Code has deep IDE integration with VS Code and JetBrains. It knows what file you have open, what text you selected, what diagnostics the editor reports. It uses this context to give better answers.

Obsidian is not natively supported. Existing plugins either embed Claude inside Obsidian (chat sidebar) or expose vault files via MCP (read-only, no live editor state). Neither gives Claude Code the real-time, bidirectional context that VS Code and JetBrains get out of the box.

This matters more than it sounds. Andrej Karpathy wrote about building personal knowledge bases with LLMs where LLMs build and maintain a persistent wiki rather than rediscovering knowledge on every query. An Obsidian vault is already this: notes are the wiki, frontmatter is the schema, CLAUDE.md is the config. What's missing is the bridge.

The approach

This plugin is that bridge. It starts a local WebSocket server that speaks Claude Code's native MCP protocol. It writes a lockfile to ~/.claude/ide/, and Claude Code discovers it automatically. No config, no copy-pasting context, no extra commands.

Claude Code CLI
    ↕ WebSocket (MCP, JSON-RPC 2.0, localhost only)
Obsidian Plugin (MCP Server)
    ↕ Obsidian Plugin API + CodeMirror 6
Your vault

What Claude Code sees

When connected, Claude Code natively knows:

  • Which document you have open and which tabs are active
  • The lines you selected, whether it's a single word or a multi-line block
  • Frontmatter properties, even in Live Preview mode where they render as input widgets
  • Table content selected inside rendered tables
  • Your vault's knowledge graph: frontmatter metadata, backlinks, tags, and outgoing links
  • Search results across your entire vault by filename

Claude Code can also open a specific note in Obsidian by path.

How selection works in Live Preview

Obsidian's Live Preview mode renders frontmatter as a Properties widget and tables as HTML. These live outside the CodeMirror document, so normal editor selection APIs return empty. The plugin handles this with a layered fallback:

  1. CodeMirror 6 editor selection (Source mode and body text in Live Preview)
  2. Input element selection (frontmatter Properties widget)
  3. DOM text selection (rendered tables and other widgets)

When a widget selection is detected, the plugin searches the raw file content to recover the actual line number and tags it with context: "frontmatter" or context: "table-or-widget".

Install

BRAT (recommended for beta)

  1. Install BRAT in Obsidian
  2. Add beta plugin: patrick-yip/obsidian-claude-ide-bridge
  3. Enable "Claude Code IDE Bridge" in Settings > Community plugins

Manual

cd /path/to/your/vault/.obsidian/plugins
git clone https://github.com/patrick-yip/obsidian-claude-ide-bridge
cd obsidian-claude-ide-bridge && npm install && npm run build

Enable the plugin in Obsidian settings.

Usage

  1. Open your vault in Obsidian (status bar shows "Claude IDE: listening")
  2. In your terminal:
cd /path/to/your/vault
claude
  1. Claude Code connects automatically. Select text in a note; Claude sees it as context.

Contributing

  1. Open an issue before starting a PR
  2. npm run dev for watch mode
  3. Enable debug logging in plugin settings to see MCP protocol messages

License

MIT © 2026 Patrick Yip

About

Let Claude Code see what you see in Obsidian. An Obsidian plugin that implements the Claude Code IDE protocol.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors