Obsidian Plugin
Run DorkOS inside Obsidian as a sidebar plugin
Obsidian Plugin
DorkOS runs as a sidebar plugin inside Obsidian — your coding agent available directly inside your thinking environment, with no context switch to a terminal.
What You Get
- Active file tracking — the currently open file is automatically included as context
- Drag-and-drop — drag files from Obsidian's file explorer into the chat
- File navigation — click file references in chat to open them in Obsidian
- Vault-aware sessions — working directory is automatically set to your vault's parent (repository root)
- Theme integration — adapts to your Obsidian light/dark theme
Requirements
- Obsidian Desktop — the plugin requires Obsidian's Electron desktop app. Mobile is not supported.
- Claude Code CLI — install globally:
npm install -g @anthropic-ai/claude-codeVerify:
claude --versionInstallation
The plugin is currently in development and requires manual installation.
1. Build the plugin from the DorkOS monorepo root:
turbo run build --filter=@dorkos/obsidian-pluginThis outputs three files to apps/obsidian-plugin/dist/:
main.js— the plugin codestyles.css— plugin stylesmanifest.json— plugin metadata
2. Symlink the dist directory into your vault's plugins folder:
# From your vault directory
cd .obsidian/plugins
ln -s /path/to/dorkos/apps/obsidian-plugin/dist dorkos-copilotOn Windows:
mklink /D dorkos-copilot C:\path\to\dorkos\apps\obsidian-plugin\dist3. Restart Obsidian (or reload with Ctrl/Cmd + R)
4. Enable the plugin — Settings → Community Plugins → find "DorkOS Copilot" → toggle on
Future
The plugin will eventually be published to Obsidian's Community Plugin directory for one-click installation.
Configuration
API Key
The plugin uses the Claude Code CLI, so it needs the same API key:
export ANTHROPIC_API_KEY="your-api-key-here"Add this to your shell profile (~/.zshrc, ~/.bashrc, etc.) to persist across sessions.
Important: Obsidian must be launched from a context where this environment variable is available. Launching from macOS Spotlight or Windows Start Menu may not inherit your shell environment.
Working Directory
The plugin sets the working directory to your vault's parent directory (repository root). This assumes your vault lives inside a Git repository:
my-project/ ← Working directory (repo root)
├── .claude/
│ └── commands/ ← Slash commands
├── workspace/ ← Your Obsidian vault
│ ├── .obsidian/
│ └── notes/
└── .git/This gives DorkOS access to your slash commands, full repository context, and Git operations.
Usage
Opening the Sidebar
Three ways to open the copilot:
- Ribbon icon — click the robot icon in the left sidebar
- Command palette —
Ctrl/Cmd + P→ "Open Copilot" - Custom hotkey — assign one in Settings → Hotkeys
The copilot opens in the right sidebar as a panel.
Adding Context
Active File (Automatic)
The currently open file is automatically tracked and shown as a context chip above the chat input. It updates as you switch files.
Drag-and-Drop (Manual)
Drag files from Obsidian's file explorer into the chat area. The drop zone highlights when you drag over it. Manually added context chips persist until you remove them with the "x" button.
Both the active file and any manually added files are included when you send a message.
Opening Files from Chat
Click file paths in Claude's responses to open them in the Obsidian editor.
Session Management
The session list shows all your chat sessions — including those started from the CLI or standalone web interface. Sessions persist in ~/.claude/projects/{slug}/ and cannot be deleted from the UI.
How It Differs from Standalone Mode
| Feature | Standalone Web | Obsidian Plugin |
|---|---|---|
| Transport | HTTP/SSE to Express | In-process (no network calls) |
| Session ID storage | URL query parameter | Internal state |
| Active file context | Not available | Auto-tracked |
| File drag-and-drop | Not available | From Obsidian file explorer |
| Open file action | Not available | Opens in Obsidian editor |
| Theme | DorkOS custom properties | Obsidian theme variables |
| Working directory | Configurable via directory picker | Vault parent (automatic) |
The plugin uses DirectTransport — services run in-process inside Obsidian's Electron environment with no HTTP or SSE. This is what makes the plugin fast and what makes standard Node.js module patterns require adaptation for Electron.
Build Architecture
The plugin builds via Vite lib mode targeting CommonJS for Electron compatibility. Four post-processing plugins run on the output:
copyManifest— copiesmanifest.jsoninto the dist directorysafeRequires— rewritesrequire()calls for Electron's module resolutionfixDirnamePolyfill— patches__dirnamereferences that break in Electron's bundled contextpatchElectronCompat— applies additional compatibility fixes for Electron's sandboxed environment
Troubleshooting
Plugin Won't Load
Open the developer console (Cmd+Option+I on macOS, Ctrl+Shift+I on Windows/Linux) and check the Console tab.
Common errors:
- "Cannot find module 'X'" — dependency missing. Rebuild the plugin.
- "Claude Code executable not found" — CLI not installed or not in PATH. Run
npm install -g @anthropic-ai/claude-code. - "ANTHROPIC_API_KEY not set" — API key not in environment. See API Key above.
API Key Not Available
- Verify with
echo $ANTHROPIC_API_KEY - Launch Obsidian from a terminal that sources your shell profile
- On macOS, use
launchctl setenv ANTHROPIC_API_KEY your-keyto set a system-wide value
Text Not Selectable
A known Obsidian style quirk. The plugin includes a user-select: text CSS fix in styles.css. If text still isn't selectable, confirm styles.css exists in the plugin directory.
Active File Not Updating
- Switch files by clicking in the main editor, not just hovering
- Check the developer console for event listener errors
- Close and reopen the copilot sidebar
Session List Empty
Sessions are read from ~/.claude/projects/{slug}/. If no sessions exist for your working directory, the list will be empty. Sessions created from the CLI or standalone web interface with the same working directory will appear here.
Performance Issues
The plugin bundles the React client and Claude Agent SDK into a single file (~10.4MB, 2.7MB gzipped). On older machines this may cause slow initial load or occasional UI lag. Consider using the standalone web interface if performance is a concern.
Development
Hot Reload
Install the Hot Reload community plugin, then:
touch apps/obsidian-plugin/dist/.hotreloadSubsequent plugin builds will auto-reload in Obsidian without restarting.
Multiple Vaults
Sessions are stored in ~/.claude/projects/ keyed by repository path. Two vaults in the same repository share sessions; vaults in different repositories maintain independent session lists.
Support
If you encounter issues not covered here:
- Check the developer console for error details
- Search existing issues in the GitHub repository
- Open a new issue with the console error, reproduction steps, your Obsidian version, and your DorkOS version (from
manifest.json)