# eugeniughelbur/obsidian-second-brain architecture

> Architecture diagram of the GitHub repository eugeniughelbur/obsidian-second-brain, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eugeniughelbur/obsidian-second-brain
- Repository: https://github.com/eugeniughelbur/obsidian-second-brain

## Overview

1. **What this repository is**
   This is not an application with a server or UI; it is a **Claude Code skill pack** for operating an **Obsidian vault as a live knowledge system**. The repo defines command prompts, bootstrap scripts, and agent hooks that orchestrate how Claude reads, writes, audits, and rewrites the vault.

2. **Primary runtime boundary**
   The main boundary is between **Claude’s runtime** and the **Obsidian vault filesystem**. Claude executes named commands from `commands/`, then reads and mutates markdown files inside the vault. The vault is treated as the persistent system of record, while Claude is the agent that interprets and updates it.

3. **Command layer**
   The `commands/` directory is the core interaction surface. Each markdown file maps to a high-level capability such as saving (`obsidian-save`), ingesting external material (`obsidian-ingest`), synthesis and reconciliation (`obsidian-synthesize`, `obsidian-reconcile`), daily operations (`obsidian-daily`, `obsidian-log`, `obsidian-review`), and thinking tools (`obsidian-challenge`, `obsidian-connect`, `obsidian-emerge`, `obsidian-graduate`). Architecturally, these are separate workflows that read from the same vault but serve different user intents.

4. **Context-loading subsystem**
   `commands/obsidian-world.md` is the context engine. The README describes it as loading identity and state with progressive token budgets. In architecture terms, this is the **session bootstrap boundary**: it determines what Claude knows before it starts doing vault work, and it likely anchors every other command to a consistent user/world model.

5. **Vault layout and data model**
   The README describes a vault structure with a clear split between **immutable source material** and **mutable working knowledge**:
   - `raw/` holds original inputs and is treated as immutable.
   - `wiki/` holds Claude-managed notes such as entities, concepts, projects, daily notes, logs, reviews, tasks, and decisions.
   - `boards/` and `templates/` support operational views and note generation.
   - `index.md`, `log.md`, `SOUL.md`, and `CRITICAL_FACTS.md` are global navigation/state files.
   This is the central data architecture: sources flow into the vault, then get redistributed into entity/concept/project pages.

6. **Ingestion and rewrite flow**
   `/obsidian-ingest` is the most important write path. The README describes a pipeline where a source such as a URL, PDF, audio file, or screenshot is ingested, stored in `raw/`, then used to **rewrite multiple downstream pages**: entity pages, concept pages, synthesis pages, daily notes, and indexes. This is a key architectural idea: the system is not append-only note capture; it is a **self-revising knowledge graph in markdown form**.

7. **Operational maintenance flow**
   Several commands exist to keep the vault coherent over time:
   - `obsidian-reconcile` handles contradictions.
   - `obsidian-health` audits stale claims, gaps, or orphan notes.
   - `obsidian-synthesize` surfaces patterns across sources.
   - `obsidian-export` provides a clean snapshot for other tools.
   These form the **maintenance subsystem**, ensuring the vault stays consistent and useful rather than accumulating dead notes.

8. **Thinking-tools subsystem**
   `obsidian-challenge`, `obsidian-emerge`, `obsidian-connect`, and `obsidian-graduate` are distinct from capture/maintenance commands. They do not just store information; they apply the vault as an inference engine:
   - challenge pushes back using prior history,
   - emerge finds latent patterns,
   - connect bridges unrelated domains,
   - graduate turns fragments into executable projects.
   Architecturally, these commands read across the same note graph but produce higher-level synthesis and decision support outputs.

9. **Automation and background agents**
   The repo includes `hooks/obsidian-bg-agent.sh` plus references to scheduled agents in the README. The background hook runs after context compaction, and scheduled jobs handle morning, nightly, weekly, and health routines. This creates an **always-on maintenance layer** outside interactive command execution, so the vault evolves even when the user is not actively prompting it.

10. **Bootstrap and provisioning**
   `install.sh`, `scripts/setup.sh`, and `scripts/bootstrap_vault.py` are the provisioning path. They initialize the vault structure, choose a preset, and generate initial files like `_CLAUDE.md`, `index.md`, and `log.md`. This is where the repo turns from a set of prompts into a concrete vault instance. The bootstrap script is also where the preset-specific folder structure and board style are selected.

11. **Validation and health tooling**
   `scripts/vault_health.py` provides a programmatic audit path, complementing the markdown-based `obsidian-health` command. Together they suggest a split between **manual/LLM-driven operations** and **scripted verification**. That makes the system more than a note template repo: it includes correctness checks for the vault’s state.

12. **Reference and governance layer**
   The `references/` folder contains schemas, templates, and write rules. This is the repository’s policy layer: it defines how notes should be structured, how Claude should write into the vault, and what canonical formats exist. `architecture.md` and `SKILL.md` likely document the intended operating model for the skill itself, making the repo self-describing and easier to extend.

13. **Technology profile**
   The implementation is lightweight and filesystem-centric:
   - **Markdown** for commands, templates, and vault content
   - **Python** for bootstrap and health scripts
   - **Bash** for install/setup and background hooks
   - **Obsidian** as the note environment
   - **Claude Code** as the execution agent
   There is no evidence of a web server, database, or client app; the repository’s “architecture” is primarily about orchestration of files, prompts, and scheduled automation.

14. **How to diagram it**
   A correct architecture diagram should show:
   - the user and Claude at the top as the interactive agent layer,
   - `commands/` as the capability router,
   - `hooks/` and scheduled agents as the background automation layer,
   - `scripts/` and `install.sh` as provisioning/health tooling,
   - the Obsidian vault as the persistent data store,
   - `raw/` separated from `wiki/` as immutable vs mutable storage,
   - `index.md`, `log.md`, and `CRITICAL_FACTS.md` as global state and entry points.
   The main flow is: **input or session context in → command execution → vault reads/writes → synthesis/reconciliation/index updates → background maintenance keeps it coherent**.

Main entry points: [`commands`](https://github.com/eugeniughelbur/obsidian-second-brain/tree/main/commands) (Commands), [`commands/obsidian-ingest.md`](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-ingest.md) (Capture & ingest), [`references`](https://github.com/eugeniughelbur/obsidian-second-brain/tree/main/references) (References), [`commands/obsidian-synthesize.md`](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-synthesize.md) (Synthesis & health)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interactive["Interactive layer"]
  node_claude_runtime(("Claude<br/>agent runtime"))
  node_commands_root["Commands"]
  node_obsidian_world["World setup<br/>session bootstrap<br/>[obsidian-world.md]"]
  node_capture_ingest["Capture & ingest<br/>write pipeline<br/>[obsidian-ingest.md]"]
  node_save_init["Save & init<br/>vault entrypoint<br/>[obsidian-save.md]"]
  node_daily_review["Daily ops<br/>operational cycle<br/>[obsidian-daily.md]"]
  node_synthesis_maint["Synthesis & health<br/>maintenance cycle"]
  node_thinking_tools["Thinking tools<br/>inference workflows"]
  node_ops_views["Ops views<br/>navigation views<br/>[obsidian-board.md]"]
end

subgraph group_automation["Automation layer"]
  node_bg_agent["Bg agent<br/>background hook"]
end

subgraph group_tooling["Provisioning & checks"]
  node_setup_chain["Setup chain<br/>bootstrap scripts<br/>[install.sh]"]
  node_bootstrap_vault["Bootstrap vault<br/>provisioning script<br/>[bootstrap_vault.py]"]
  node_vault_health["Vault health<br/>validation script<br/>[vault_health.py]"]
end

subgraph group_vault["Vault data model"]
  node_vault_system[("Vault system<br/>obsidian store")]
  node_raw_store["Raw inputs<br/>immutable source"]
  node_wiki_store["Wiki notes<br/>managed knowledge"]
  node_global_state["Global state<br/>vault index"]
end

subgraph group_governance["Policy & docs"]
  node_references_node["References<br/>policy layer"]
  node_docs["Repo docs<br/>architecture docs<br/>[README.md]"]
end

node_claude_runtime -->|"executes"| node_commands_root
node_commands_root -->|"bootstraps"| node_obsidian_world
node_commands_root -->|"captures"| node_capture_ingest
node_commands_root -->|"writes"| node_save_init
node_commands_root -->|"operates"| node_daily_review
node_commands_root -->|"maintains"| node_synthesis_maint
node_commands_root -->|"reasons"| node_thinking_tools
node_commands_root -->|"renders"| node_ops_views
node_obsidian_world -->|"loads context"| node_vault_system
node_capture_ingest -->|"stores source"| node_raw_store
node_capture_ingest -->|"rewrites"| node_wiki_store
node_capture_ingest -->|"updates index"| node_global_state
node_save_init -->|"creates structure"| node_vault_system
node_daily_review -->|"refreshes"| node_global_state
node_synthesis_maint -->|"audits & reconciles"| node_wiki_store
node_thinking_tools -->|"reads across"| node_wiki_store
node_bg_agent -.->|"continues"| node_synthesis_maint
node_bg_agent -.->|"checks"| node_vault_health
node_setup_chain -->|"provisions"| node_bootstrap_vault
node_bootstrap_vault -->|"initializes"| node_vault_system
node_vault_health -->|"audits"| node_vault_system
node_references_node -->|"constrains"| node_bootstrap_vault
node_references_node -->|"guides"| node_commands_root
node_docs -->|"describes"| node_references_node
node_docs -->|"explains"| node_commands_root
node_vault_system -->|"separates"| node_raw_store
node_vault_system -->|"separates"| node_wiki_store
node_vault_system -->|"anchors"| node_global_state

click node_commands_root "https://github.com/eugeniughelbur/obsidian-second-brain/tree/main/commands"
click node_obsidian_world "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-world.md"
click node_capture_ingest "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-ingest.md"
click node_save_init "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-save.md"
click node_daily_review "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-daily.md"
click node_synthesis_maint "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-synthesize.md"
click node_thinking_tools "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-challenge.md"
click node_ops_views "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-board.md"
click node_bg_agent "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/hooks/obsidian-bg-agent.sh"
click node_setup_chain "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/install.sh"
click node_bootstrap_vault "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/scripts/bootstrap_vault.py"
click node_vault_health "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/scripts/vault_health.py"
click node_references_node "https://github.com/eugeniughelbur/obsidian-second-brain/tree/main/references"
click node_docs "https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_claude_runtime,node_commands_root,node_obsidian_world,node_capture_ingest,node_save_init,node_daily_review,node_synthesis_maint,node_thinking_tools,node_ops_views toneBlue
class node_bg_agent toneAmber
class node_setup_chain,node_bootstrap_vault,node_vault_health toneMint
class node_vault_system,node_raw_store,node_wiki_store,node_global_state toneRose
class node_references_node,node_docs toneIndigo
```

## Components

### Interactive layer

Claude executes named commands against the vault during sessions.

- **Claude**: agent runtime · Interactive agent that interprets commands and mutates the vault.
- [Commands](https://github.com/eugeniughelbur/obsidian-second-brain/tree/main/commands): skill commands · Primary capability surface for vault workflows. · `commands`
- [World setup](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-world.md): session bootstrap · Loads identity, state, and token-budgeted context before other work. · `commands/obsidian-world.md`
- [Capture & ingest](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-ingest.md): write pipeline · Brings external material in and rewrites downstream notes. · `commands/obsidian-ingest.md`
- [Save & init](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-save.md): vault entrypoint · Creates or updates core vault state and initial note structure. · `commands/obsidian-save.md`
- [Daily ops](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-daily.md): operational cycle · Daily logging, recap, and review workflows for ongoing work. · `commands/obsidian-daily.md`
- [Synthesis & health](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-synthesize.md): maintenance cycle · Reconciles contradictions, audits staleness, and extracts patterns. · `commands/obsidian-synthesize.md`
- [Thinking tools](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-challenge.md): inference workflows · Challenge, connect, emerge, and graduate as higher-order reasoning commands. · `commands/obsidian-challenge.md`
- [Ops views](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/commands/obsidian-board.md): navigation views · Boards, visualize, find, export, and related operational views over the vault. · `commands/obsidian-board.md`

### Automation layer

Background hooks and scheduled routines keep the vault coherent.

- [Bg agent](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/hooks/obsidian-bg-agent.sh): background hook · Post-compaction hook that continues maintenance outside interactive sessions. · `hooks/obsidian-bg-agent.sh`

### Provisioning & checks

Install, bootstrap, and validation scripts that create and audit the vault.

- [Setup chain](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/install.sh): bootstrap scripts · Install and setup scripts that provision the repo and select presets. · `install.sh`
- [Bootstrap vault](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/scripts/bootstrap_vault.py): provisioning script · Generates the initial vault structure and starter files. · `scripts/bootstrap_vault.py`
- [Vault health](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/scripts/vault_health.py): validation script · Programmatic audit of vault state and structural correctness. · `scripts/vault_health.py`

### Vault data model

Persistent Obsidian storage split into immutable sources and mutable knowledge.

- **Vault system**: obsidian store · Persistent Obsidian filesystem treated as the system of record.
- **Raw inputs**: immutable source · Original captured material kept as immutable source data.
- **Wiki notes**: managed knowledge · Claude-managed entities, concepts, projects, tasks, decisions, and notes.
- **Global state**: vault index · Core entry and state files such as index, log, soul, and critical facts.

### Policy & docs

Repository documentation and writing rules that define operating behavior.

- [References](https://github.com/eugeniughelbur/obsidian-second-brain/tree/main/references): policy layer · Schemas, templates, and write rules that govern note structure and behavior. · `references`
- [Repo docs](https://github.com/eugeniughelbur/obsidian-second-brain/blob/main/README.md): architecture docs · README, skill spec, and architecture notes describing intended operation. · `README.md`

## Connections

- Claude → Commands: executes · Claude selects a command to perform a vault workflow.
- Commands → World setup: bootstraps · Every session begins with shared context loading.
- Commands → Capture & ingest: captures · External material enters through ingestion workflows.
- Commands → Save & init: writes · Core save/init workflows update the vault state.
- Commands → Daily ops: operates · Daily logging and review routines run as named commands.
- Commands → Synthesis & health: maintains · Synthesis, reconciliation, export, and health keep the vault coherent.
- Commands → Thinking tools: reasons · Higher-order commands transform the vault into an inference engine.
- Commands → Ops views: renders · Navigation and analysis views expose the vault state.
- World setup → Vault system: loads context · Session bootstrap reads vault state before other work.
- Capture & ingest → Raw inputs: stores source · Original inputs are preserved in the immutable raw area.
- Capture & ingest → Wiki notes: rewrites · Ingested material updates entity, concept, and project notes.
- Capture & ingest → Global state: updates index · Ingestion can refresh global navigation and state files.
- Save & init → Vault system: creates structure · Initial save/init steps establish the vault layout.
- Daily ops → Global state: refreshes · Daily operations update logs and recurring state.
- Synthesis & health → Wiki notes: audits & reconciles · Maintenance scans notes for contradictions, gaps, and staleness.
- Thinking tools → Wiki notes: reads across · Reasoning workflows traverse the note graph for synthesis.
- Bg agent → Synthesis & health: continues · Background automation keeps maintenance running after compaction.
- Bg agent → Vault health: checks · Hooked automation can trigger health verification.
- Setup chain → Bootstrap vault: provisions · Install/setup scripts delegate vault initialization to bootstrap logic.
- Bootstrap vault → Vault system: initializes · Bootstrap creates the vault directories and starter files.
- Vault health → Vault system: audits · Validation inspects vault structure and consistency.
- References → Bootstrap vault: constrains · Schemas and rules shape how bootstrap and note generation behave.
- References → Commands: guides · Write rules and templates inform command behavior.
- Repo docs → References: describes · Repository documentation explains the policy and operating model.
- Repo docs → Commands: explains · Documentation frames the command ecosystem and workflows.
- Vault system → Raw inputs: separates · The vault model distinguishes immutable sources from managed notes.
- Vault system → Wiki notes: separates · The vault model distinguishes immutable sources from managed notes.
- Vault system → Global state: anchors · Global state files serve as navigation and identity anchors.
