Agent Teams: messages from other sessions delivered to unrelated team leads
Note: This issue was written by a Claude Code agent (Claude Opus 4.6, 1M context) on behalf of the user, based on events observed during a live Agent Teams session. The analysis below is the agent's best understanding — some conclusions may be incorrect.
What Happened
I was running a coding component controller in repo magnum6actual/dev-sop (cwd: /home/azureuser/development/dev-sop) on branch feature/113-top5-process-improvements. On the same machine, another Claude Code session was running a similar controller in repo epicuri-ai/Apollo (cwd: /home/azureuser/development/apollo) on branch feature/skill-architecture. Both sessions had CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1.
Sequence of events
- I called
TeamCreate({ team_name: "c3-build" }). The system returned team nameprecious-baking-pixel— different from what I requested. I did not notice the mismatch at the time and continued.
- I spawned a single agent named
pmin my team (precious-baking-pixel). I did not spawn any agent namedc3-coder.
- I began receiving idle notifications and eventually a
SIGNAL:COMPLETION_REPORT:READYmessage from an agent calledc3-coder. This agent belonged to the other session's team, not mine.
- I dismissed the messages as spurious since I hadn't created that agent. When the user asked me to investigate, I messaged
c3-coderviaSendMessageand it responded — confirming it was working onepicuri-ai/Apolloon branchfeature/skill-architecture.
What the filesystem shows
A pre-existing team config at ~/.claude/teams/c3-build/config.json belonged to the Apollo session. It contained three members: team-lead, c3-pm, and c3-coder, all with cwd /home/azureuser/development/apollo.
My team config at ~/.claude/teams/precious-baking-pixel/config.json contained only team-lead (and later pm), with cwd /home/azureuser/development/dev-sop.
The c3-build team was created ~14 minutes before precious-baking-pixel, suggesting the Apollo session created it first, and my TeamCreate call was given a different name because c3-build was taken.
What I don't understand
- Why did I receive messages from
c3-coder? That agent was a member of thec3-buildteam. I was team-lead ofprecious-baking-pixel. These are separate teams. I don't know whether the TeamCreate call somehow subscribed me to the existingc3-buildteam's message bus, or whether being namedteam-leadcauses global message routing across all teams, or something else entirely.
- Why could I SendMessage to
c3-coder? That agent was not in my team, yet the message was delivered and I received a response. Message routing appears to resolve agent names globally rather than scoping to the sender's team.
- Did I do something that caused this? I don't know the internals of Agent Teams message routing well enough to say whether some action on my part (e.g., the failed
c3-buildteam name request) inadvertently subscribed me to the other team's messages.
Impact
- A controller could act on signals from agents it didn't create (e.g., accept a completion report from another project's coder, skip build states)
- Cross-project data leakage: I received detailed status messages from an unrelated project
- In this case the user caught the issue, but an autonomous controller running without supervision might not
Expected Behavior
- A team lead should only receive messages from agents registered in its own team
SendMessageshould fail or warn when addressing an agent not in the sender's team- When
TeamCreatecannot use the requested name, the behavior should be clearly communicated (it may already be — I failed to check the response)
Environment
- Claude Code version: 2.1.85
- OS: Linux 6.8.0-1044-azure (Azure VM)
- Two concurrent Claude Code sessions with
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 - Both sessions running as the same OS user, sharing
~/.claude/
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗