[BUG] Duplicate assistant responses - multiple API requests for single user message
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?
A single user message sometimes triggers two separate API requests, resulting in two assistant responses displayed sequentially. Both responses address the same prompt with similar (but not identical) content.
What Should Happen?
One user message should trigger exactly one API request and one assistant response.
Error Messages/Logs
Conversation log shows two distinct API requests for one user message:
// First request
{"requestId":"req_011CVTUfPmvwq7vAXnVzTUz2", "stop_reason":null, ...}
// Response: Quality check table + "if you meant brew install pyyaml..."
// Second request (immediately after)
{"requestId":"req_011CVTUgD6XGmUYXPdnajWYn", "stop_reason":null, ...}
// Response: "Ha, true - brew install pyyaml would work too..."
Both responses have "stop_reason": null in their initial message objects.
Steps to Reproduce
Unable to provide reliable reproduction steps - occurs intermittently. Observed during extended session with:
- Extended thinking enabled (
alwaysThinkingEnabled: true) - Custom hooks (SessionStart, PostToolUse, SessionEnd)
- Opus 4.5 model
The duplicate occurred after a tool result was returned (skill validation via bash command).
Environment
- Version: 2.0.51
- Platform: macOS (Darwin 25.1.0)
- Model: claude-opus-4-5-20251101
- Session: Extended (~2hr), with multiple tool calls
Additional Context
The conversation log (stored in ~/.claude/projects/*/[session-id].jsonl) shows proper parent UUID chaining between the two responses, suggesting this is intentional continuation logic rather than a race condition. However, the user experience is confusing as both responses appear to be independent answers to the same question.
Possibly related to extended thinking mode and how stop_reason: null triggers continuation requests.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗