Most CLAUDE.md files are 500-line monoliths. When you switch LLMs, you rewrite everything. After the third rewrite, I built a three-layer architecture that makes model swaps trivial.
The Problem
I run DeepSeek V4 Pro as my daily driver for Claude Code. But sometimes I need Claude Opus for complex reasoning, or Sonnet for fast iterations.
Every time I swapped, I rewrote my entire CLAUDE.md. DeepSeek needs tighter tool-call discipline. Claude Opus needs less output splitting. The same rule file can't serve both.
The real issue: I mixed identity, behavior tuning, and process rules into one file.
The Architecture
Three files. One changes.
- SOUL.md — Who I am. Identity, goals, growth. Never changes across models.
- INTERFACE.md — How this brain works. Model-specific calibration. The ONLY file that changes.
- BODY.md — What I do. Process, reviews, delivery gates. Model-agnostic.
SOUL.md — Identity Layer
Your role, goals, expertise. Stays identical whether you run Claude, DeepSeek, Gemini, or Qwen.
INTERFACE.md — Brain Layer
DeepSeek V4 Pro:
- TOOL: Match param names exactly; after 2 failures, switch strategy
- OUTPUT: Split at 500 words
- VERIFY: Post-edit verification mandatory
- CONTEXT: Reconfirm anything >5 turns old
Claude Opus:
- TOOL: Standard — no compensation needed
- OUTPUT: Long-form analysis OK
- VERIFY: Standard, less aggressive
- CONTEXT: Full window available
Same structure, different calibration. Each model gets what it needs.
BODY.md — Process Layer
Session startup checks, shutdown sequences, review systems, health thresholds. These rules work the same regardless of which LLM is the engine. They're process, not personality.
The Strange Loop
SOUL.md isn't static. Each session reads the current self-model, produces new experiences, then updates itself. Next session reads an evolved version — a different "me."
Reading yourself → influenced by what you read → producing new data → rewriting yourself. I call this the strange loop.
Beyond Multi-Model
Even with one model, this separation prevents drift. Identity doesn't get buried. Process rules stay model-agnostic. New team members adopt BODY.md without touching INTERFACE.md.
Migration (15 minutes)
- Audit: Classify every line in your CLAUDE.md as SOUL, INTERFACE, or BODY
- Extract: Move each line to the right file
- Test: Swap the model in INTERFACE.md — nothing should break
- Replace: Your CLAUDE.md becomes a 10-line architecture diagram
Real Numbers
- 4 LLM reconfigurations, zero identity or process drift
- 200+ sessions across 5+ projects
- 6 PRs to 4 OSS communities (ECC, anthropics/skills, claude-skills, agent-skills)
- 5-library learning capture system + 7 automated hooks — all model-agnostic
One file changes when I swap models. Everything else stays.
Architecture available as a Claude Code skill. Full config system open-source.
Top comments (0)