Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.21 Home All releases olderv2.1.20 v2.1.22newer
Claude Code v2.1.21

Enhanced Hook System for SDK Integration

What

The compacting system now uses structured progress callbacks instead of text spinner messages, enabling better programmatic integration.

Details
  • New onCompactProgress callback with { type, hookType } events
  • Hook types include "pre_compact" and "session_start"
  • Event types: "hooks_start" when hooks begin execution
  • Replaces legacy setSpinnerMessage calls with structured events
  • UI still displays "Running PreCompact hooks…" and "Running SessionStart hooks…" but via event-driven rendering
Evidence

Line 449199 (hook start event, K.onCompactProgress?.({ type: "hooks_start", hookType: "pre_compact" })), line 449280 (session start event, hookType: "session_start"), line 571772 (UI rendering, contains "Running PreCompact hooks…")

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

See this entry in the whole of v2.1.21 →