Turn every AI chat into one searchable brain, then teach Claude to read it.
Unify your terminal Claude Code history, your Claude.ai web chats, and your ChatGPT conversations into one Obsidian vault. Then install a tiny skill so Claude reads it before any code work — no more re-explaining a project for the tenth time. About 60 minutes hands-on today + 30 minutes when your exports arrive.
What you'll need.
Three things make this work: Claude Code (the CLI engine that runs the parallel sub-agents and reads the brain), Obsidian (the viewer), and Python 3 (for the parser scripts). Tick these off before you dive in.
Tick these off as you go
- Claude Code installed (the CLI) — the engine that runs the parallel sub-agents
- Obsidian installed (free, from obsidian.md) — the app that browses your vault
- Python 3.10+ available on your shell — for the parser scripts
- ~500 MB free disk for a typical 1–2 year history
- About 60 minutes hands-on today, plus 30 minutes when your exports arrive
Start ChatGPT first, then Claude, then clone the scripts.
ChatGPT's export can take 1–3 days, so kick it off first to start the timer. Claude.ai's export arrives in about 5 minutes. While you wait, clone the script repo — we'll use it in the next section to build the vault from your terminal Claude Code history, which is already on disk and ready to go.
- Go to chatgpt.com
- Click your profile icon → Settings
- Open Data Controls
- Click "Export data"
- Be patient — the email can take a couple days
- When it lands, download the ZIP and unzip it
- Inside, you'll find one or more
conversations-XXX.jsonfiles
- Go to claude.ai
- Click your profile icon in the bottom-left corner
- Open Settings
- Click "Export Data" under Privacy
- Your download link arrives within 5 minutes
- Unzip the file — the folder contains a
conversations.jsonfile plus a few extras
- Open your terminal
- Run the clone command below ↓
- Every script and prompt referenced in the rest of this guide lives in the repo
$ git clone https://github.com/M1w234/claude-brain-builder ~/claude-brain-builder $ cd ~/claude-brain-builder
Your local Claude Code history is the first data source.
Claude Code stores every terminal conversation locally as JSONL under ~/.claude/projects/. That data is already on disk — no export wait. We'll parse it into markdown first, then layer the Claude.ai and ChatGPT web exports on top in later sections.
Scaffold the vault directory
- Open your terminal
- Run the scaffold command below to create the vault folders ↓
- Copy the scripts from the cloned repo into the vault's build directory
$ mkdir -p ~/ClaudeCodeBrain/{projects,topics,tools,entities,_build/scripts,_build/reports,_build/assignments} $ cp ~/claude-brain-builder/scripts/*.py ~/ClaudeCodeBrain/_build/scripts/
Parse your terminal JSONL → markdown
- Run the export script — it walks
~/.claude/projects/, dedupes by working directory (worktrees collapse to their root), wraps tool calls in collapsible blocks, and writes one markdown file per session - Wait for the "wrote N sessions" message — usually under a minute even for years of history
$ python3 ~/ClaudeCodeBrain/_build/scripts/export.py
~/ClaudeCodeBrain/projects/<project>/sessions/. Each one has YAML frontmatter (session id, project, date) plus the rendered conversation. If you have nothing in ~/.claude/projects/ yet, skip ahead to Section 06 and start with your web exports.Ten parallel sub-agents tag and link every conversation.
The export gave you raw markdown files. This step uses Claude Code to spawn 10 sub-agents in parallel, each extracting topics, tools, and entities from a slice of your sessions and weaving them together with wikilinks. Then a Python script consolidates the results into hub pages.
1. Split sessions into 10 balanced slices
- Run the splitter — it does balanced bin-packing so all 10 agents finish at roughly the same time
$ python3 ~/ClaudeCodeBrain/_build/scripts/split_assignments.py
2. Dispatch 10 backlink agents inside Claude Code
- Open a Claude Code window (anywhere — your home directory works fine)
- Paste the orchestration prompt below ↓ — Claude will read the agent instructions and spawn all 10 sub-agents in parallel
- Wait for all 10 completion messages (~5–15 minutes wall-clock)
Spawn 10 parallel backlink agents using the Agent tool. Each agent gets a number 01-10. Brief each one with the instructions at ~/claude-brain-builder/prompts/backlink_terminal_agent.md and its assignment list at ~/ClaudeCodeBrain/_build/assignments/agent_NN.txt. Set run_in_background: true for all 10. Reports go to ~/ClaudeCodeBrain/_build/reports/agent_NN.json.
3. Consolidate the reports into hub pages
- Run the consolidate script — it reads all 10 JSON reports and writes one markdown page per topic, tool, and entity into
topics/,tools/,entities/, plus aTOP-TOPICS.mdleaderboard - Run the rollup script — it walks the vault and rebuilds the project index + the top-level README from disk
- Open Obsidian → Open folder as vault → pick
~/ClaudeCodeBrain/→ confirm the README renders and the project index is populated
$ python3 ~/ClaudeCodeBrain/_build/scripts/consolidate.py $ python3 ~/ClaudeCodeBrain/_build/scripts/rebuild_rollups.py
Teach Claude to read your brain before it writes any code.
Without this step, the vault is just a searchable archive. With it, Claude Code reads your past sessions before any code work whenever you use a trigger phrase like "let's work on X" or "check my brain for Y." That's the difference between an archive and a brain.
1. Drop the skill into Claude Code
- Create the skill directory and copy the skill file from the repo ↓
- Restart any running Claude Code sessions so the new skill loads
$ mkdir -p ~/.claude/skills/claude-brain $ cp ~/claude-brain-builder/skill/claude-brain/SKILL.md ~/.claude/skills/claude-brain/
2. Drop the /slay sync command
- Copy the slay command file into your Claude Code commands directory ↓
/slaywill pull any new Claude Code sessions into the vault incrementally, without re-running the 10-agent backlink pass
$ mkdir -p ~/.claude/commands $ cp ~/claude-brain-builder/commands/slay.md ~/.claude/commands/
3. Test it
- Open a fresh Claude Code window in any directory
- Type one of the trigger phrases (substitute a real project name) ↓
- Claude should pause, read the vault README and the project rollup, then summarize what you built before doing anything else
- If Claude just dives straight into code without reading first, double-check that
~/.claude/skills/claude-brain/SKILL.mdexists
let's work on my-project
Same pattern, twice: parse → 10 agents → consolidate.
Your Claude.ai export should already be in your inbox (it arrives in ~5 min). ChatGPT takes 1–3 days. When each one lands, you'll use the same flow: a Python script to parse the JSON into markdown, 10 parallel sub-agents to backlink, then re-run consolidate. All three data sources end up cross-linked in the same topic/tool/entity hubs.
When the Claude.ai email arrives (~5 min)
- Download the ZIP from Anthropic's email and unzip it
- Run the importer below, pointing at the unzipped folder ↓
- Re-run the splitter for the web archive, then dispatch 10 more sub-agents (different prompt — see the repo)
- Re-run the consolidate script to merge the web archive into the same topic hubs as your terminal work
$ python3 ~/ClaudeCodeBrain/_build/scripts/import_claude_web.py /path/to/claude-export-dir $ mkdir -p ~/ClaudeCodeBrain/_build/{web_assignments,web_reports} $ python3 ~/ClaudeCodeBrain/_build/scripts/split_web_assignments.py
Spawn 10 parallel web backlink agents using the Agent tool. Each gets a number 01-10. Brief each with ~/claude-brain-builder/prompts/backlink_web_agent.md and its assignment list at ~/ClaudeCodeBrain/_build/web_assignments/agent_NN.txt. Reports go to ~/ClaudeCodeBrain/_build/web_reports/agent_NN.json. Set run_in_background: true for all 10.
$ python3 ~/ClaudeCodeBrain/_build/scripts/consolidate.py
When the ChatGPT email arrives (1–3 days)
- Download the ChatGPT ZIP from OpenAI's email and unzip it
- Run the ChatGPT importer below — it follows the displayed-thread chain and writes one markdown file per conversation, using the same frontmatter shape as the Claude.ai import
- Re-run the web splitter (it picks up the new files), dispatch 10 sub-agents with the same web backlink prompt, then re-run consolidate
$ python3 ~/ClaudeCodeBrain/_build/scripts/import_chatgpt.py /path/to/chatgpt-export-dir $ python3 ~/ClaudeCodeBrain/_build/scripts/split_web_assignments.py
One brain, three sources, indefinitely fresh.
Here's what comes out the other side, what to run periodically to keep it current, and a final checklist that covers both today's session and the future ones when your exports arrive.
Every conversation as a markdown file
Terminal sessions, Claude.ai chats, and ChatGPT chats all stored locally as markdown with YAML frontmatter. Portable, searchable, and ready to live forever in plain text.
Topic, tool, and entity hubs
Every conversation tagged with the topics, tools, and entities it touched. topics/n8n-workflow.md shows every chat across all three sources that mentioned n8n.
Auto-recall in every Claude Code session
Say "let's work on X" in any new Claude Code window and the claude-brain skill reads the relevant project rollup before any code work. No more re-priming.
Full-text search across years
Cmd+Shift+F in Obsidian searches every conversation you've ever had with any of the models. That thing you said three years ago is right there.
Incremental sync via /slay
Run /slay in any Claude Code window to pull in new terminal sessions since your last sync. Backlinks on old sessions stay intact. Re-run the full agent pass when you've accumulated 30+ new sessions.
Quick reference
| Data source | Export time | File format | Where to find it |
|---|---|---|---|
| Terminal Claude Code | none | JSONL on disk | ~/.claude/projects/ |
| Claude.ai web | ~5 min | conversations.json |
Settings → Privacy → Export Data |
| ChatGPT | 1–3 days | conversations-XXX.json |
Settings → Data Controls → Export |
Everything covered, in one list
A condensed version of the whole build — useful as a one-page reminder when you come back to do this on a second machine, or hand it to someone you're walking through it.
Session one — today
- Kicked off the ChatGPT export (Settings → Data Controls → Export)
- Requested the Claude.ai export (Settings → Privacy → Export Data)
- Cloned
https://github.com/M1w234/claude-brain-builderto~/claude-brain-builder/ - Installed Claude Code, Obsidian, and Python 3.10+
- Scaffolded
~/ClaudeCodeBrain/and ranexport.pyon terminal sessions - Spawned 10 parallel backlink agents and waited for all completion messages
- Ran
consolidate.pyandrebuild_rollups.py - Copied
SKILL.mdto~/.claude/skills/claude-brain/ - Copied
slay.mdto~/.claude/commands/ - Tested with "let's work on X" in a fresh Claude Code session — Claude read the vault first
- Opened the vault in Obsidian, hit Cmd+G, confirmed the graph rendered
Session two — when the export emails arrive
- Downloaded the Claude.ai export and ran
import_claude_web.py - Dispatched 10 web backlink sub-agents and waited for all completions
- Re-ran
consolidate.py— Claude.ai conversations folded into the same topic hubs - Downloaded the ChatGPT export (1–3 days later) and ran
import_chatgpt.py - Dispatched 10 more sub-agents and re-ran consolidate
- Set a recurring reminder to run
/slayafter meaningful Claude Code sessions - Grepped the vault for
sk-,AIzaSy, andeyJbefore sharing it with anyone