Skip to content

hlibkoval/vault-code

 
 

Repository files navigation

Vault Code

Run Claude Code in your Obsidian sidebar with automatic Obsidian context sharing.

Vault Code

Features

  • Embedded terminal – Full terminal in your Obsidian sidebar
  • Auto-launches Claude - Claude Code starts automatically
  • Multiple tabs – Run multiple Claude instances side by side
  • Obsidian → Claude Code integration (optional) – Claude Code gets the current context from Obsidian (open file, selected lines) automatically over /ide MCP integration (inspired by Claude Code plugin for Intellij IDEA)
  • Continue the last conversation (optional) – continue working with Claude Code from where you left off automatically

Requirements

Installation

Quick Install (Mac/Linux)

In your vault folder, run:

curl -fsSL https://github.com/hlibkoval/vault-code/releases/latest/download/vault-code.tar.gz | tar -xzv -C .obsidian/plugins/

Then in Obsidian: Settings → Community Plugins → Enable "Vault Code"

Windows: See Windows Setup below.

Manual Installation

  1. Download vault-code.tar.gz from the latest release
  2. Extract to <your-vault>/.obsidian/plugins/
  3. Reload Obsidian and enable the plugin in Settings → Community Plugins

From Community Plugins

Once approved, you'll be able to search for "Vault Code" in Community Plugins → Browse.

Updating

In your vault folder, run:

curl -fsSL https://github.com/hlibkoval/vault-code/releases/latest/download/vault-code.tar.gz | tar -xzv -C .obsidian/plugins/

Then restart Obsidian or disable/re-enable the plugin.

Usage

demo.mp4
  • Click the bot icon in the left ribbon to open Claude
  • Use Command Palette (Cmd+P) for:
    • Open Claude Code - Open or focus Claude panel
    • New Claude Tab - Open additional Claude instance
    • Close Claude Tab - Close current Claude tab (when focused)
    • Toggle Focus: Editor ↔ Claude - Quick switch between editor and Claude
  • Press Shift+Enter for multi-line input
  • Set your own hotkeys in Settings → Hotkeys

Settings

Setting Description
Send Obsidian context to Claude Code Send current file and selection changes to Claude Code via IDE MCP integration (--ide flag). Enable "Send to Claude Code" context menu.
Continue the last conversation Pass --continue flag to the first started Claude Code, resuming the previous conversation.

Platform Support

Platform Status
macOS ✅ Supported
Linux ✅ Supported
Windows ⚠️ Experimental

Windows Setup (Experimental)

Windows requires additional dependencies:

  1. Install Python 3 from python.org
  2. Install pywinpty:
pip install pywinpty
  1. Install the plugin (run from your vault folder in PowerShell):
$u="https://github.com/hlibkoval/vault-code/archive/main.zip"; Invoke-WebRequest $u -OutFile s.zip; Expand-Archive s.zip .obsidian\plugins -Force; Move-Item ".obsidian\plugins\vault-code-main" ".obsidian\plugins\vault-code" -Force; Remove-Item s.zip

Note: Windows support is experimental. Performance may be slower than macOS/Linux due to ConPTY overhead.

How It Works

  • xterm.js for terminal emulation
  • Python's built-in pty module for pseudo-terminal support (macOS/Linux)
  • pywinpty for Windows PTY support
  • Symbols Nerd Font for terminal icons (MIT License, © Ryan L McIntyre)

Development

The PTY scripts (terminal_pty.py for Unix, terminal_win.py for Windows) are embedded as base64 in main.js for Obsidian plugin directory compatibility. To rebuild after modifying:

npm install
npm run build

Contributing

Issues and PRs welcome at github.com/hlibkoval/vault-code

Author

Fork maintained by Hlib Koval.

Originally built by Derek Larson.

License

MIT

About

Run Claude Code in Obsidian

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 93.9%
  • Python 4.2%
  • JavaScript 1.2%
  • CSS 0.7%