zircote-plugins/claude-team-orchestration/error-handling
Claude Code and agent skill by zircote-plugins/claude-team-orchestration
- community
Checking that the SKILL.md file is still in the repository.
Debug and recover from agent team errors including common errors, hooks for quality gates, known limitations, and recovery strategies. Use when encountering team errors, enforcing quality gates with hooks, understanding limitations, or debugging agent issues.
Install
npx vskill@latest install zircote-plugins/claude-team-orchestration/error-handlingSKILL.md
The same SKILL.md was published earlier as zircote-plugins/claude-team-orchestration/error-handling.
Error Handling
Experimental: Agent teams are disabled by default. Enable withCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSin your settings.json or environment.
Debug, recover from, and prevent common agent team errors. Includes hooks for quality enforcement and known limitations.
Related skills:
- Orchestrating - Primitives overview and quick reference
- Team Management - Shutdown and cleanup procedures
- Task System - Task status issues
- Messaging - Message debugging
- Spawn Backends - Backend troubleshooting
Common Errors
| Error | Cause | Solution | |
|---|---|---|---|
| "Cannot cleanup with active members" | Teammates still running | Shutdown all teammates first, wait for approval | |
| "Already leading a team" | Team already exists | TeamDelete() first, or use different team name | |
| "Agent not found" | Wrong teammate name | Read config.json for actual names | |
| "Team does not exist" | No team created | Call TeamCreate() first | |
| "team_name is required" | Missing team context | Provide team_name parameter | |
| "Agent type not found" | Invalid subagent_type | Check available agents with proper prefix |
Quality Gate Hooks
Use hooks to enforce rules when teammates finish work or tasks complete.
TeammateIdle Hook
Runs when a teammate is about to go idle. Exit with code 2 to send feedback and keep the teammate working.
Use cases:
- Verify teammate completed all assigned tasks before going idle
- Run linting or tests on teammate's changes
- Enforce documentation requirements
Exit codes:
0- Allow teammate to go idle normally2- Send feedback to teammate, keep them working
TaskCompleted Hook
Runs when a task is being marked complete. Exit with code 2 to prevent completion and send feedback.
Use cases:
- Verify tests pass before marking a task complete
- Ensure code quality standards are met
- Validate documentation was updated
Exit codes:
0- Allow task completion2- Prevent completion, send feedback to teammate
Known Limitations
Agent teams are experimental. Current limitations:
- No session resumption with in-process teammates:
/resumeand/rewinddo not restore in-process teammates. After resuming, the lead may try to message teammates that no longer exist. Tell the lead to spawn new teammates.
- Task status can lag: Teammates sometimes fail to mark tasks as completed, which blocks dependent tasks. Check whether work is done and update status manually, or tell the lead to nudge the teammate.
- Shutdown can be slow: Teammates finish their current request or tool call before shutting down.
- One team per session: A lead can only manage one team at a time. Clean up the current team before starting a new one.
- No nested teams: Teammates cannot spawn their own teams or teammates. Only the lead can manage the team.
- Lead is fixed: The session that creates the team is the lead for its lifetime. You cannot promote a teammate or transfer leadership.
- Permissions set at spawn: All teammates start with the lead's permission mode. You can change individual modes after spawning, but cannot set per-teammate modes at spawn time.
- Split panes require tmux or iTerm2: Default in-process mode works in any terminal. Split-pane mode isn't supported in VS Code's integrated terminal, Windows Terminal, or Ghostty.
Graceful Shutdown Sequence
See Team Management for the full shutdown procedure. In summary:
Handling Crashed Teammates
Teammates have a 5-minute heartbeat timeout. If a teammate crashes:
- They are automatically marked as inactive after timeout
- Their tasks remain in the task list
- Another teammate can claim their tasks
- Cleanup will work after timeout expires
Recovery Strategies
Teammate Stops on Error
Teammates may stop after encountering errors instead of recovering.
Recovery:
- Check their output using Shift+Up/Down (in-process) or click pane (split mode)
- Give them additional instructions directly
- Or spawn a replacement teammate to continue the work
Lead Starts Implementing Instead of Delegating
The lead sometimes starts doing work itself instead of waiting for teammates.
Recovery: Tell it to wait:
Or enable delegate mode to restrict the lead to coordination-only tools.
Lead Shuts Down Prematurely
The lead may decide the team is finished before all tasks are complete.
Recovery: Tell it to keep going. You can also tell the lead to wait for teammates to finish before proceeding.
Task Appears Stuck
A task stays in pending even though its dependencies are done.
Recovery:
- Check if the blocking task was actually marked completed
- If work is done but status wasn't updated, update it manually
- Tell the lead to nudge the teammate
Too Many Permission Prompts
Teammate permission requests bubble up to the lead.
Recovery: Pre-approve common operations in your permission settings before spawning teammates.
Orphaned tmux Sessions
A tmux session persists after the team ends.
Recovery:
Debugging Commands
Best Practices for Error Prevention
- Build retry logic into worker prompts — crashed workers have a 5-minute heartbeat timeout, after which their tasks can be reclaimed
- Avoid file conflicts — break work so each teammate owns a different set of files
- Monitor and steer — check progress, redirect failing approaches, and synthesize findings as they arrive
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/error-handling/SKILL.md
Popularity
- Repository stars
- 15
- Repository forks
- 1
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zircote-plugins/claude-team-orchestration/error-handling)