tool_result content > threshold → stub with summary
tool_use input for write ops (+ broad fallback) → stub large fields
thinking blocks → remove entirely (signature is required by API)
API usage metadata → strip
Everything else → preserved verbatim
Rows left with no content (e.g. a thinking-only assistant row) are dropped
and their children re-linked to the nearest kept ancestor, so the
parentUuid chain Claude Code walks on resume stays unbroken.
Trim a JSONL session file: strip bloat, keep conversation.
Rules:
Rows left with no content (e.g. a thinking-only assistant row) are dropped and their children re-linked to the nearest kept ancestor, so the parentUuid chain Claude Code walks on resume stays unbroken.