Exbrain Banner

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. ## How It Works โ€” For Beginners If you're new to Claude Code or Obsidian, here's the big picture: ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ YOU (Human) โ”‚ โ”‚ โ”‚ โ”‚ Work with Claude Code Bookmark on X Send URL in Slackโ”‚ โ”‚ โ†“ โ†“ โ†“ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ–ผ โ–ผ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Claude Code โ”‚ โ”‚ Cron Job (Auto) โ”‚ โ”‚ Always-On Agent โ”‚ โ”‚ (Local CLI) โ”‚ โ”‚ Every 4 hours โ”‚ โ”‚ (e.g. OpenClaw) โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ€ข /clip skill โ”‚ โ”‚ โ€ข X bookmark sync โ”‚ โ”‚ โ€ข Slack listener โ”‚ โ”‚ โ€ข Hooks (auto) โ”‚ โ”‚ โ€ข xurl API โ”‚ โ”‚ โ€ข URL detection โ”‚ โ”‚ โ€ข Session logs โ”‚ โ”‚ โ”‚ โ”‚ โ€ข firecrawl โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ ~/vault/ (Git) โ”‚ โ”‚ โ”‚ โ”‚ SOUL.md MEMORY.md โ”‚ โ”‚ DREAMS.md โ”‚ โ”‚ daily/ clips/ โ”‚ โ”‚ clients/ insights/ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ–ผ โ–ผ โ–ผ GitHub iCloud Obsidian (backup) (sync) (Mac+iPhone) ``` ### Components Explained | Component | What it is | Role in Exbrain | |-----------|-----------|-----------------| | **Claude Code** | Anthropic's AI coding CLI ([docs](https://docs.anthropic.com/en/docs/claude-code)) | Your main AI assistant. Runs skills like `/clip`, writes to vault, manages hooks | | **Obsidian** | Free markdown note app ([obsidian.md](https://obsidian.md)) | Where you **read** everything. Vault = folder of .md files. Works on Mac, iPhone, Android | | **Always-On Agent** | A background AI (e.g. [OpenClaw](https://openclaw.com)) | Monitors Slack/Discord 24/7. Runs cron jobs even when Claude Code is closed | | **Cloud Scheduled Tasks** | Claude Code's built-in scheduler ([docs](https://docs.anthropic.com/en/docs/claude-code/scheduled-tasks)) | Runs morning/evening Dreaming without your PC. Updates MEMORY.md and DREAMS.md | | **xurl** | X API CLI tool | Fetches tweets and bookmarks from X (Twitter) | | **Firecrawl** | Web scraping CLI | Converts any URL into clean markdown | | **iCloud** | Apple's cloud sync | Syncs vault between Mac and iPhone automatically | | **GitHub** | Code hosting | Backup + version history for your vault | ### Data Flow: What Happens When You Clip ``` You find an interesting article โ”‚ โ–ผ โ”Œโ”€ Pick your method โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ A) /clip URL B) Slack DM C) Just โ”‚ โ”‚ in Claude Code send URL bookmark โ”‚ โ”‚ โ”‚ โ”‚ on X โ”‚ โ”‚ โ–ผ โ–ผ โ”‚ โ”‚ โ”‚ Claude Code Agent detects (wait 4h) โ”‚ โ”‚ runs instantly URL in real-time โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ AI Processing โ”‚ โ”‚ โ”‚ โ”‚ 1. Fetch contentโ”‚ โ”‚ 2. Summarize โ”‚ โ”‚ 3. Tag (auto) โ”‚ โ”‚ 4. Save .md โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ vault/clips/x/2026-04-08_slug.md โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ–ผ โ–ผ โ–ผ _index.md daily note git push updated updated to GitHub โ”‚ โ–ผ iCloud sync โ”‚ โ–ผ ๐Ÿ“ฑ Read on iPhone ``` ### System Relationship Map ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ Claude Code โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ ~/vault/ โ”‚โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ (CLI agent) โ”‚ writes โ”‚ (Obsidian) โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ writesโ”‚ โ”‚ โ”‚ โ”‚ Skills: โ”‚ โ”‚ SOUL.md โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ /clip โ”‚ โ”‚ MEMORY.md โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ /auto-mins โ”‚ โ”‚ DREAMS.md โ”‚ โ”‚ Cloud โ”‚ โ”‚ โ”‚ โ”‚ 30+ more โ”‚ โ”‚ daily/ โ”‚ โ”‚Schedule โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ clips/ โ”‚ โ”‚ Tasks โ”‚ โ”‚ โ”‚ โ”‚ clients/ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ meetings/ โ”‚ โ”‚ Morning โ”‚ โ”‚ โ”‚ โ”‚ Always-On โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ insights/ โ”‚ โ”‚ Evening โ”‚ โ”‚ โ”‚ โ”‚ Agent โ”‚ writes โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ (OpenClaw) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ Cron jobs: โ”‚ git push/pull โ”‚ โ”‚ โ”‚ X bookmarks โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ Slack DM โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ Reports โ”‚ โ”‚ GitHub โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ (private) โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ โ”€โ”€โ”€ All connected via ~/vault/ โ”€โ”€โ”€ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ## 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? ``` ## Clips โ€” Knowledge Clipping Clips automatically captures tweets and articles into your vault. Like Karpathy's compounding knowledge pattern, everything you read accumulates and becomes searchable in Obsidian. ### Three Ways to Clip | Method | Trigger | Best for | |--------|---------|----------| | **`/clip` skill** | `/clip ` in Claude Code | Working at your desk, high-quality summaries | | **Slack DM** | Post URL in Slack DM to your agent | On the go (phone), instant capture | | **X Bookmark Sync** | Automatic every 4 hours | Passive โ€” just bookmark on X, it syncs | ### 1. `/clip` โ€” Manual Clip in Claude Code ``` /clip https://x.com/karpathy/status/1234567890 /clip https://example.com/great-article /clip https://url1.com https://url2.com # multiple URLs ``` Detects X tweet vs article automatically. Fetches content, generates summary + tags in Japanese, saves to `clips/`, updates daily note, and pushes to git. ### 2. Slack DM โ€” Clip from Your Phone Just send a URL to your agent's Slack DM: ``` https://example.com/interesting-article ``` The agent detects the URL, scrapes the content, generates a summary, saves to `clips/`, and replies in a thread: ``` ๐Ÿ“Ž Clipped! ๐Ÿ“„ How LLMs Will Change Everything ๐Ÿท๏ธ #ai #llm #future ๐Ÿ“ vault/clips/articles/2026-04-08_llm-change-everything.md ``` **Setup**: Requires an always-on agent (like [OpenClaw](https://openclaw.com)) with Slack Socket Mode. Add the URL detection behavior to your agent's auto-actions. See [Slack Clip Setup](#slack-clip-setup) below. ### 3. X Bookmark Auto-Sync Bookmark tweets on X as you normally would. A cron job syncs them to your vault automatically. **Default schedule**: Every 4 hours (8:00, 12:00, 16:00, 20:00) **Requirements**: [xurl](https://github.com/twitterdev/xurl) CLI with OAuth2 authentication. ```bash # Test manually xurl bookmarks -n 5 --auth oauth2 ``` ### Clip File Format ```markdown --- date: 2026-04-08 type: clip source: x | article url: https://... author: "@username" tags: [ai, claude-code, agent] via: slack | cli | cron # how it was clipped --- ## Summary (3-5 line summary in your language) ## Key Points - Point 1 - Point 2 ## Notes > Important quotes ## Related [[insights/...]] | [[clips/...]] ``` ### Daily Note Integration Each clip is automatically linked in the day's daily note: ```markdown ## Clips - [[clips/x/2026-04-08_sam-altman-social-contract]] โ€” Sam Altman's social contract - [[clips/articles/2026-04-08_karpathy-llm-wiki]] โ€” Karpathy LLM Wiki pattern ``` ### Dataview Queries Browse clips by tag in Obsidian: ```dataview TABLE rows.date, rows.source, rows.author FROM "clips" WHERE type = "clip" FLATTEN tags as tag GROUP BY tag SORT rows.date DESC ``` ### Slack Clip Setup To enable Slack DM โ†’ clip, add this auto-action to your agent: 1. **Create skill files** in your agent's workspace: ``` workspace/skills/slack-clip/ โ”œโ”€โ”€ SKILL.md โ† Skill overview โ”œโ”€โ”€ BEHAVIOR.md โ† Detection rules + processing flow โ””โ”€โ”€ processed-clips.json โ† Deduplication tracking ``` 2. **Add auto-action** to your agent's config (e.g., `AGENTS.md`): ```markdown ### URLๆŠ•็จฟ โ†’ Vaultใ‚ฏใƒชใƒƒใƒ— DM ใซURLใ‚’ๅซใ‚€ใƒกใƒƒใ‚ปใƒผใ‚ธใŒๆฅใŸใ‚‰่‡ชๅ‹•ใงvault/clips/ใซไฟๅญ˜ใ€‚ ๆคœ็Ÿฅๆ–นๆณ•: - ใƒกใƒƒใ‚ปใƒผใ‚ธใƒ†ใ‚ญใ‚นใƒˆใซ https:// ใ‚’ๅซใ‚€๏ผˆ่ปข้€ใƒกใƒƒใ‚ปใƒผใ‚ธใฏ้™คๅค–๏ผ‰ - Slackๅ†…้ƒจURLใ€็”ปๅƒ็›ดใƒชใƒณใ‚ฏใฏ้™คๅค– ๅ‡ฆ็†: 1. URL็จฎๅˆฅๅˆคๅฎš๏ผˆX tweet vs ่จ˜ไบ‹๏ผ‰ 2. X tweet โ†’ xurl read / ่จ˜ไบ‹ โ†’ firecrawl scrape 3. ่ฆ็ด„ใƒปใ‚ฟใ‚ฐ็”Ÿๆˆ โ†’ vault/clips/ ใซไฟๅญ˜ 4. git push + ใ‚นใƒฌใƒƒใƒ‰่ฟ”ไฟกใง็ขบ่ช ``` 3. **Ensure tools are available** to the agent: - `xurl` (X API CLI) with OAuth2 auth - `firecrawl` (web scraping CLI) - Git access to your vault repo ### X Bookmark Cron Setup Add a cron job to your agent scheduler: ```json { "name": "clip-x-bookmarks", "schedule": "0 8-23/4 * * *", "message": "Fetch X bookmarks with `xurl bookmarks -n 20 --auth oauth2`, check for duplicates in vault/clips/x/, summarize new ones, save to vault/clips/x/, update _index.md, git push." } ``` ## 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 โ”‚ โ”œโ”€โ”€ clips/ โ† Clipped tweets & articles (auto + manual) โ”‚ โ”œโ”€โ”€ x/ X bookmarks (auto-synced every 4 hours) โ”‚ โ”œโ”€โ”€ articles/ Web articles (via /clip or Slack) โ”‚ โ”œโ”€โ”€ _index.md Clip index (auto-updated) โ”‚ โ””โ”€โ”€ tags.md Tag-based classification (Dataview) โ”‚ โ”œโ”€โ”€ clients/ โ† Client knowledge (Karpathy pattern) โ”œโ”€โ”€ meetings/ โ† Meeting summaries (auto from /auto-mins) โ”œโ”€โ”€ 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 | | `sync-x-bookmarks.sh` | Auto-fetches X bookmarks + clips (every 4 hours) | 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