session-export can mirror your AI coding sessions into an Obsidian vault as
structured Markdown, alongside the usual SQLite export. The feature is opt-in
and shared across the supported harnesses — Kiro CLI, Codex, Claude Code,
OpenCode, pi, and Grok Build all flow into one folder, so your hand-written notes
stay clean.
Looking for the implementation spec or the GraphRAG follow-up? See
private-docs/obsidian-export.mdandprivate-docs/obsidian-graphrag-roadmap.md.
<vault>/
└── AgentMemory/
├── 2026-06-01-claude-code-myproject-1a2b3c4d.md ← one note per session
└── MOC/
├── _index.md ← project index
└── myproject.md ← per-project session list
Each note carries Dataview-ready YAML frontmatter:
---
type: agent-memory
id: 2026-06-01-claude-code-myproject-1a2b3c4d
created: 2026-06-01
updated: 2026-06-01
status: active
source_tool: claude_code
source_project: myproject
session_id: <full id>
git_branch: main
tags: [agent-memory, claude_code]
date: 2026-06-01
about: []
content_hash: 39fa1138
---The body holds a summary, key points, and a ## Related section of
[[wikilink]] backlinks to vault topic notes whose titles or aliases match the
session. Per-project MOC (map-of-content) notes list every session for a
project in reverse-chronological order.
obsidian_base (the flat config key) points StudyLoop at your study sources —
the notes you write and study from. The obsidian: section configures this
export sink — machine-generated session memory. Keeping them in a separate
AgentMemory/ folder means hundreds of auto-generated notes never dilute your
curated Sessions//Study/ material, while Dataview can still query across both.
Three ways, in order of convenience:
1. Per run (no config needed):
session-export --obsidian # sessions touched this run
session-export --obsidian --obsidian-backfill # one-time: ALL history (idempotent)
session-export --obsidian --obsidian-dry-run # preview counts, write nothing
session-export --obsidian --obsidian-vault ~/Obsidian/Personal # override path
session-export --no-obsidian # force-off even if config enables it2. Config (always on): add to ~/.config/studyloop/config.yaml:
obsidian:
export_enabled: true # turn the gate on
vault_path: ~/Obsidian/Personal # defaults to obsidian_base if omitted
memory_dir: AgentMemory
moc_dir: AgentMemory/MOC
backlinks: true
granularity: both # both | session3. Setup wizard: studyloop setup asks whether to enable export at the
Obsidian step and writes the section for you.
- A plain
--obsidianrun only writes sessions added or updated in that run (computed by diffing session timestamps before/after export). It does not re-scan your whole history every time. --obsidian-backfillwrites a note for every session in the database — the one-time "import everything" path. It is idempotent: acontent_hashin each note's frontmatter means unchanged notes are skipped on re-runs.
Because every note shares the type: agent-memory frontmatter, a Dataview block
surfaces your session history anywhere in the vault:
```dataview
TABLE source_project AS Project, source_tool AS Tool, date
FROM "AgentMemory"
WHERE type = "agent-memory"
SORT date DESC
```studyloop doctor (category config) validates the setup:
- the vault path exists and is a directory;
- it contains an
.obsidian/marker (warns if not — likely not a vault root); - when export is enabled, the
AgentMemory/directory is writable.
studyloop doctor --category config- Notes are written after the SQLite export commits, so an export failure never leaves the vault half-written.
- The writer is path-traversal hardened: untrusted session fields (e.g.
timestamps) are sanitised and a containment guard refuses any write outside
AgentMemory/. - Re-exports never duplicate: the content hash drives idempotent skips.
If you also use the second-brain layer, your vault has two StudyLoop folders. They hold different things and neither reads the other.
AgentMemory/ (this page) |
Study/ (Second Brain) |
|
|---|---|---|
| What it contains | one note per AI coding session | your study plans, today's action, due reviews, learning records |
| Where it comes from | the sessions database, via session-export --obsidian |
your plan Markdown documents |
| Written by | agent-session-tools |
studyloop brain publish |
| Turned on with | obsidian.export_enabled |
second_brain.provider |
| Your own notes | not applicable | Study/Plans/<plan-id>.notes.md, which StudyLoop only reads |
The split is deliberate: session memory is machine-generated history, while a study plan is material you read and revise. Mixing them would put a wall of transcript notes in the folder you open to decide what to study.
- Second Brain — publishing plans and today's study into a vault
- Setup Guide → Obsidian session-memory export
- CLI Reference → Obsidian Vault Export
- Architecture Overview