Export Claude Code sessions to your Obsidian vault as Markdown.
This plugin requires configuration values that are prompted when the plugin is enabled. Sensitive values are stored in your system keychain.
vault_dirAbsolute path to the directory inside your Obsidian vault where session markdown files will be written (e.g. /Users/you/Documents/MyVault/ClaudeSessions). The directory will be created if it doesn't exist.
${user_config.vault_dir}Export Claude Code sessions to your Obsidian vault as readable Markdown.
Each session becomes one .md file named YYYY-MM-DD-<session-id>-<slug>.md,
where the date is the session's start time and the slug is taken from the
session title (/rename) or the first user prompt. Re-exports of the same
session overwrite the same file.
An example exported session rendered in Obsidian:

SessionEnd hook — triggers on
/exit, /clear, /logout, and other graceful shutdowns./claude-to-obsidian:export — useful
for snapshotting before a /compact or sharing work-in-progress./plugin marketplace add mohamed-osama-aboelkheir/claude-to-obsidian
/plugin install claude-to-obsidian@claude-to-obsidian
/plugin config claude-to-obsidian
When prompted by /plugin config, set vault_dir to an absolute path inside
your Obsidian vault — e.g.:
/Users/you/Documents/MyVault/ClaudeSessions
The directory will be created if it doesn't exist.
If you previously wired this script up by hand (custom slash command, hook
entries in ~/.claude/settings.json), remove those before installing the
plugin so the script doesn't run twice on session end.
hooks/hooks.json ─► SessionEnd → scripts/export_session_to_obsidian.py
commands/export.md ─► /claude-to-obsidian:export → same script
scripts/export_… ─► reads JSONL transcript, writes Markdown to $vault_dir
The Python script:
$CLAUDE_PLUGIN_OPTION_VAULT_DIR (set via plugin
config). Falls back to CLAUDE_OBSIDIAN_VAULT if set.$CLAUDE_PLUGIN_DATA/export.log.Failures never block session end — the hook always exits 0.
==text== patterns
inside code blocks. Workaround: in Dataview settings, disable
"Enable Inline Field Highlighting" — or exclude claude_sessions/.* in
the plugin's exclude regex./export: Claude Code's built-in /export
slash command isn't exposed as a CLI, so this plugin renders the JSONL
transcript itself. The format is approximate, not exact.If you prefer a shell-profile setting instead of plugin config:
export CLAUDE_OBSIDIAN_VAULT=/Users/you/Documents/MyVault/ClaudeSessions
Plugin config (CLAUDE_PLUGIN_OPTION_VAULT_DIR) takes precedence when both
are set.
MIT — see LICENSE.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub mohamed-osama-aboelkheir/claude-to-obsidian --plugin claude-to-obsidianMulti-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Easily create hooks to prevent unwanted behaviors by analyzing conversation patterns