[BUG] Skill tool causes "tool_use without tool_result" API error in print mode

Resolved 💬 5 comments Opened Jan 24, 2026 by swchen44 Closed Feb 28, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using Claude Code in print mode (-p) with the superpowers plugin, invoking the Skill tool causes an API error. The error occurs because the message sequence sent to the Anthropic API is malformed - a tool_use block is not immediately followed by its corresponding tool_result block.

What Should Happen?

Claude should invoke the Skill tool, load the skill content, and respond with a description of the skill.

Error Messages/Logs

API Error 400 with message: "tool use concurrency issues"

Steps to Reproduce

  1. Install superpowers plugin: claude plugins add https://github.com/obra/superpowers.git
  2. Enable the plugin in settings
  3. Run: claude -p "What is the subagent-driven-development skill? Describe its key steps briefly."

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.19

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Debug Log (from ~/.claude/debug/)

[DEBUG] Stream started - received first chunk
[DEBUG] executePreToolHooks called for tool: Skill
[DEBUG] SkillTool returning 2 newMessages for skill superpowers:subagent-driven-development
[ERROR] Error in non-streaming fallback: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01VS8XNGeHhpeMmWH1zoZTv3. Each `tool_use` block must have a corresponding `tool_result` block in the next message."}}

Root Cause Analysis

The Skill tool returns newMessages that should be injected into the conversation. However, when constructing the next API request, the message sequence violates the API contract:

  • The original tool_use block exists
  • But its tool_result is not in the immediately following message position
  • The newMessages from the Skill tool appear to be inserted incorrectly

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗