1421-Line While Loop

Description

The 1,421-line while(true) state-machine loop body in query.ts (lines 307-1728) that serves as the heartbeat of Claude Code — orchestrates compression, model calls, streaming tool execution, error recovery, hooks, and attachment injection per iteration.

Key claims

Relations

Sources

src-20260419-cfed81b8d6a5