How I Gave Claude Code a Brain That Persists Across Every Project

Every time you open Claude Code in a new terminal, it starts fresh. No memory of who you are, how you like to work, what you've built before, or what mistakes it made last time. You're essentially onboarding a brand new developer every single session.

I got tired of that. So I built Claude a persistent brain.

Not a hack. Not a workaround. An actual architecture — an Obsidian vault that acts as long-term memory, a set of global skills that give it real capabilities, behavioral rules that make it efficient with tokens, and a boot sequence that loads all of this every time I open Claude Code, in any project, on any branch. The result is an AI agent that genuinely gets better the more I use it.

The Problem Nobody Talks About

Most people using Claude Code are leaving an insane amount of value on the table. They open it, ask a question, get an answer, and move on. Next session? Claude has no idea who they are. It doesn't know their codebase conventions, their preferred tech stack, that they hate trailing summaries, or that they got burned last time because it mocked the database instead of using a real one.

The real power of Claude Code isn't in the chat. It's in the infrastructure around the chat. The ~/.claude/ directory is where the magic happens — global skills, global rules, and a global CLAUDE.md that loads in every single session regardless of what project you're in.

What I Actually Built

Here's the architecture. It's surprisingly simple once you see it:

1. The Brain (Obsidian Vault)

I created a new Obsidian vault called ClaudeBrain with a clean folder structure:

ClaudeBrain/
├── Memory/
│   ├── User/        — who I am, how I work, what I prefer
│   ├── Projects/    — per-project context and decisions
│   └── Feedback/    — corrections I've given Claude
├── Research/        — deep research outputs
├── Learnings/       — patterns and solutions Claude discovered
└── Skills-Index/    — living catalog of every installed skill

This vault is Claude's long-term memory. When I correct its behavior, it saves that to Memory/Feedback/. When it completes a deep research task, the findings go to Research/. When I tell it something about myself — like that I'm a student, or that I work on certain projects — it saves that to Memory/User/ so it never has to ask again.

Because it's an Obsidian vault, I can open it anytime and browse everything Claude knows. It's not a black box. It's literally a folder of markdown files I can read, edit, or delete.

2. Global Skills

Skills live in ~/.claude/skills/ and are available in every project. I installed three major ones:

Obsidian Skills (kepano/obsidian-skills) — made by the CEO of Obsidian himself. Teaches Claude proper Obsidian-flavored markdown with wikilinks, callouts, and YAML properties. Also includes defuddle, which extracts clean markdown from web pages and saves a ton of tokens on web research.

Everything Claude Code (affaan-m/everything-claude-code) — this is the big one. 60+ skills, 12 specialized agents, self-healing hooks that auto-fix build errors, an instinct system that prevents token waste, and research-first development patterns. It's been production-tested for over 10 months.

Claude Command Suite (qdhenry/Claude-Command-Suite) — 216+ structured slash commands organized by namespace. Instead of typing "review my code for security issues" as an open-ended prompt, you use /security:audit which runs a focused, scoped workflow. Structured commands use way fewer tokens than open-ended questions.

3. The Boot Sequence

The global ~/.claude/CLAUDE.md is what ties everything together. It's only 26 lines — intentionally lean because every token in this file costs you on every single message. It tells Claude where the brain lives, how to save and retrieve memories, token efficiency rules, and behavioral expectations. That's it. No bloat.

4. Global Rules (Instincts)

Rules in ~/.claude/rules/ act as behavioral instincts. I have two custom ones — token efficiency rules that stop Claude from wasting tokens on things like repeating file contents back to me or adding trailing summaries, and memory habits that tell it when to read from and write to the brain. On top of that, the Everything Claude Code installer added 24+ language-specific rules for TypeScript, Python, and Swift covering coding style, security, testing, and performance.

Why This Actually Matters

Three things changed immediately:

Token efficiency went way up. The behavioral rules alone cut a lot of waste. No more trailing summaries. No more re-reading files already in context. No more open-ended prompts when a structured command exists. When your subscription has usage limits, every token saved is more actual work you can get done.

Context carries across sessions. When I open Claude Code in my blisspace repo tomorrow, it checks the brain first. It already knows the project structure, the decisions we made, and my preferences. I'm not starting from zero every time. That compounding effect is massive.

Self-healing capabilities. The Everything Claude Code package includes a build-error-resolver agent that auto-diagnoses and fixes build failures. When something breaks, Claude doesn't just show you the error — it has instincts for how to resolve common patterns. It learns from its own mistakes.

The Setup Prompt

I wanted to make this easy for anyone to replicate. Below is a prompt you can paste directly into Claude Code at the global level (~/.claude/ or just your home directory). It will build the entire brain architecture, install the skills, create the rules, and set up the boot sequence for you.

Before you run it, make sure you have git installed and Obsidian downloaded (it's free). After the prompt runs, just open Obsidian and add the new vault it creates.

"I want you to build a persistent brain and global skill system for Claude Code on this machine. Here's exactly what to do: 1. CREATE AN OBSIDIAN VAULT called 'ClaudeBrain' in my Documents folder (~/Documents/ClaudeBrain/). Create these folders inside it: Memory/User/, Memory/Projects/, Memory/Feedback/, Research/, Learnings/, Skills-Index/. Add a .obsidian/app.json with minimal config so Obsidian can open it as a vault. Add a README.md explaining the vault structure. 2. INSTALL GLOBAL SKILLS by cloning these repos into ~/.claude/skills/: - git clone https://github.com/kepano/obsidian-skills.git obsidian - git clone https://github.com/affaan-m/everything-claude-code.git everything-claude-code - git clone https://github.com/qdhenry/Claude-Command-Suite.git claude-command-suite After cloning everything-claude-code, run: cd ~/.claude/skills/everything-claude-code && npm install && node scripts/install-apply.js typescript python (add any languages you use) 3. CREATE ~/.claude/CLAUDE.md (the boot sequence) with UNDER 50 lines containing: - Where the brain vault lives (~/Documents/ClaudeBrain/) - Instructions to check Memory/ before non-trivial work and save learnings after - Instructions to update Skills-Index/installed-skills.md when skills change - Token efficiency rules: use Sonnet by default, /compact when context grows, no trailing summaries, no re-reading files in context, prefer structured commands over open-ended prompts - Use Obsidian-flavored markdown (wikilinks, callouts, YAML properties) 4. CREATE GLOBAL RULES in ~/.claude/rules/: - token-efficiency.md: don't repeat file contents, no trailing summaries, use most specific tool available, prefer structured skill invocations - memory-habits.md: when to read/write brain memory, when to update skills index, use Obsidian markdown format 5. CREATE Skills-Index/installed-skills.md in the brain vault listing every installed skill with: name, source repo, what it does (1 line), when to use it, and token cost (light/medium/heavy). 6. RUN A SECURITY AUDIT on all three cloned repos to make sure nothing is malicious — check for external data exfiltration, obfuscated code, suspicious URLs, and backdoors. Report findings. 7. SAVE an initial user profile to Memory/User/user-profile.md with what you know about me so far. After everything is set up, verify by listing all installed skills, confirming CLAUDE.md is under 50 lines, and checking the brain vault structure."

That's the whole thing. One prompt, and you have a Claude Code setup that remembers you, optimizes its own token usage, self-heals on build errors, and has 200+ structured commands at its disposal.

What Happens Next

The beauty of this system is that it compounds. Every session, Claude gets a little smarter about how you work. Every correction you give it gets saved to the brain. Every skill you install gets indexed automatically. The find-skills skill (which comes built-in) lets you discover and install new community skills with a single command, and the brain's Skills-Index updates itself.

We're at a point where the gap between people who configure their AI tools and people who just use the defaults is going to become enormous. The defaults are good. But a configured agent that remembers your preferences, knows your codebase patterns, and has specialized skills for your exact workflow? That's a fundamentally different tool.

The best part is that all of this is just markdown files and git repos. No vendor lock-in, no paid plugins, no API keys required. If Anthropic triples their prices tomorrow, your brain vault is still a folder of markdown files you own. Your skills are still git repos you control.

Build the brain. Let it compound. The rest follows.