中文 | English
How does Claude Code organize and update conversation history, user settings, and command behavior?
python examples/l5_state_commands.pystate/commands/history.tscontext.ts
AppStateStoresetStatecompacthistory
- which state needs immutable updates
- why slash commands look like a command registry instead of special syntax
- how history, UI state, and QueryEngine-local state are separated
The demo keeps the store and command shape. The real implementation has many more fields, longer lifetimes, and stricter persistence/effect boundaries.
- Why should message history not simply live inside a global singleton?
- Is
/compactmore like a tool, a UI event, or a state transition? - What kinds of state should persist across sessions, and what kinds should not?