claude --resume crashes on killed sessions + Ctrl+C unresponsive during tool execution

Resolved 💬 5 comments Opened Jan 17, 2026 by f3nr1l Closed Mar 8, 2026

Bug: claude --resume crashes with "No messages returned" on incomplete sessions

Environment

  • Claude Code version: 2.1.12
  • OS: Fedora 43 (Linux 6.18.5)
  • Shell: zsh

Description

When a Claude Code session is killed during tool execution, the .jsonl session file is left in an incomplete state. Attempting to resume this session with claude --resume <session-id> fails with:

This error originated either by throwing inside of an async function without a catch block,
or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: No messages returned
    at cAB (/$bunfs/root/claude:5329:78)
    at processTicksAndRejections (native:7:39)

Steps to Reproduce

  1. Start a Claude Code session
  2. Ask Claude to execute a long-running or slow command (triggers tool_use)
  3. Session appears frozen, Ctrl+C doesn't respond
  4. User runs killall claude or killall -9 claude from another terminal
  5. Try to resume: claude --resume <session-id>
  6. Observe the crash

Root Cause Analysis

The session .jsonl file ends with:

{"type": "user", "message": {...}}           // User's question
{"type": "assistant", "message": {"content": [{"type": "thinking", ...}]}}
{"type": "assistant", "message": {"content": [{"type": "tool_use", "name": "Bash", ...}]}}
// Missing: tool_result entry

The file is syntactically valid JSON (each line parses correctly), but the conversation is in an inconsistent state: a tool_use was issued but no tool_result was recorded.

Expected Behavior

Claude Code should either:

  1. Gracefully recover: Detect incomplete tool calls and either retry or skip them
  2. Prompt the user: "Last session ended during tool execution. Resume anyway? (last exchange will be lost)"
  3. Truncate automatically: Remove trailing incomplete messages and resume from the last valid state

Current Workaround

Rename or delete the problematic session file:

mv ~/.claude/projects/<path>/<session-id>.jsonl ~/.claude/projects/<path>/<session-id>.jsonl.bak

The session data is still readable with jq for manual extraction, but cannot be resumed.

Additional Context

  • Session file size: ~1 MB (229 lines, 170 messages before the incomplete exchange)
  • The crash occurred during execution of: /usr/bin/grep -r "yazi" ~/.claude/projects/
  • Manually removing the last 3 lines (incomplete exchange) did not fix the issue, suggesting the loader has additional validation that fails

Related Issue: Ctrl+C not responding

Before resorting to killall, the user tried Ctrl+C multiple times but the session did not respond. This suggests:

  • Signal handlers may not be properly set up during tool execution
  • Or the Bash subprocess blocks SIGINT propagation

This forces users to use kill/killall from another terminal, which is more disruptive and leaves no chance for graceful cleanup.

Suggested Fix

In the session loader, wrap message parsing in a try-catch and either:

  • Skip malformed/incomplete trailing messages
  • Or provide a --resume --force flag to attempt recovery

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗