Exbrain โ Your AI's External Brain
An AI knowledge system that automatically remembers, organizes, and reflects.
Claude Code ร Obsidian ร SOUL/MEMORY/DREAMS
๐ฏ๐ต ๆฅๆฌ่ช็ใฏใใกใ ยท Inspired by Karpathy's LLM Wiki
## What is Exbrain?
Exbrain turns Claude Code's hidden internal state โ Memory files, CLAUDE.md configs, Skills โ into a human-readable Obsidian vault. It adds a **Dreaming** layer that automatically reflects on your day, detects patterns, and builds a growth trajectory over time.
Your laptop can be closed. Your phone shows everything. You just open Obsidian and read.
## The SOUL / MEMORY / DREAMS Trinity
The core of Exbrain is three files at the root of your vault:
```
~/vault/
โโโ SOUL.md โ WHO you are (identity, values, boundaries)
โโโ MEMORY.md โ WHAT you've experienced (decisions, patterns, lessons)
โโโ DREAMS.md โ WHERE you're going (insights, growth, open questions)
```
### SOUL.md โ Identity
Defines who you are and how the AI should behave. Merged from Claude Code's CLAUDE.md and any external agent personality configs.
```markdown
## Identity
- Your name, role, company
## Values
- "Ship fast, iterate later"
- "API-first, no manual work"
## Boundaries (non-negotiable)
- "Never send emails โ drafts only"
- "Never post to Slack without confirmation"
## Tech Ecosystem
- APIs, MCP servers, CLI tools
```
### MEMORY.md โ Experience
A digest of everything the AI has learned. Auto-synced from Claude Code's Memory (`.claude/projects/*/memory/`) + enriched by Cloud Scheduled Tasks.
```markdown
## Recent
- [2026-04-07] Built Obsidian vault with SOUL/MEMORY/DREAMS
- [2026-04-06] Shipped new feature for Project Alpha
## Decisions
- Hybrid design: static mirror + Karpathy pattern + Dreaming
## Patterns
- Fridays are meeting-heavy (3 weeks in a row)
- Email replies concentrate in the afternoon
## CC Memory Summary (35 files)
- feedback/21: "Never send emails", "Always git commit after GAS edits"
- reference/7: API locations, tool configs
- project/4: Active project statuses
- user/1: User profile and preferences
```
### DREAMS.md โ Reflection
Updated automatically by Dreaming (morning + evening + weekly). Tracks patterns that emerge over time.
```markdown
## Current Insights
- Meeting density peaks on Mondays (10+ meetings, 3 consecutive weeks)
## Emerging Patterns
| Pattern | Count | Trend |
|---------|-------|-------|
| Tool โ Skill โ Automation cycle | 10+ | Consistent |
| Email/Slack send caution | 5+ | Critical boundary |
## Growth Trajectory
- Q1: Built 26 skills, automated 32 cron jobs
## Open Questions
- Should CC Memory duplicates be consolidated?
```
## Architecture
```
โโ Layer 1: Cloud Scheduled Tasks (no PC needed) โโโโโโโโโโโโโ
โ โ
โ 07:00 vault-daily-morning โ
โ โโโ Read SOUL.md (understand user context) โ
โ โโโ Read MEMORY.md (recent decisions & patterns) โ
โ โโโ Google Calendar โ today's schedule โ
โ โโโ Slack โ overnight highlights โ
โ โโโ Gmail โ important unread emails โ
โ โโโ Morning Dreaming (yesterday's review โ today's focus) โ
โ โโโ Update MEMORY.md Recent section โ
โ โโโ git push โ
โ โ
โ 18:30 vault-daily-evening โ
โ โโโ Read SOUL.md + MEMORY.md + DREAMS.md โ
โ โโโ Evening Dreaming (today + 7-day pattern detection) โ
โ โโโ Update MEMORY.md + DREAMS.md โ
โ โโโ Sunday: weekly Dreaming + Lint + Slack notification โ
โ โโโ git push โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ push
โผ
โโ GitHub (private repo) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ All vault files โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ pull (hourly via launchd)
โผ
โโ Layer 2: Local Automation โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Claude Code Hooks (async: true) โ
โ โโโ PostToolUse โ log file changes โ
โ โโโ Stop โ append session end to daily note + MEMORY.md โ
โ โ
โ External Agent Cron (when PC is on) โ
โ โโโ Additional data: Salesforce, Stripe, HERP, YouTube โ
โ โโโ Skipped when PC is off (Layer 1 is self-sufficient) โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ iCloud sync
โผ
Obsidian (Mac + iPhone)
```
## Vault Structure
```
~/vault/
โโโ SOUL.md โ Identity, values, boundaries
โโโ MEMORY.md โ Experience digest (CC Memory mirror)
โโโ DREAMS.md โ Dreaming accumulation (auto-updated)
โโโ CLAUDE.md โ Schema (LLM rules for this vault)
โ
โโโ daily/ โ Daily notes (auto-generated morning & evening)
โ โโโ 2026-04-07.md Schedule / Gmail / Slack / AI Analysis /
โ Morning Reflection / Evening Reflection /
โ Claude Code Session / Thoughts
โ
โโโ system/ โ Claude Code system mirror (SYNCED)
โ โโโ claude-md-tree.md All CLAUDE.md files as a tree
โ โโโ global-rules.md Rules & boundaries summary
โ โโโ api-inventory.md API list (no keys)
โ โโโ tech-stack.md Technology stack
โ โโโ cron-jobs.md Running cron jobs
โ
โโโ skills/ โ All skills with details (SYNCED)
โโโ memory/ โ CC Memory individual file mirror (SYNCED)
โ โโโ feedback/ Behavioral guidelines
โ โโโ reference/ External system pointers
โ โโโ project/ Project statuses
โ โโโ user/ User profile
โ
โโโ clients/ โ Client knowledge (Karpathy pattern)
โโโ meetings/ โ Meeting summaries (auto from /auto-minutes)
โโโ decisions/ โ Decision log
โโโ insights/ โ Learnings + weekly Dreaming
โโโ templates/ โ daily-note, meeting, decision
โโโ scripts/ โ Hook scripts + sync scripts
```
## Hybrid Design: Three Personalities
```
vault/
โโโ system/, skills/, memory/
โ โ Static mirror (dashboard)
โ โ Auto-synced from Claude Code, read-only
โ โ header
โ
โโโ daily/
โ โ Auto log + handwritten diary
โ โ Calendar + Slack + Gmail + AI Analysis + Dreaming
โ โ Runs even with PC closed (Cloud Scheduled Tasks)
โ
โโโ meetings/, clients/, insights/
โ Karpathy pattern (compounding knowledge)
โ Each meeting processed โ client page auto-enriched
โ No need to re-read 12 meeting transcripts
```
## Setup
### Prerequisites
- Claude Code (Pro or Max)
- Obsidian (free)
- GitHub account
- (Optional) Slack / Google Calendar / Gmail Connectors
### Step 1: Create Vault
```bash
mkdir -p ~/vault/{daily,system,skills,memory/{feedback,reference,project,user},clients,meetings,decisions,insights,templates,scripts}
# iCloud sync (for iPhone)
mv ~/vault ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/exbrain
ln -s ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/exbrain ~/vault
```
### Step 2: Copy Templates
```bash
git clone https://github.com/YOUR_USERNAME/exbrain.git /tmp/exbrain
cp -r /tmp/exbrain/vault-template/* ~/vault/
```
### Step 3: Configure Hooks
Add to `~/.claude/settings.json`:
```json
{
"hooks": {
"PostToolUse": [{
"matcher": "Write|Edit",
"hooks": [{
"type": "command",
"command": "bash ~/vault/scripts/on-file-change.sh",
"async": true
}]
}],
"Stop": [{
"hooks": [{
"type": "command",
"command": "bash ~/vault/scripts/on-session-end.sh",
"async": true
}]
}]
}
}
```
### Step 4: Initial Sync
In Claude Code:
```
Please read all my skills from ~/.claude/skills/, all memory files from
~/.claude/projects/*/memory/, and sync them to ~/vault/. Create SOUL.md
with my identity and MEMORY.md with a digest of all memories.
```
### Step 5: GitHub Backup
```bash
cd ~/vault
git init && git add -A && git commit -m "Initial vault"
gh repo create my-vault --private --source=. --push
```
### Step 6: Cloud Scheduled Tasks (PC-free automation)
At [claude.ai/code/scheduled](https://claude.ai/code/scheduled):
- **vault-daily-morning** (07:00): Read SOUL.md โ Calendar + Slack + Gmail โ daily note + Morning Dreaming
- **vault-daily-evening** (18:30): Read SOUL.md + MEMORY.md + DREAMS.md โ Evening Dreaming + pattern detection
## Daily Note Example
```markdown
---
date: 2026-04-07
weekday: Monday
type: daily
score: 74
---
## Schedule
| Time | Event | Note |
|------|-------|------|
| 09:00 | Management meeting | |
| 10:00 | Sales standup | |
| 14:00 | Company standup | |
## Gmail
| From | Subject | Action |
|------|---------|--------|
| [Contact] | Project meeting request | Reply needed |
## Slack Highlights
- **#general**: Organization restructuring discussion
- **#sales**: New lead from inbound campaign
- **#daily-report**: Project Beta milestone reached
## Morning Reflection
- Yesterday's decision: Revised product roadmap
- Today's focus: Follow up on pending proposals
## Evening Reflection
- Highlight: Project Beta milestone reached
- Pattern: Mondays consistently have 10+ meetings (3 weeks)
- Unresolved: Partner meeting follow-up
## Thoughts
```
## Scripts Included
| Script | Purpose |
|--------|---------|
| `on-session-end.sh` | Stop hook: appends session summary to daily note + MEMORY.md |
| `on-file-change.sh` | PostToolUse hook: logs CLAUDE.md/memory/skill changes |
| `weekly-sync.sh` | Weekly lint: broken links, orphan pages, stale content |
| `git-pull-sync.sh` | Hourly git pull with stash handling |
| `sync-agent-to-vault.sh` | Enriches daily notes from external agent JSON data |
All scripts are macOS-compatible (no GNU extensions), reviewed for security (no shell injection, PID-based locking instead of flock).
## References
- [Karpathy's LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) โ The original pattern
- [Claude Code Hooks](https://docs.anthropic.com/en/docs/claude-code/hooks) โ async hook documentation
- [Cloud Scheduled Tasks](https://docs.anthropic.com/en/docs/claude-code/scheduled-tasks) โ PC-free automation
- [QMD](https://github.com/tobi/qmd) โ Markdown semantic search (for 100+ pages)
## License
MIT