[BUG] Claude Code Hangs Indefinitely After Turn Completion with Queued Items

Resolved 💬 3 comments Opened Feb 11, 2026 by michaelalexander-git Closed Feb 15, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code hangs indefinitely in "thinking" state after completing a turn when there are queued task notifications waiting to be processed. The hang persists until user intervention (pressing Escape twice). This has occurred multiple times.

Actual Behavior

After turn completion:

  1. System logs turn_duration normally
  2. Queue processing stops entirely
  3. UI shows "thinking" state indefinitely
  4. 8 completed task notifications sat in queue for 5 hours 31 minutes
  5. No errors logged, no timeout, no recovery
  6. Only user intervention (Escape key) resumed processing

Key Observations

  1. stop_reason: null in the last assistant message before hang (unusual - should be end_turn or similar)
  2. No errors in logs - no API errors, no exceptions, no timeouts
  3. Queue had items - 8 enqueue operations occurred, but no dequeue until user intervention
  4. Immediate recovery - Pressing Escape twice immediately resumed normal operation
  5. Recurring issue - User reports this has happened multiple times

Related Issues

These issues describe similar but distinct hang/freeze behaviors:

| Issue | Title | Similarity |
|-------|-------|------------|
| #13224 | Claude Code hangs or freezes during execution with no recovery mechanism | General hang behavior, no recovery |
| #13198 | Multiple concurrent Claude Code terminals hang after 2 hours with repeated token usage | Multi-terminal hang, time-based trigger |
| #13188 | Sessions become unresponsive after upgrade to 2.0.60 (suspected background agent blocking) | Background agent blocking - most similar |

Note: Issue #13188 appears most related as it specifically mentions "background agent blocking" which aligns with this report's findings (8 background agents completing while main session hung).

What Should Happen?

Expected Behavior

After a turn completes (turn_duration logged), Claude Code should:

  1. Check the notification queue for pending items
  2. Dequeue and process any waiting notifications
  3. Continue responding to user or processing next queued item

Error Messages/Logs

## Timeline from Logs


23:24:51.214Z - Launched 8 async agents (Task tool)
23:26:30.119Z - Agent ad1b0ca completed → enqueued
23:26:40.916Z - Agent a6fe280 completed → enqueued
23:30:19.540Z - Agent a0fc8d5 completed → enqueued
23:34:02.877Z - Agent a3d011b completed → enqueued
23:34:14.892Z - Agent adb1fb4 completed → enqueued
23:35:42.987Z - Agent a204fb5 completed → enqueued
23:35:59.488Z - Agent a1c79ec completed → enqueued
23:36:54.661Z - Agent ac6fcc7 completed → enqueued

23:39:27.789Z - Main session: assistant message (stop_reason: null)
23:39:27.846Z - System: turn_duration logged (932243ms)

[NO ACTIVITY FOR 5 HOURS 31 MINUTES]

05:10:16.370Z - User pressed Escape → dequeue operation
05:10:16.489Z - Queue processing resumed normally

Steps to Reproduce

Steps to Reproduce

  1. Launch multiple async agents using the Task tool (8 agents in this case)
  2. Allow agents to complete and enqueue their completion notifications
  3. Main session processes some notifications and completes a turn
  4. Bug occurs: Main session stops processing queue despite pending items
  5. Claude Code displays "thinking" spinner indefinitely
  6. Pressing Escape twice resumes normal operation

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.17

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Log Evidence

Last assistant message before hang (line 355):

{
  "type": "assistant",
  "timestamp": "2026-02-10T23:39:27.789Z",
  "message": {
    "stop_reason": null,
    "stop_sequence": null,
    "usage": {
      "output_tokens": 6
    }
  }
}

Turn duration logged (line 356):

{
  "type": "system",
  "subtype": "turn_duration",
  "durationMs": 932243,
  "timestamp": "2026-02-10T23:39:27.846Z"
}

First activity after hang (line 357):

{
  "type": "queue-operation",
  "operation": "dequeue",
  "timestamp": "2026-02-11T05:10:16.370Z"
}

---

Hypothesis

The stop_reason: null suggests the response stream may not have properly terminated, leaving the client in an ambiguous state:

  • Waiting for more streaming output that never arrives, OR
  • Stuck between "turn complete" and "ready for queue processing"

The queue processor appears to be blocked or waiting on a condition that is never satisfied until user interruption.

---

ee250879-3f38-4379-8de8-a69ed3ea1b9d.json

View original on GitHub ↗

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