Embed Claude Code as an interactive terminal right in Obsidian's sidebar. Open it with a hotkey, send your note selections to Claude, and toggle focus between editor and terminal without leaving Obsidian.
- Sidebar terminal — Claude Code runs in the right sidebar via xterm.js + node-pty
- Multi-tab support — Open multiple Claude Code terminals simultaneously
- Automatic workspace context — Claude Code automatically knows which notes are open and which one is active, without you having to tell it
- MCP context server — Built-in MCP server exposes tools so Claude can read your open notes, search the vault, and fetch any note on demand
- Cmd/Ctrl+click vault notes — Click any vault path or
obsidian://openURL Claude prints in the terminal to open the corresponding note in Obsidian - Send selection — Select text in a note, run a command, and it appears in Claude's input with file path and line numbers
- Send current file — Send the active file's path to Claude with one command
- Focus toggle — Switch between editor and terminal without touching the mouse
- Theme sync — Terminal colors automatically match your Obsidian theme (dark/light)
- Configurable — Claude CLI path, font size, font family, extra CLI args, working directory override
- Claude Code CLI installed and available in your PATH
- Obsidian 1.5.0+ (desktop only, not available on mobile)
- Install the BRAT plugin
- Open BRAT settings and click "Add Beta Plugin"
- Enter
ErickRyu/obsidian-claude-code - Enable the plugin in Community Plugins settings
The plugin will automatically download the required native module (node-pty) for your platform on first launch.
- Download
main.js,manifest.json, andstyles.cssfrom the latest release - Create a folder
.obsidian/plugins/obsidian-claude-code/in your vault - Copy the downloaded files into that folder
- Enable the plugin in Obsidian settings
The plugin will attempt to download the node-pty native binary automatically. If auto-download fails, download the appropriate node-pty-{platform}.tar.gz from the release page and extract it into the plugin folder.
git clone https://github.com/ErickRyu/obsidian-claude-code.git
cd obsidian-claude-code
npm install
npm run buildCopy main.js, manifest.json, styles.css, and node_modules/node-pty/ to your vault's .obsidian/plugins/obsidian-claude-code/ directory.
| Command | Description |
|---|---|
| Toggle Claude Code terminal | Open/close the active terminal |
| New Claude Code terminal | Open an additional terminal tab |
| Send selection to Claude | Send selected text with file context to Claude |
| Send current file to Claude | Send @filepath to Claude |
| Focus Claude Code terminal | Toggle focus between editor and terminal |
Set hotkeys in Settings > Hotkeys. Recommended: Cmd+2 for toggle.
- Claude CLI path — Default:
claude. Change if installed elsewhere. - Font size — Terminal font size (default: 14)
- Font family — Terminal font (default: system monospace)
- Extra CLI arguments — Additional args passed to Claude CLI (e.g.,
--model sonnet) - Working directory — Override the working directory (default: vault root)
- MCP context server — Enable the built-in MCP server so Claude can access open notes, active file, and vault search (default: on). Requires terminal restart after toggling.
The plugin spawns Claude Code CLI in a pseudo-terminal (PTY) using node-pty, renders it with xterm.js in an Obsidian sidebar view. Editor integration commands inject text into the terminal input buffer (paste-only, no auto-submit). A terminal state machine (closed/opening/ready/exited) ensures commands wait for the PTY to be ready before sending text.
On load, the plugin starts a lightweight MCP (Model Context Protocol) server that exposes Obsidian's workspace state to Claude Code. It does two things:
- System prompt injection — A short prompt file listing currently open notes and the active note is auto-generated and passed to Claude via
--append-system-prompt-file. Claude always knows which notes you have open without you telling it. - MCP tools — Claude can call
get_active_note,list_open_notes,read_note, andsearch_noteson demand to fetch note content or search the vault.
The plugin writes .mcp.json and .claude/settings.local.json in your vault on load so Claude Code auto-discovers the server and pre-approves the tools (no per-call permission prompts). These are cleaned up when the plugin is disabled.
- Desktop only — requires node-pty (native module), does not work on mobile
- No inline diffs — Obsidian API does not support inline diff views
- Native module build — node-pty must be compiled for your Obsidian's Electron version
MIT