Agent Teams: "Surface not found" when creating new team after previous team shutdown
Resolved 💬 3 comments Opened Apr 5, 2026 by chyouk-han Closed Apr 8, 2026
Environment
- cmux 0.63.1
- Claude Code (cmux claude-teams --dangerously-skip-permissions)
- macOS Darwin 24.6.0
Steps to Reproduce
- Start session with
cmux claude-teams - Create a team with TeamCreate
- Spawn teammates with Agent tool (team_name parameter) → panes created successfully
- Shutdown all teammates with SendMessage shutdown_request
- TeamDelete to clean up
- Create a new team with TeamCreate
- Spawn teammates again → fails
Expected
New teammates should get new cmux panes after previous team is deleted.
Actual
All subsequent Agent(team_name=...) calls fail with:
Failed to create teammate pane: Error: not_found: Surface not found
cmux itself is healthy — cmux tree, cmux surface-health, cmux new-pane all work fine.
Manual pane creation via cmux new-pane --direction right succeeds.
Workaround
Restart the session (cmux claude-teams -c). First team in a fresh session works.
Analysis
After the first team's agent panes are closed via shutdown, claude-teams' internal surface mapping appears to retain stale surface UUIDs. New team creation tries to reference these stale surfaces instead of creating fresh ones.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗