The Problem
AI coding agents start every session with zero context—no memory of goals, team dynamics, past decisions, or completed work. Users re-explain the same context repeatedly, and knowledge never compounds across sessions. This repo solves that by turning an Obsidian vault into persistent agent memory.
What This Does
obsidian-mind is a self-organizing Obsidian vault with hooks for Claude Code, Codex CLI, and Gemini CLI. It captures session context, meeting notes, incidents, and performance reviews into structured Markdown files under work/, org/, and perf/. Commands like /om-standup and /om-dump trigger the agent to read and update the vault automatically.
The core logic lives in .claude/scripts/—67 TypeScript files handling session start, memory indexing, note hygiene, and QMD semantic search integration. The .claude/agents/ directory defines specialized personas (e.g., slack-archaeologist.md, brag-spotter.md) that handle specific capture workflows. The bases/ folder contains Obsidian Bases for structured data like people directories and work dashboards.
How It Is Wired
Execution starts at main in .claude/scripts/generate-memory-index.ts:51, which reaches 72 functions. The session flow begins with .claude/scripts/session-start.ts, which reads hook input from stdin, checks the vault state, and formats context for the agent. The hook-io module (11 importers) handles stdin/stdout I/O and is the most-connected module—changing it breaks the most code.
Key routing happens through active-hygiene.ts (18 functions, 6 types), which parses open-loop configs and manages note cleanup, and qmd-refresh.ts, which triggers semantic search index rebuilds. The main-guard and regex modules are pure utilities with zero instability—safe to modify.
The call graph shows isMarkdownFilename called from 9 places and escapeRegex from 6—these are the highest-blast-radius functions. One function reads/writes a database (QMD index). The module graph has no circular dependencies (0 modules in cycles), which keeps refactoring tractable.
How To Use It
Setup (from README):
npm install -g shardmind
mkdir my-vault && cd my-vault
shardmind install github:bre
# or: git clone https://github.com/moses-y/obsidian-mind
Configuration: No env vars required. The vault uses .claude/settings.json for Claude Code settings and .codex/hooks.json/.gemini/settings.json for other CLIs. QMD integration needs the qmd binary installed separately.
Running it: Invoke commands in your agent CLI: /om-standup, /om-dump <text>, /om-incident-capture <url>, /om-wrap-up. Tests run via npm test in .claude/scripts/.
Real-World Use
A developer starts a session: "start session." The agent reads brain/North Star.md, checks work/active/, scans recent memories, and reports: "You're blocked on the BE contract. Your 1:1 with Sarah is tomorrow—review brief is ready." After the meeting, /om-dump creates work/1-1/Sarah 2026-03-26.md, updates org/people/Sarah Chen.md, adds a Decision Record, and appends to perf/Brag Doc.md.
Code Health & Issues
Measured analysis (static, not opinion) found 13 medium-severity findings across 4 kinds:
- Med - High branching density (x7):
session-start.tshas 86 branch points over 247 lines;qmd.tsandactive-hygiene.tssimilar. Decompose decision-heavy logic. - Med - Deep nesting (x4): Max indentation depth 6 in
active-hygiene.ts,session-start.ts. Flatten with guard clauses. - Med - Duplicated code blocks: 11 repeated 6-line blocks across 10 files. Extract shared helpers.
- Med - Oversized file:
tests/session-start.test.tsat 651 lines. Split by responsibility.
SDLC observations:
- High - No lockfile:
.claude/scripts/package.jsonhas no lockfile—non-reproducible builds. - High - Push to main:
.github/workflows/release.ymlpushes tomaindirectly, bypassing PR review. - Med - No least-privilege token: 3 workflows declare no
permissionsblock. - Med - No dependency scanning: No
dependabot.ymlor dependency-review-action in CI. - Med - Token persists after checkout:
persist-credentials: falsenot set in release workflow. - Low - No job timeouts: 4 workflows lack
timeout-minutes.
Tests exist (36 files) and CI runs on GitHub Actions. No committed secrets found.
The Bottom Line
This is a well-architected system for persistent agent memory with clean module boundaries and no circular dependencies. The TypeScript core is solid, but the missing lockfile and CI hardening (token permissions, dependency scanning) are production blockers. Worth adopting if you use Claude Code heavily and want structured memory—just fix the CI issues first.