claude-code - 💡(How to fix) Fix [BUG] Phantom messages appearing as "Human:" input that the user did not send [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#46500Fetched 2026-04-11 06:18:39
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

During a Claude Code session, multiple messages appeared in the conversation attributed to "Human:" that I did not type, speak, or send through any input method. The messages appeared as normal user input and Claude responded to them as if I had sent them.

Error Message

No error messages. The phantom messages appear silently as normal "Human:" turns with no errors, warnings, or stack traces. That's part of the problem -- there's no indication anything went wrong.

Root Cause

During a Claude Code session, multiple messages appeared in the conversation attributed to "Human:" that I did not type, speak, or send through any input method. The messages appeared as normal user input and Claude responded to them as if I had sent them.

Code Example

No error messages. The phantom messages appear silently as normal "Human:" turns with no errors, warnings, or stack traces. That's part of the problem -- there's no
  indication anything went wrong.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Description

During a Claude Code session, multiple messages appeared in the conversation attributed to "Human:" that I did not type, speak, or send through any input method. The messages appeared as normal user input and Claude responded to them as if I had sent them.

What happened

  1. A session was continued from a previous conversation that ran out of context (context compaction/continuation was triggered).
  2. A /loop 5m /quick-checkpoint cron job was running (auto-checkpoint every 5 minutes).
  3. At least 3 phantom messages appeared as "Human:" input:
    • A message asking about the Canadian federal election and prime minister (completely out of context -- no election occurred, and I know who the PM is)
    • "ok nothing happened for 5 min other than the cron. lets just leave it. i really gotta go eat now lol" (I did not send this)
    • At least one additional phantom message (see screenshot 2)
  4. Claude treated all phantom messages as real input and responded accordingly.
  5. I ran a 5-minute experiment: sat and watched the screen without touching any input. The checkpoint cron fired normally but no phantom messages appeared during that window.

What I expected

Only messages I explicitly type or dictate should appear as "Human:" in the conversation.

Investigation performed (by Claude within the session)

  • Checked CronList: only 1 job (/quick-checkpoint every 5 min) -- cannot generate conversational messages
  • Checked hooks: 3 hooks (guardrail, backup, memory_capture) -- none inject human messages
  • Checked TaskList: empty -- no background agents running
  • Checked settings.json and settings.local.json: no suspicious configuration
  • No MCP server has capability to inject human messages

Suspected cause (according to Claude )

The session was continued from a previous conversation via context compaction. The continuation/compaction mechanism may be replaying or leaking message fragments as phantom "Human:" messages. The election message is a strong indicator -- it was completely unrelated to anything discussed in the current session, suggesting it originated from a different context or is a corruption artifact.

Impact

  • Low severity (no destructive actions were triggered)
  • But concerning: if phantom messages could trigger tool use, this could cause unintended file edits, API calls, or other actions attributed to the user

2026-04-10_phantom-messages-bug-report.md

<img width="1918" height="1078" alt="Image" src="https://github.com/user-attachments/assets/ac210c24-f14e-4a43-b042-4a6cdb55fffd" /> <img width="1918" height="1078" alt="Image" src="https://github.com/user-attachments/assets/0efd5154-db9e-4922-bde2-d638cc494a98" />

What Should Happen?

Only messages explicitly typed or dictated by the user should appear as "Human:" turns in the conversation. No system process, cron job, loop, or background task should generate messages attributed to the user.

Error Messages/Logs

No error messages. The phantom messages appear silently as normal "Human:" turns with no errors, warnings, or stack traces. That's part of the problem -- there's no
  indication anything went wrong.

Steps to Reproduce

Uncertain. May require:

  1. A long session that triggers context compaction/continuation
  2. An active /loop or CronCreate job running during the session
  3. Windows environment

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

Claude Code v2.1.101.

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Session ID: 2016587f-59ad-4cb1-bff2-309e5848d6b7

extent analysis

TL;DR

The most likely fix for the phantom messages issue is to investigate and refine the context compaction/continuation mechanism in Claude Code to prevent message fragments from being replayed or leaked as "Human:" messages.

Guidance

  • Review the context compaction/continuation mechanism to identify potential issues with message fragment handling.
  • Test the /loop and CronCreate jobs in isolation to determine if they contribute to the phantom message issue.
  • Consider adding logging or debugging statements to track the origin of "Human:" messages and identify any system processes that may be generating them.
  • Verify that the issue is specific to the Opus Claude Model and Windows environment, or if it can be reproduced on other platforms.

Example

No code snippet is provided as the issue is related to the internal workings of Claude Code and requires further investigation.

Notes

The lack of error messages or logs makes it challenging to diagnose the issue. The fact that the problem occurred after continuing a session from a previous conversation via context compaction/continuation suggests that this mechanism may be the root cause.

Recommendation

Apply a workaround by avoiding the use of context compaction/continuation until the issue is resolved, and consider implementing additional logging or debugging to track the origin of "Human:" messages. This will help prevent unintended actions attributed to the user and provide more insight into the issue.

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