error-handling
Skill15 starsChanged 5 months agoMITView on GitHub
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.
44 other projects use a version of this.
Adopted by
Most recently taken up by
- SkillMedev/ai-engineer-toolkittheir own version, first seen Oct 5, 2026
- LuisUrrutia/skillstheir own version, first seen Oct 4, 2026
- JameMy0001/antigravity-skills-hubtheir own version, first seen Oct 2, 2026
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- komluk/scaffoldingtheir own version, first seen Sep 28, 2026
- alfredobs97/flutter_agentic_templatetheir own version, first seen Sep 24, 2026
Used with
Projects with it also use logging, state-management and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
diego-tobalinaSkilllogging
Logging best practices for Java (SLF4J/Logback) and Node.js (Winston/Pino). Use for structured logging, log levels, and avoiding sensitive data exposure.
Also in 5 projects that use this
conorluddySkillstate-management
Cache management, configuration best practices, and progressive disclosure patterns for efficient context window usage. Use when working with large responses, optimizing token costs, or managing plugin state across operations.
Also in 5 projects that use this
DatabricksSkillload-testing
Load test a Databricks App to find its maximum QPS. Use when: (1) User says 'load test', 'benchmark', 'QPS', 'throughput', or 'performance test', (2) User wants to find how many queries per second their app can handle, (3) User wants to set up load testing scripts for their agent, (4) User wants to view load test results/dashboard, (5) User wants to validate results or observe latency/error rate with MLflow tracing.
Also in 3 projects that use this
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 5 projects that use this
ffsshhttiikkSkilli18n
Internationalization and localization
Also in 5 projects that use this
pproencaSkillrefactoring
Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
Also in 6 projects that use this
Other versions44 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 44
- microsoft/data-formulator★ 18ksame name
- CloudAI-X/claude-workflow-v2★ 1.4ksame name
- codewithmukesh/dotnet-claude-kit★ 750same name
- templetongroup/radiant★ 113same name
- DevelopersGlobal/ai-agent-skills★ 69same name
- metarhia/metaskills★ 57same name
- suhailkakar/the-skills★ 26same name
- komluk/scaffolding★ 15same name
- wpank/ai★ 11same name
- jiatastic/open-python-skills★ 9same name
34 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-typesSkill
- jsonl-log-analyzerSkill
- messagingSkill
- orchestratingSkill
- orchestration-patternsSkill
- rlm-patternSkill
- spawn-backendsSkill
- task-systemSkill
- team-managementSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 37 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Use hooks to enforce rules when teammates finish work or tasks complete.
- Distinctive: line 61
Verify teammate completed all assigned tasks before going idle
- Distinctive: line 62
Run linting or tests on teammate's changes
- Distinctive: line 92
Verify tests pass before marking a task complete
- Distinctive: line 93
Ensure code quality standards are met
- Distinctive: line 118
Permissions set at spawn: All teammates start with the lead's permission mode.
- Distinctive: line 120
Split panes require tmux or iTerm2: Default in-process mode works in any terminal.
- Distinctive: line 161
Check their output using Shift+Up/Down (in-process) or click pane (split mode)
- Distinctive: line 187
Check if the blocking task was actually marked completed
- Distinctive: line 188
If work is done but status wasn't updated, update it manually
“Common” is measured: kept by at least 6 in 10 of the 37 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Error Handling
Experimental: Agent teams are disabled by default. Enable with
CLAUDE_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.
{
"hooks": {
"TeammateIdle": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "python3 check_teammate_quality.py"
}
]
}
]
}
}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.
{
"hooks": {
"TaskCompleted": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "python3 validate_task_completion.py"
}
]
}
]
}
}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:
// 1. Request shutdown for all teammates
SendMessage({ to: "worker-1", message: { type: "shutdown_request", reason: "Done" } })
SendMessage({ to: "worker-2", message: { type: "shutdown_request", reason: "Done" } })
// 2. Wait for shutdown approvals
// 3. Verify no active members
// 4. Only then cleanup
TeamDelete()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:
Wait for your teammates to complete their tasks before proceedingOr 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:
tmux ls
tmux kill-session -t <session-name>Debugging Commands
# Check team config
cat ~/.claude/teams/{team}/config.json | jq '.members[] | {name, agentType, backendType}'
# Check teammate inboxes
cat ~/.claude/teams/{team}/inboxes/{agent}.json | jq '.'
# List all teams
ls ~/.claude/teams/
# Check task states
cat ~/.claude/tasks/{team}/*.json | jq '{id, subject, status, owner, blockedBy}'
# Watch for new messages
tail -f ~/.claude/teams/{team}/inboxes/team-lead.jsonBest 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

