Skip to main content
command CX Codex

obsidian-export — Claude Code command: what it does, how to install

obsidian-export generates a structured snapshot of an Obsidian vault as flat JSON, a single Markdown index, or an Open Knowledge Format bundle.

MIT ★ 5,412 updated 2026-10-24

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add eugeniughelbur/obsidian-second-brain
/plugin install obsidian-second-brain@obsidian-second-brain
Open on GitHub

What obsidian-export does

The command scans Obsidian notes and builds an export snapshot intended for external scripts and agents. It inspects _CLAUDE.md and index.md, enumerates directories defined in references/folder-map.md, and extracts note frontmatter, summaries, wikilinks, and backlinks.

All output files go into the _export/ directory. By default, the command writes _export/vault-snapshot.json. Specifying markdown produces _export/vault-snapshot.md. Generating an OKF v0.1 package triggers the external script scripts/export_okf.py via uv run rather than building the bundle manually.

Generating an OKF bundle fails without uv available in your execution environment. Successful runs log their summary into log.md or a dated entry under Logs/.

What it helps with

  • Export vault graph structure into a single JSON file
  • Compile all notes and frontmatter into one Markdown index
  • Convert vault content into a vendor-neutral OKF v0.1 bundle
  • Track export executions inside the vault activity log

Example prompts for the agent

  • Run /obsidian-export to create the default JSON vault snapshot
  • Run /obsidian-export markdown to generate a flat catalog file
  • Run /obsidian-export okf to build an Open Knowledge Format archive

How to install obsidian-export

1Plugin marketplace

/plugin marketplace add eugeniughelbur/obsidian-second-brain
/plugin install obsidian-second-brain@obsidian-second-brain

2Manually: put the files in place

.claude/commands/obsidian-export.md

Call it with /obsidian-export. For all projects use ~/.claude/commands/

Questions about obsidian-export

How to install obsidian-export in Claude Code?

Add the marketplace source using /plugin marketplace add eugeniughelbur/obsidian-second-brain, then execute /plugin install obsidian-second-brain@obsidian-second-brain.

What does obsidian-export do?

It reads notes across your vault folders, collects metadata, tags, and incoming or outgoing links, and saves a consolidated snapshot in JSON, Markdown, or OKF format.

What dependencies are needed for OKF export?

The OKF mode executes scripts/export_okf.py via uv run, which means the uv package runner must be present on your machine.

Source text

obsidian-export.md · MIT
---
description: Export a clean structured snapshot of the vault that any agent or tool can consume - flat JSON, markdown index, or an OKF (Open Knowledge Format) bundle
category: meta
triggers_en: ["export vault", "snapshot vault", "dump vault", "vault export"]
triggers_de: ["Vault exportieren", "eine Vault-Momentaufnahme erstellen", "Vault ausgeben", "Vault-Export"]
triggers_es: ["exporta el vault", "haz una foto del vault", "vuelca el vault", "exportación del vault"]
triggers_pt: ["exporte o vault", "gere um snapshot do vault", "despeje o vault", "exportação do vault"]
triggers_zh: ["导出知识库", "给知识库做个快照", "把笔记导成 JSON", "生成 OKF 知识包", "导出一份可移植的数据"]
---

Use the obsidian-second-brain skill. Execute `/obsidian-export $ARGUMENTS`:

The optional argument is the format: `json` (default), `markdown`, or `okf`.

1. Read `_CLAUDE.md` first if it exists in the vault root
2. Read `index.md` for the full vault catalog

3. Build a structured export by scanning the vault:

   **For each note in every note folder present**, enumerating the vault's top-level note folders per `references/folder-map.md` (wiki-style: `wiki/`; Obsidian-style: `People/`, `Projects/`, `Ideas/`, `Knowledge/`, `Daily/`, ... whatever exists on disk), extract:
   - `path`: file path relative to vault root
   - `title`: note title (first heading or filename)
   - `type`: from frontmatter tags (entity, concept, project, daily, etc.)
   - `date`: from frontmatter
   - `status`: from frontmatter (if exists)
   - `summary`: first paragraph or first 200 characters of body
   - `links_to`: list of all outgoing `[[wikilinks]]`
   - `linked_from`: list of all incoming links (backlinks)
   - `tags`: all frontmatter tags
   - `frontmatter`: full frontmatter as key-value pairs

4. Output format:

   **JSON** (default):
   ```json
   {
     "vault": "Example Vault",
     "exported": "2026-04-07",
     "total_notes": 238,
     "notes": [
       {
         "path": "wiki/entities/Ada Lovelace.md",
         "title": "Ada Lovelace",
         "type": "entity",
         "summary": "CEO of Currentscale Labs...",
         "links_to": ["Currentscale Labs", "Tide Gateway"],
         "tags": ["entity", "person"]
       }
     ]
   }
   ```
   Save to `_export/vault-snapshot.json`

   **Markdown**:
   A flat markdown file with every note listed with its metadata and summary.
   Save to `_export/vault-snapshot.md`

   **OKF** (Open Knowledge Format - Google Cloud's vendor-neutral "folders of markdown" standard): do NOT build this by hand. Run the deterministic exporter from the skill root (its absolute path was given at session start as **Skill root**; substitute it for `SKILL_ROOT`):
   ```bash
   uv run --directory "SKILL_ROOT" scripts/export_okf.py --path "<vault path from _CLAUDE.md>"
   ```
   It writes an OKF v0.1 bundle to `_export/okf/`: every note becomes an OKF concept doc (frontmatter `type` [required] / `title` / `description` / `resource` [only when the note has a real source URL] / `tags` / ISO-8601 `timestamp`; `[[wikilinks]]` converted to relative-path markdown links), plus a generated `index.md` (progressive disclosure) and a copied `log.md`. The vault's richer AI-first body (incl. the `## For future agent` preamble) is preserved - OKF is minimally opinionated, so the extra content rides along. This makes the vault "OKF v0.1 compatible" without changing how it works natively.

5. Append to the operation log: if `Logs/` exists write `**HH:MM** - export | Vault snapshot exported (format, N notes)` to `Logs/YYYY-MM-DD.md`; otherwise append `## [YYYY-MM-DD] export | Vault snapshot exported (format, N notes)` to `log.md`

This file is the bridge between your vault and any other AI tool, automation, or agent. They don't need to know your folder structure. They read the snapshot.

---

**AI-first rule:** Every note created or updated by this command MUST follow `references/ai-first-rules.md` - `## For future agent` preamble, rich frontmatter (`type`, `date`, `tags`, `ai-first: true`, plus type-specific fields), recency markers per external claim, mandatory `[[wikilinks]]` for every person/project/concept referenced, sources preserved verbatim with URLs inline, and confidence levels where applicable. If that path does not resolve from your working directory, search upward for it; if you still cannot read it, say so before writing rather than producing a note that silently skips the rule. The vault is for future agent retrieval - not human reading.

**Anti-fabrication:** Search exhaustively before claiming any note, person, or file is absent - false absence is the most common failure mode - and never invent facts, entities, or dates (mark unknowns as `TBD`). See the anti-fabrication and search-completeness hard rules in `references/ai-first-rules.md`.

© Eugeniu Ghelbur · MIT · eugeniughelbur/obsidian-second-brain

Similar slash commands

All slash commands for Notes, tasks and projects →

From the same set51

The whole set →
obsidian-synthesize obsidian-synthesize — a Claude Code command that scans your Obsidian vault for unnamed patterns and automatically generates synthesis pages without prompting. Discovers connections between ideas you may have missed. CX Codex +1 ★ 5,412repo stars notebooklm notebooklm runs source-grounded research across your Obsidian vault with Gemini File Search. Useful when you need answers tied strictly to personal notes. CX Codex +1 ★ 5,412repo stars research Research a topic and get a sourced dossier. With free sources, Claude Code turns the returned results into a note. CX Codex +1 ★ 5,412repo stars crew crew synchronizes a work logbook across Claude Code, Codex, Cursor, and Grok Bot via a local folder. Lets each agent see what others did, what patterns emerged, and decide next steps from a shared record. CX Codex +1 ★ 5,412repo stars obsidian-world obsidian-world is a Claude Code command that loads context from an Obsidian vault in stages. It runs on requests to catch up or check current priorities. CX Codex +1 ★ 5,412repo stars obsidian-decide obsidian-decide — a Claude Code command that extracts decisions from a conversation and files them in Obsidian, as dated lines or, with --formal, as a full ADR. CX Codex +1 ★ 5,412repo stars obsidian-save obsidian-save extracts decisions, tasks, ideas, and contacts from a Claude Code session directly into an Obsidian vault. Useful for archiving working context without manual note-taking. CX Codex +1 ★ 5,412repo stars obsidian-learn The obsidian-learn command reviews lessons in an Obsidian vault, marks stale or replaced findings, and surfaces repeated patterns for _CLAUDE.md. CX Codex +1 ★ 5,412repo stars

Project sponsors

Companies that keep this analytics open