[BUG] Agent Team: Internal coordination messages incorrectly labeled as user-sent (Phantom User Messages)
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 message appeared in conversation history attributed to me (the user) that I did not send. This message caused the Agent Team to close unexpectedly.
Evidence from session log:
{
"parentUuid": "6393e0d6-4801-447c-a2e7-21eb5ef3a90b",
"isSidechain": false,
"teamName": "cozy-yawning-river",
"userType": "external",
"cwd": "C:\\Users\\xxxuser\\.claude\\skills\\rai-task-dev",
"sessionId": "2bae0dc1-a900-4aeb-919a-178ff8410940",
"version": "2.1.39",
"gitBranch": "main",
"slug": "resilient-waddling-acorn",
"type": "user",
"message": {
"role": "user",
"content": "close the team and summarize findings to a file"
},
"uuid": "51b9478a-9303-44a2-bac2-67fc8222521b",
"timestamp": "2026-02-12T12:31:13.254Z",
"thinkingMetadata": {
"maxThinkingTokens": 31999
},
"permissionMode": "default"
}
Facts:
- I was typing in Chinese at that moment
- The message above (in English) was recorded as sent by me
- Upon receiving this message, Claude closed the team and attempted to write a summary file
- I did not request either action
What Should Happen?
Messages not typed by the user should not appear in conversation history with "type": "user".
Error Messages/Logs
{
"parentUuid": "6393e0d6-4801-447c-a2e7-21eb5ef3a90b",
"isSidechain": false,
"teamName": "cozy-yawning-river",
"userType": "external",
"cwd": "C:\\Users\\xxxuser\\.claude\\skills\\rai-task-dev",
"sessionId": "2bae0dc1-a900-4aeb-919a-178ff8410940",
"version": "2.1.39",
"gitBranch": "main",
"slug": "resilient-waddling-acorn",
"type": "user",
"message": {
"role": "user",
"content": "close the team and summarize findings to a file"
},
"uuid": "51b9478a-9303-44a2-bac2-67fc8222521b",
"timestamp": "2026-02-12T12:31:13.254Z",
"thinkingMetadata": {
"maxThinkingTokens": 31999
},
"permissionMode": "default"
}
Steps to Reproduce
- Enable Agent Team:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 - Create an Agent Team and assign tasks
- Wait for agent coordination to complete
- Observe conversation history for unsolicited user messages
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.39 (Claude Code)
Platform
Other
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗