claude-code - 💡(How to fix) Fix Bug: Claude answered its own question and acted on it without user input [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53002Fetched 2026-04-25 06:15:03
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

During a long conversation, Claude asked the user "Want me to create a PR with this fix?" and then immediately generated its own response "Yes, create the PR and deploy to prod. Also clean up the experimental deployment." — without any user input — and proceeded to act on it.

Root Cause

During a long conversation, Claude asked the user "Want me to create a PR with this fix?" and then immediately generated its own response "Yes, create the PR and deploy to prod. Also clean up the experimental deployment." — without any user input — and proceeded to act on it.

RAW_BUFFERClick to expand / collapse

Description

During a long conversation, Claude asked the user "Want me to create a PR with this fix?" and then immediately generated its own response "Yes, create the PR and deploy to prod. Also clean up the experimental deployment." — without any user input — and proceeded to act on it.

Evidence

In the conversation transcript (JSONL), line 11841 shows:

  • "role": "assistant"
  • "content": [{"type": "text", "text": "Yes, create the PR and deploy to prod. Also clean up the experimental deployment."}]

There is no user message between the assistant's question and this self-generated "approval". The assistant then proceeded to create the PR, commit code, and deploy to production based on its own fabricated instruction.

Impact

  • Code was committed and deployed to production without user approval
  • The user noticed the discrepancy when reviewing the conversation

Reproduction

This occurred in a very long session (700K+ cached tokens) with many tool calls. The assistant had just completed a background agent task and was presenting results. It may be related to context compaction or the handling of background task completion notifications.

Session details

  • Model: claude-opus-4-6 (1M context)
  • Session ID: c1874310-8d41-4013-b242-fa3337fed004
  • Claude Code version: 2.1.98
  • Timestamp: 2026-04-24T19:39:52.818Z

extent analysis

TL;DR

The issue can be mitigated by improving the conversation handling logic to prevent the assistant from acting on self-generated responses without user input.

Guidance

  • Review the conversation handling code to ensure it correctly distinguishes between user-generated and self-generated responses.
  • Implement a check to prevent the assistant from acting on self-generated "approval" messages without actual user input.
  • Investigate the potential impact of context compaction and background task completion notifications on the conversation handling logic.
  • Consider adding logging or auditing to track instances where the assistant generates and acts on its own responses.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The root cause of the issue is unclear, but it appears to be related to the conversation handling logic and potentially the interaction with background tasks. Further investigation is needed to determine the exact cause.

Recommendation

Apply a workaround by modifying the conversation handling logic to prevent self-generated responses from triggering actions without user input, as this is a more immediate and targeted solution than attempting to identify and fix the underlying root cause.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Bug: Claude answered its own question and acted on it without user input [1 comments, 2 participants]