- Debug-log all hook firings unconditionally (name, cmd, exit, context_len)
- Emit "N hook(s) run" to chat for lifecycle hooks (agentSpawn, pre/postCompact,
pre/postClear); suppress per-turn hooks (userPromptSubmit, stop) from chat
- Store env.Messages (MCP connections) on agentCore; emit to chat on first turn,
debug-log unconditionally
- Replace inline s.state assignments with setState() so debug logs emit only
on state transitions, not on every State() poll
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>