Bug: /clear command auto-injected on self-interruption + API 400 concurrency error

Resolved 💬 4 comments Opened Jan 25, 2026 by ammar412 Closed Mar 1, 2026

Bug: /clear command auto-injected on self-interruption

Claude Code Version: 2.1.19
OS: macOS 15 (Darwin 25.2.0) ARM64

What Happened

  1. Claude was running a task (#3 "Add tests for Stop hook context tracking")
  2. A pytest command was executing: tests/unit/test_stop_hook.py::TestStopHookContextTr...
  3. System displayed "Interrupted - What should Claude do instead?" - but user did NOT interrupt
  4. /clear was automatically injected without any user action
  5. Session resumed after clear with context restored
  6. Then received: "API Error: 400 due to tool use concurrency issues"

Expected Behavior

  • /clear should only be injected when user explicitly types it
  • Self-interruption should not trigger /clear injection
  • No API 400 concurrency errors during normal task execution

Evidence

Screenshot shows the full sequence:

  • Test running with 1m 0s timeout
  • "Interrupted - What should Claude do instead?" message
  • /clear appearing in input without user typing it
  • Session resuming with context
  • API 400 error appearing

Possible Causes

  • Race condition in tool use handling
  • Timeout triggering interruption logic incorrectly
  • Concurrency issue between task execution and input handling

---
Reported via Claude Code CLI

View original on GitHub ↗

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