Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Claude Code Bridge

othnielsuothnielsu15 downloads

Bridge selected text to Claude Code CLI for real-time context sharing.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

English | 中文

An Obsidian plugin that bridges selected text to Claude Code CLI in real-time.

When you select text in Obsidian, the adjacent terminal running Claude Code automatically shows ⧉ Selected N lines from <file> and includes the selection as context — just like VS Code.

How It Works

The plugin mimics VS Code's IDE MCP server protocol:

  1. Starts a local WebSocket server on 127.0.0.1
  2. Writes a discovery lock file to ~/.claude/ide/{port}.lock
  3. Claude Code CLI auto-discovers and connects
  4. Selection changes are sent as JSON-RPC selection_changed notifications

Installation

Build from source

git clone https://github.com/othnielsu/obsidian-claude-code-bridge.git
cd obsidian-claude-code-bridge
npm install
npm run build

Install to Obsidian

VAULT="/path/to/your/vault"
mkdir -p "$VAULT/.obsidian/plugins/claude-code-bridge"
cp main.js manifest.json "$VAULT/.obsidian/plugins/claude-code-bridge/"

Then in Obsidian: Settings → Community Plugins → Reload → Enable "Claude Code Bridge"

Usage

  1. Enable the plugin in Obsidian
  2. Open a terminal in your vault directory
  3. Run claude
  4. Run /ide to connect to Obsidian
  5. Select text in Obsidian — Claude Code will show the selection

Important: Claude Code must be started from the vault directory for workspace matching to work.

Development

npm run dev        # Watch mode
npm run build      # Production build
npm test           # Run tests
npm run test:watch # Watch tests

Architecture

┌─────────────────────┐       WebSocket (JSON-RPC 2.0)       ┌──────────────┐
│  Obsidian Plugin    │ ◄──────────────────────────────────► │  Claude Code │
│                     │                                       │  CLI         │
│  - Selection Listener                                      │              │
│  - WS Server (:port)│       Lock file auto-discovery       │  Auto-detect │
│  - Lock file writer │ ────────────────────────────────────► │  & connect   │
└─────────────────────┘   ~/.claude/ide/{port}.lock           └──────────────┘
Component File Responsibility
Server src/server.ts WebSocket + MCP protocol handshake
Lock File src/lockfile.ts Discovery file management
Selection src/selection.ts Debounced selection change detection
Main src/main.ts Plugin lifecycle wiring

License

MIT

91%
HealthExcellent
ReviewSatisfactory
About
Bridge selected text from Obsidian to Claude Code CLI in real time, mirroring selections as "Selected N lines from <file>" in the adjacent Claude terminal just like VS Code. Start a local WebSocket server and write a discovery lock file so Claude Code auto-discovers and receives JSON-RPC selection_changed notifications.
IntegrationsAI
Details
Current version
0.1.0
Last updated
4 days ago
Created
4 days ago
Updates
1 release
Downloads
15
Compatible with
Obsidian 1.5.0+
Platforms
Desktop only
License
MIT
Report bugRequest featureReport plugin
Author
othnielsuothnielsuradical7vii
GitHubradical7vii
  1. Community
  2. Plugins
  3. Integrations
  4. Claude Code Bridge

Related plugins

Agent Client

Chat with Claude Code, Codex, Gemini CLI, and more via the Agent Client Protocol — right from your vault.

Smart Composer

AI chat with note context, smart writing assistance, and one-click edits for your vault.

Snipd Official

Sync Snipd podcast highlights to your vault with transcript, notes, AI summaries and metadata.

BMO Chatbot

Generate and brainstorm ideas while creating your notes using Large Language Models (LLMs) such as OpenAI's "gpt-3.5-turbo" and "gpt-4".

Claude Code IDE

Connect your vault to Claude Code and share editor context with the CLI.

Local REST API with MCP

Unlock your automation needs by interacting with your notes over a secure REST API.

Copilot

Your AI Copilot: Chat with Your Second Brain, Learn Faster, Work Smarter.

Claudian

Embeds Claude Code/Codex as an AI collaborator in your vault. Your vault becomes agent's working directory, giving it full agentic capabilities: file read/write, search, bash commands, and multi-step workflows.

BRAT

Easily install a beta version of a plugin for testing.

Maps

Adds a map layout to bases so you can display notes as an interactive map view.