[BUG] Subagent crashes with Abort() when Skill tool invokes non-existent skill
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
When a subagent (via Task tool) uses the Skill tool to invoke a skill that doesn't exist, the entire Claude Code process crashes with Abort() instead of gracefully handling the error.
The Skill tool correctly returns an error (is_error: true), but the subagent fails to process it and crashes the parent process.
What Should Happen?
The Skill tool error should be handled gracefully. The subagent should either:
- Try an alternative approach
- Report the failure back to the parent agent
- Ask for guidance
The parent Claude Code process should never crash due to a subagent receiving a tool error.
Error Messages/Logs
Terminal output ends with:
Abort()
Subagent log shows the tool call and error response, then abruptly ends:
// Line 6 - Subagent calls Skill tool
{"type":"tool_use","id":"toolu_01FkZZH4KTZDP2vpGaoe8SLT","name":"Skill","input":{"skill":"meta-claude:release-notes"}}
// Line 7 - Tool returns error properly
{"type":"tool_result","content":"<tool_use_error>Unknown skill: meta-claude:release-notes</tool_use_error>","is_error":true,"tool_use_id":"toolu_01FkZZH4KTZDP2vpGaoe8SLT"}
// Line 8 - Empty. Log ends. Process crashed.
Steps to Reproduce
- Create a custom agent in
.claude/agents/withSkillin allowed tools - Agent instructions tell it to invoke a skill that doesn't exist (e.g.,
skill: "release-notes") - Delegate to the agent via Task tool
- Agent calls
Skilltool with non-existent skill name - Tool returns error, subagent crashes, parent process aborts
Claude Model
Sonnet (subagent)
Is this a regression?
Unknown
Claude Code Version
2.1.7
Platform
Anthropic API (Max subscription)
Operating System
macOS (Darwin 25.1.0)
Terminal/Shell
Default terminal
Additional Information
The subagent log file ends immediately after receiving the is_error: true tool result - no further processing occurs. This suggests the crash happens when the subagent attempts to process a tool error from the Skill tool specifically.
Related but different from #17007 (agent not found in Task tool) - this is about the Skill tool within a subagent failing to handle "skill not found" errors.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗