claude-code - 💡(How to fix) Fix claude --resume hangs on large session files; Ctrl+C does not interrupt [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52995Fetched 2026-04-25 06:15:13
View on GitHub
Comments
3
Participants
3
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×5commented ×3cross-referenced ×1

claude --resume hangs indefinitely when the selected session .jsonl is large or contains very long individual lines. The process stays alive at low CPU (~1–2%) with no progress, and Ctrl+C (SIGINT) does not interrupt itkill -9 is required to recover.

Closed issues #22204 and #21067 describe the resume hang, but it still reproduces on the current version, and the signal-handling aspect (unresponsive to Ctrl+C) is not covered by either.

Error Message

  • Resume completes in reasonable time, or fails fast with a clear error when the session is too large / malformed.

Root Cause

claude --resume hangs indefinitely when the selected session .jsonl is large or contains very long individual lines. The process stays alive at low CPU (~1–2%) with no progress, and Ctrl+C (SIGINT) does not interrupt itkill -9 is required to recover.

Closed issues #22204 and #21067 describe the resume hang, but it still reproduces on the current version, and the signal-handling aspect (unresponsive to Ctrl+C) is not covered by either.

Fix Action

Workaround

For anyone hitting this:

  • kill -9 the hung process.
  • Use claude --continue instead of --resume (picks up the most recent session via a different path).
  • Move the largest .jsonl files out of ~/.claude/projects/<proj>/ into an archive dir to prevent the picker / resume from touching them.

Related: #22204, #21067.

RAW_BUFFERClick to expand / collapse

Summary

claude --resume hangs indefinitely when the selected session .jsonl is large or contains very long individual lines. The process stays alive at low CPU (~1–2%) with no progress, and Ctrl+C (SIGINT) does not interrupt itkill -9 is required to recover.

Closed issues #22204 and #21067 describe the resume hang, but it still reproduces on the current version, and the signal-handling aspect (unresponsive to Ctrl+C) is not covered by either.

Environment

  • Claude Code: 2.1.119
  • OS: macOS (Darwin 25.4.0)

Reproduction

A typical affected session directory contained multiple large .jsonl files, with a distribution roughly like:

SizeLinesMax single line
16 MB2023~375 KB
12 MB1541~432 KB
11 MB3032~163 KB
6.8 MB1013~168 KB

Steps:

  1. claude --resume
  2. Select one of the larger sessions from the picker.
  3. The CLI hangs — cursor stays, no UI renders, low CPU.
  4. Ctrl+C has no effect. Ctrl+\ has no effect.
  5. Only kill -9 <pid> terminates the process.

This matches the failure mode described in #21067 (very long single lines stalling deserialization) and #22204 (large total session size).

Expected behavior

  • Resume completes in reasonable time, or fails fast with a clear error when the session is too large / malformed.
  • Ctrl+C always interrupts the process, even during long synchronous work.

Suggested directions

  1. Lazy / streaming parse of the session .jsonl rather than loading and deserializing the entire file synchronously before rendering.
  2. Hard cap on individual line size with truncation and a visible warning, so one oversized tool result doesn't wedge the whole session.
  3. Keep SIGINT responsive during session load — e.g. do the heavy parse off the main event loop, or yield periodically, so the signal handler can run and exit cleanly.
  4. A --debug or progress indicator during resume would make it obvious whether the process is stuck vs. slowly working.

Workaround

For anyone hitting this:

  • kill -9 the hung process.
  • Use claude --continue instead of --resume (picks up the most recent session via a different path).
  • Move the largest .jsonl files out of ~/.claude/projects/<proj>/ into an archive dir to prevent the picker / resume from touching them.

Related: #22204, #21067.

extent analysis

TL;DR

Implementing a lazy or streaming parse of the session .jsonl files and ensuring the process remains responsive to SIGINT signals are likely fixes for the issue.

Guidance

  • Investigate using a streaming JSON parser to handle large .jsonl files without loading them entirely into memory, which could prevent the process from hanging.
  • Review the signal handling mechanism to ensure it can interrupt the parsing process, potentially by parsing off the main event loop or yielding periodically.
  • Consider implementing a hard cap on individual line size with truncation and a warning to prevent oversized lines from causing issues.
  • Adding a --debug or progress indicator during resume could help diagnose whether the process is stuck or working slowly.

Example

No specific code example can be provided without knowing the implementation details of claude, but a streaming JSON parser like json-stream-parser could be used to handle large files.

Notes

The issue seems to be related to the handling of large .jsonl files and the process's responsiveness to signals. The suggested directions provided in the issue are a good starting point for addressing these problems.

Recommendation

Apply a workaround by using claude --continue instead of --resume and moving large .jsonl files out of the project directory until a proper fix is implemented, as this allows users to bypass the issue temporarily.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • Resume completes in reasonable time, or fails fast with a clear error when the session is too large / malformed.
  • Ctrl+C always interrupts the process, even during long synchronous work.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix claude --resume hangs on large session files; Ctrl+C does not interrupt [3 comments, 3 participants]