State Management
How the application tracks and shares state across its many subsystems.
Two Layers of State
Claude Code uses two distinct state management patterns:
- Bootstrap State — Global singleton with getter/setter functions
- AppState Store — Redux-like store with React integration
Bootstrap State (bootstrap/state.ts)
A singleton module that holds global session state. Think of it as "carefully managed global variables."