# Claude To Obsidian

> Archive every Claude Code conversation into the Obsidian vault at ~/Documents/wiki as tagged, wikilinked markdown notes (chats/code/). Use when the user wants to track, export, sync, back up, or archive their Claude Code conversations/chats to Obsidian, set up automatic conversation tracking, or asks to "sync claude to obsidian", "save my chats", or catch up on un-exported sessions.

- Skill: `rohitguta2432/claude-to-obsidian` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add rohitguta2432/claude-to-obsidian`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rohitguta2432/claude-to-obsidian/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: rohitguta2432 (https://skillmd.com/u/rohitguta2432)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/rohitguta2432/claude-to-obsidian

---


# claude-to-obsidian

Mirrors Claude Code session transcripts (`~/.claude/projects/**/*.jsonl`) into the
Obsidian vault at `~/Documents/wiki/chats/code/` as clean markdown — one note per
session, with YAML frontmatter, auto-extracted `#tags`, and `[[wikilinks]]` back
into the vault.

## Pipeline

1. **`claude-extract`** (`claude-conversation-extractor`, uv tool) — JSONL → markdown.
2. **`claude_to_obsidian.py`** (bundled in `scripts/`) — adds frontmatter, tags from
   `KEYWORD_TAG_MAP`, wikilinks; files notes into `<vault>/chats/code/`.

Both are orchestrated by `scripts/sync.sh`, which **self-heals** (installs the
extractor via `uv` if missing) and is **idempotent** (safe to re-run / schedule).

## Quick start

```bash
# Full catch-up — export ALL sessions, file into the vault
bash ~/.claude/skills/claude-to-obsidian/scripts/sync.sh

# Fast incremental — only the N most recent sessions (good for hooks/cron)
bash ~/.claude/skills/claude-to-obsidian/scripts/sync.sh recent 10

# Preview without writing anything
DRY_RUN=1 bash ~/.claude/skills/claude-to-obsidian/scripts/sync.sh
```

The script prints how many notes the vault holds when done. To verify the gap before
running: compare `find ~/.claude/projects -name '*.jsonl' | wc -l` (total sessions)
against `ls ~/Documents/wiki/chats/code/*.md | wc -l` (already archived).

## Automatic tracking ("track all conversations")

The pipeline only runs when invoked. For continuous tracking, install ONE of:

- **Daily cron** (simple, portable):
  ```bash
  (crontab -l 2>/dev/null; echo "0 22 * * * bash $HOME/.claude/skills/claude-to-obsidian/scripts/sync.sh >/dev/null 2>&1") | crontab -
  ```
- **macOS launchd** (survives reboots, runs even if 22:00 was missed) — preferred on
  this machine. Template: `scripts/com.rohit.claude-obsidian.plist` (see below).
- **Claude Code `SessionEnd` hook** — archive the just-ended session immediately via
  `sync.sh recent 3`. Configure with the `update-config` skill; keep it `recent` (not
  `all`) so it stays fast.

Use the `AskUserQuestion` tool to confirm cadence/mechanism before installing any of
these — it's a persistent background change to the user's machine.

## Configuration

- Vault: `VAULT_DIR` (default `~/Documents/wiki`). Notes land in `chats/code/`.
- Tags: edit `KEYWORD_TAG_MAP` in `scripts/claude_to_obsidian.py` to match the user's
  stack/projects (already tuned: myfinancial, swing-india, resolvr, hunt, etc.).
- Log: `~/scripts/claude_obsidian_sync.log`.

## Notes & gotchas

- `--all` re-exports every session each run; processing **overwrites** existing notes
  in place (refreshes tags/wikilinks). Manual edits to `chats/code/*.md` will be lost
  on re-sync — curate elsewhere in the vault.
- Web chats (claude.ai) aren't auto-pulled; drop their markdown into
  `~/claude-exports/web/` and they're processed into `chats/web/` on the next run.
- The legacy `~/scripts/sync_claude_obsidian.sh` is superseded by this skill's
  `sync.sh` (self-healing + incremental mode). Safe to leave or delete.

