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
- Claude was running a task (#3 "Add tests for Stop hook context tracking")
- A pytest command was executing:
tests/unit/test_stop_hook.py::TestStopHookContextTr... - System displayed "Interrupted - What should Claude do instead?" - but user did NOT interrupt
/clearwas automatically injected without any user action- Session resumed after clear with context restored
- Then received: "API Error: 400 due to tool use concurrency issues"
Expected Behavior
/clearshould only be injected when user explicitly types it- Self-interruption should not trigger
/clearinjection - 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
/clearappearing 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
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗