ExitPlanMode enqueue/dequeue spin loop after plan mode exit

Resolved 💬 3 comments Opened Feb 18, 2026 by juanandresgs Closed Apr 10, 2026

Description

When ExitPlanMode is called to transition from plan mode to implementation mode, the plan content gets enqueued as a synthetic user message but enters a rapid enqueue→dequeue spin loop instead of being processed. The "thinking" animation starts and resets every ~1.5 seconds indefinitely until the user hits Ctrl+C.

Reproduction

  1. Enter plan mode with a substantial plan (~13K chars)
  2. Call ExitPlanMode with allowedPrompts
  3. Observe the thinking indicator start and immediately reset, repeating in a loop

Evidence from transcript

The JSONL transcript shows the exact same 13,708-char content being enqueued and dequeued 14 times in 21 seconds:

L241 enqueue at 2026-02-18T18:37:01.965Z  content_len=13708
L242 dequeue at 2026-02-18T18:37:01.991Z   (26ms later)
L244 enqueue at 2026-02-18T18:37:03.591Z   (1.6s retry)
L245 dequeue at 2026-02-18T18:37:03.622Z   (31ms later)
L247 enqueue at 2026-02-18T18:37:05.229Z   (1.6s retry)
L248 dequeue at 2026-02-18T18:37:05.258Z   (29ms later)
... (repeats 14 total cycles until Ctrl+C at L283)

Each cycle: enqueue (plan content) → dequeue within 26-50ms → wait ~1.5s → retry.

User experience

  • The "thinking" animation starts and immediately resets each cycle
  • Token counter appears to reset from scratch each time
  • Only way to break out is Ctrl+C
  • After Ctrl+C and re-prompting, implementation proceeds normally

Possible contributing factor

The model included a plan parameter in the ExitPlanMode tool call input that doesn't exist in the tool's JSON schema (schema only defines allowedPrompts, pushToRemote, remoteSessionId, remoteSessionTitle, remoteSessionUrl). The hallucinated parameter contained the full 13K-char plan text. This extra field may be confusing the tool handler during the plan→implementation transition.

Environment

  • Claude Code version: 2.1.45
  • Model: claude-opus-4-6
  • Platform: macOS Darwin 25.3.0
  • Session ID: 894da464-26ef-4dd3-a2c4-1e15018e8b5a

View original on GitHub ↗

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