No in-product recovery when a session grows too large to send (/compact requires the failing round-trip)
Problem
When a session grows large enough that its requests start failing, there is no way to recover it from inside Claude Code.
/compact is the natural remedy, but compaction works by sending the full conversation to the model to summarize — which is precisely the request that is failing. So the built-in fix is unreachable in the exact situation it exists for. --resume re-sends the same history and fails identically. The session is effectively dead with no in-product path back.
I had to write an external tool that parses the session .jsonl, prunes it to a recent subset of turns, and rewrites the file in place before --resume would work again. That recovered ~20 sessions, but it required understanding the transcript format, the parent-chain structure, and one non-obvious detail: parallel tool calls are split across sibling records sharing a message.id, and the tool_result for every block except the last hangs off the parent chain rather than on it. A naive prune drops those and produces a genuinely broken transcript.
What would help
- A local
/compact(or/truncate) that reduces the transcript without a model round-trip — even a crude "keep the last N turns" would be enough to make a session sendable again. - Or a documented offline recovery path, so users don't have to reverse-engineer the format under pressure.
Related: unhelpful error text
Many of these failures surface as an assistant message reading exactly:
No response requested.
This appeared on ~10 failures across my sessions. It does not indicate that a request failed, why, or what to do — and it is written into the transcript as a synthetic assistant turn with zero token usage. API Error: Unable to connect to API (ECONNRESET) at least names something actionable. Whatever path produces "No response requested." should surface the underlying error instead.
Environment
- Claude Code 2.1.220
- macOS (darwin 25.1.0)
- Model: Opus, 1M context