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 Connector

Atif AhmedAtif Ahmed3 downloads

Share the note you are reading, the section you are in and the text you select with Claude Code.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

Ask Claude Code about the note you are reading without pasting it in.

Claude Code's VS Code extension tells Claude which file you have open and what you selected. This does the same for Obsidian. Read a note, select a paragraph, switch to your terminal and ask "what does this mean?" Claude already knows which note, which section and which lines you mean.

It has two halves that talk through one small file:

Half Lives in Does
Claude Code Connector, an Obsidian plugin your vault writes what you are reading to ~/.claude/obsidian-context/state.json
obsidian-context, a Claude Code plugin Claude Code adds that to your prompt, as a short block Claude reads
flowchart TD
    A["You read, scroll or select text in Obsidian"] --> B["Obsidian plugin writes state.json"]
    C["You send a prompt in Claude Code"] --> D["Hook reads state.json"]
    B -.-> D
    D --> E["Claude gets the note, section and selection with your prompt"]

What Claude sees

With a paragraph of a cooking note selected, your prompt arrives with this block attached:

<obsidian-context>
What the user has open in Obsidian (updated 2 min ago). Use it to work out what
"this", "here" or "this note" means in their message; ignore it when the message
is about something else. Read the note for its full text.
Vault: notes (note paths below are inside it)
Reading: guides/Cooking basics.md (reading view)
Section: Cooking basics > Knife skills
Selected text (lines 14-15):
<selection>
Keep the tip of the knife on the board.
</selection>
Other open tabs: Index.md
Recently opened: guides/Bread.md (09:30)
</obsidian-context>

It is sent once and again only when something changes, so asking three questions about the same paragraph does not repeat it three times.

Install

You need both halves, a desktop Obsidian (1.5 or newer) and Node.js 20 or newer on your PATH (the hook runs with node).

1. The Obsidian plugin

In Obsidian, open Settings → Community plugins, turn community plugins on if they are off, click Browse, search for Claude Code Connector, then install and enable it. Its page in the Obsidian community directory is here.

The status bar now shows Claude: sharing.

To install by hand instead, download main.js and manifest.json from the latest release into <your vault>/.obsidian/plugins/claude-code-connector/, click the refresh icon next to Installed plugins and switch on Claude Code Connector.

2. The Claude Code plugin

In Claude Code:

/plugin marketplace add SigniorAtif/Obsidian-CC-connector
/plugin install obsidian-context@obsidian-cc-connector

Start a new session. That's it.

Check a download (optional)

From 0.1.1 on, GitHub signs a record of each release file as its release workflow builds it. With the GitHub CLI, this confirms that a main.js you have was built from this repository, unchanged:

gh attestation verify main.js --repo SigniorAtif/Obsidian-CC-connector

When Claude gets the context

The hook adds the block to a prompt only when all of these hold:

  1. Obsidian is running with the plugin on and not paused.
  2. The session is in the right folder. By default that is the vault itself or, if the vault sits inside a git project, anywhere in that project. A Claude Code session about some unrelated project gets nothing. To share with every session, turn on Share with every Claude Code session in the plugin's settings.
  3. Something changed since the last prompt of that session. Starting, resuming, clearing or compacting a session sends it again.

Using it

  • Pause: click Claude: sharing in the status bar, run Claude Code Connector: Pause or resume sharing from the command palette, or switch off Share with Claude Code in the plugin's settings. Pausing deletes the state file at once.
  • Selections are read in editing and reading view, with the source line numbers. In other views, such as PDFs, the plugin shares the selected text when it can see it, without line numbers. Selections over 4,000 characters are cut short, and Claude is told.
  • Where you are without a selection is the heading above the first line on screen.

Privacy

  • The Obsidian plugin makes no network requests and collects no telemetry.
  • It writes one file outside your vault: ~/.claude/obsidian-context/state.json. The file holds the path of the open note, the headings above where you are, the text you selected, the paths of your open tabs and of the last ten notes you opened. It is deleted when you pause or disable the plugin and when Obsidian's window closes. If Obsidian crashes and leaves it behind, the hook sees that Obsidian is no longer running and ignores it.
  • It keeps your recent-notes list and settings in its own data.json inside the vault, like any plugin.
  • The Claude Code hook only reads that file. What it adds to a prompt is sent to Anthropic (or the provider your Claude Code uses) along with the prompt, exactly as if you had typed it. Pause the plugin before reading anything you do not want to share.

Settings

Setting Default What it does
Share with Claude Code on Off pauses sharing, the same as clicking the status bar item.
Share with every Claude Code session off On lets sessions in any folder see what you are reading.

To move the state file, set the environment variable OBSIDIAN_CONTEXT_DIR for both Obsidian and Claude Code, for example in your shell profile (then start Obsidian from that environment).

Limits

  • Desktop only. The plugin writes a file with Node's fs, which mobile Obsidian does not have.
  • One vault at a time. If two vaults are open, the one you used last wins.
  • Reading-view line numbers come from Obsidian internals that are not part of its public API. If an Obsidian update changes them, you still get the selected text, just without line numbers.
  • Tested on Obsidian 1.14.4 and Claude Code 2.1 on Linux. The hook's tests also run on macOS and Windows in CI.

Troubleshooting

  • No "Claude: sharing" in the status bar: the plugin is not enabled. Check Settings → Community plugins, and click the refresh icon if it is missing from the list.
  • Claude does not seem to know: check that ~/.claude/obsidian-context/state.json exists and changes when you switch notes. If it does, check you started Claude Code inside the vault or its project, or turn on Share with every Claude Code session. Run /plugin in Claude Code to see that obsidian-context is enabled.

Contributing

Bug reports and pull requests are welcome. See CONTRIBUTING.md for the setup, the checks and how releases are made.

License

MIT © 2026 Atif Ahmed

HealthExcellent
ReviewSatisfactory
About
Write the current note, section and selected lines to a local state file so Claude Code can read context and answer questions without pasting the note. Update the context only when it changes to avoid repeating the same content across multiple prompts.
IntegrationsAIFiles
Details
Current version
0.1.1
Last updated
4 hours ago
Created
7 hours ago
Updates
2 releases
Downloads
3
Compatible with
Obsidian 1.5.0+
Platforms
Desktop only
License
MIT
Report bugRequest featureReport plugin
Author
Atif AhmedAtif Ahmedsignioratif
GitHubsignioratif
  1. Community
  2. Plugins
  3. Integrations
  4. Claude Code Connector

Related plugins

Claudian

Embeds Claude Code/Codex and other local Agents as AI collaborators in your vault.

Fast Note Sync

Real-time sync of your vaults across server, mobile, and web; shareable with anyone; supports REST and MCP integrations to build your personal AI knowledge base.

Local REST API with MCP

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

ChatGPT MD

A seamless integration of ChatGPT, OpenRouter.ai and local LLMs via Ollama into your notes.

Google Drive Sync

Syncs a vault into Google Drive for cross-platform use (works for iOS).

Gemini Scribe

Allows you to interact with Gemini and use your notes as context.

Agent Client

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

Snipd Official

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

Nutstore Sync

Sync your vault with Nutstore (坚果云) using WebDAV protocol.

Notebook Navigator

A better file browser and calendar inspired by Apple Notes, Bear, Evernote and Day One.