Step-by-step answer
Core 45 min7 stepsWatch the agent loop in Claude Code
A synthetic contract pack, a headless Claude Code run over it saved as stream-json, and a summariser that turns the trace into one line per model turn. Grouping events by message id is what makes the turn count match the harness.
Back to the exercise