Skip to content

KSShreyas/claudian-ollama

 
 

Repository files navigation

Claudian

GitHub stars GitHub release License

Preview

An Obsidian plugin that embeds AI coding agents (Claude Code, Codex, and more to come) in your vault. Your vault becomes the agent's working directory — file read/write, search, bash, and multi-step workflows all work out of the box.

Features & Usage

Open the chat sidebar from the ribbon icon or command palette. Select text and use the hotkey for inline edit. Everything works like Claude Code or Codex — talk to the agent, and it reads, writes, edits, and searches files in your vault.

Inline Edit — Select text or start at the cursor position + hotkey to edit directly in notes with word-level diff preview.

Slash Commands & Skills — Type / or $ for reusable prompt templates or Skills from user- and vault-level scopes.

@mention - Type @ to mention anything you want the agent to work with, vault files, subagents, MCP servers, or files in external directories.

Plan Mode — Toggle via Shift+Tab. The agent explores and designs before implementing, then presents a plan for approval.

Instruction Mode (#) — Refined custom instructions added from the chat input.

MCP Servers — Connect external tools via Model Context Protocol (stdio, SSE, HTTP). Claude manages vault MCP in-app; Codex uses its own CLI-managed MCP configuration.

Multi-Tab & Conversations — Multiple chat tabs, conversation history, fork, resume, and compact.

Requirements

  • Claude provider: Claude Code CLI installed (native install recommended). Supports Anthropic Cloud plus Anthropic-compatible routing, including local Ollama endpoints.
  • Codex provider (optional): Codex CLI installed.
  • Obsidian v1.4.5+
  • Desktop only (macOS, Linux, Windows)

Claude Backends

Claudian keeps a single Claude provider path and lets you choose the backend behind it:

  • Anthropic Cloud: normal Claude Code behavior.
  • Anthropic-compatible endpoint: custom ANTHROPIC_BASE_URL routing for gateways and compatible services.
  • Ollama Local: a first-class preset for desktop models exposed through an Anthropic-compatible Messages endpoint.

Ollama Local setup

  1. Install and start Ollama.
  2. Pull a coding-capable model, for example ollama pull qwen3.5 or ollama pull qwen3-coder.
  3. Open Settings -> Claudian -> Claude provider.
  4. Set Backend mode to Ollama Local.
  5. Leave Base URL as http://localhost:11434 unless your setup uses another endpoint.
  6. Leave Auth token as ollama unless your gateway requires something else.
  7. Leave API key blank unless your compatible endpoint explicitly requires one.
  8. Enter your model name in the free-form Model field.
  9. Click Test connection.

The Claude provider now resolves and injects ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, and ANTHROPIC_MODEL from the Claude settings UI without replacing the existing Claude architecture.

Notes on local models

  • Not every Ollama model is equally strong at multi-step tool use.
  • Some local models can answer chat prompts but still struggle with file edits, tool arguments, or inline edit formatting.
  • Claudian now surfaces these failures more explicitly instead of leaving the UI in a silent no-response state.

Installation

From GitHub Release (recommended)

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Create a folder called claudian in your vault's plugins folder:
    /path/to/vault/.obsidian/plugins/claudian/
    
  3. Copy the downloaded files into the claudian folder
  4. Enable the plugin in Obsidian:
    • Settings → Community plugins → Enable "Claudian"

Using BRAT

BRAT (Beta Reviewers Auto-update Tester) allows you to install and automatically update plugins directly from GitHub.

  1. Install the BRAT plugin from Obsidian Community Plugins
  2. Enable BRAT in Settings → Community plugins
  3. Open BRAT settings and click "Add Beta plugin"
  4. Enter the repository URL: https://github.com/YishenTu/claudian
  5. Click "Add Plugin" and BRAT will install Claudian automatically
  6. Enable Claudian in Settings → Community plugins

Tip: BRAT will automatically check for updates and notify you when a new version is available.

From source (development)

  1. Clone this repository into your vault's plugins folder:

    cd /path/to/vault/.obsidian/plugins
    git clone https://github.com/YishenTu/claudian.git
    cd claudian
  2. Install dependencies and build:

    npm install
    npm run build
  3. Enable the plugin in Obsidian:

    • Settings → Community plugins → Enable "Claudian"

Development

# Watch mode
npm run dev

# Production build
npm run build

Tip: Copy .env.local.example to .env.local or npm install and setup your vault path to auto-copy files during development.

Privacy & Data Use

  • Sent to API: Your input, attached files, images, and tool call outputs. Default: Anthropic (Claude) or OpenAI (Codex); Claude can also route to Anthropic-compatible backends such as Ollama.
  • Local storage: Claudian settings and session metadata in vault/.claudian/; Claude provider files in vault/.claude/; transcripts in ~/.claude/projects/ (Claude) and ~/.codex/sessions/ (Codex).
  • No telemetry: No tracking beyond your configured API provider.

Troubleshooting

Claude CLI not found

If you encounter spawn claude ENOENT or Claude CLI not found, the plugin can't auto-detect your Claude installation. Common with Node version managers (nvm, fnm, volta).

Solution: Find your CLI path and set it in Settings → Advanced → Claude CLI path.

Platform Command Example Path
macOS/Linux which claude /Users/you/.volta/bin/claude
Windows (native) where.exe claude C:\Users\you\AppData\Local\Claude\claude.exe
Windows (npm) npm root -g {root}\@anthropic-ai\claude-code\cli.js

Note: On Windows, avoid .cmd wrappers. Use claude.exe or cli.js.

Alternative: Add your Node.js bin directory to PATH in Settings → Environment → Custom variables.

npm CLI and Node.js not in same directory

If using npm-installed CLI, check if claude and node are in the same directory:

dirname $(which claude)
dirname $(which node)

If different, GUI apps like Obsidian may not find Node.js.

Solutions:

  1. Install native binary (recommended)
  2. Add Node.js path to Settings → Environment: PATH=/path/to/node/bin

Ollama connection refused on localhost:11434

If the Claude provider connection test reports that http://localhost:11434 is unreachable:

  1. Make sure the Ollama app or daemon is running.
  2. Confirm the model exists with ollama list.
  3. If you use a proxy or custom port, update the Claude provider Base URL.
  4. Run Test connection again after changing the backend settings.

Model not found

If chat starts but the backend reports that the configured model does not exist:

  1. Double-check the exact model name in the Claude provider Model field.
  2. Pull it first with ollama pull <model-name>.
  3. For remote compatible gateways, use the provider-specific model identifier they expose.

No response or stream never starts

Use the Claude provider Test connection button first. If it succeeds but a chat turn still fails:

  1. Open Claude provider settings and inspect the backend summary and recent diagnostics.
  2. Verify the effective backend mode, base URL, CLI path, and model match what you expect.
  3. If you are using a weaker local model, retry with a stronger coding-focused model before assuming the plugin is at fault.

Invalid tool parameters or malformed local-model output

Some local models can answer plain chat prompts but still produce malformed tool calls or inline-edit output. When that happens:

  1. The chat now surfaces a coded error instead of silently stalling.
  2. Retry with a stronger model.
  3. If inline edit keeps failing, use normal chat with a more explicit instruction and review the diff manually.

Base URL mistakes

  • Anthropic Cloud should usually leave Base URL empty.
  • Anthropic-compatible endpoint should use the endpoint documented by that service.
  • Ollama Local defaults to http://localhost:11434.
  • If your compatible provider expects /v1 or another path suffix, enter the full base URL it documents.

Codex provider

Codex support is live but still needs more testing across platforms and installation methods. If you run into any bugs, please submit a GitHub issue.

Architecture

src/
├── main.ts                      # Plugin entry point
├── app/                         # Shared defaults and plugin-level storage
├── core/                        # Provider-neutral runtime, registry, and type contracts
│   ├── runtime/                 # ChatRuntime interface and approval types
│   ├── providers/               # Provider registry and workspace services
│   ├── security/                # Approval utilities
│   └── ...                      # commands, mcp, prompt, storage, tools, types
├── providers/
│   ├── claude/                  # Claude SDK adaptor, prompt encoding, storage, MCP, plugins
│   └── codex/                   # Codex app-server adaptor, JSON-RPC transport, JSONL history
├── features/
│   ├── chat/                    # Sidebar chat: tabs, controllers, renderers
│   ├── inline-edit/             # Inline edit modal and provider-backed edit services
│   └── settings/                # Settings shell with provider tabs
├── shared/                      # Reusable UI components and modals
├── i18n/                        # Internationalization (10 locales)
├── utils/                       # Cross-cutting utilities
└── style/                       # Modular CSS

Roadmap

  • 1M Opus and Sonnet models
  • Codex provider integration
  • More to come!

License

Licensed under the MIT License.

Star History

Star History Chart

Acknowledgments

About

An Obsidian plugin that embeds Claude Code as an AI collaborator in your vault

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 97.3%
  • CSS 2.4%
  • JavaScript 0.3%