State Management Architecture
Overview
Claude Code uses a centralized store pattern for state management, similar to Zustand or Redux but custom-built. State is immutable and updates flow through a single pipeline.
┌─────────────────────────────────────────────────────────────────┐
│ STATE ARCHITECTURE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Actions │─────►│ Store │─────►│ Subscribers│ │
│ │ (setState) │ │ (AppState) │ │ (useAppState) │
│ └─────────────┘ └──────┬──────┘ └─────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Immutable │ │
│ │ State Tree │ │
│ └─────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘