[BUG] Custom slash command orchestration fails with tool_use/tool_result mismatch in v1.0.123-124

Resolved 💬 5 comments Opened Sep 25, 2025 by s-hiraoku Closed Jan 9, 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 an orchestrator custom slash command that calls other custom slash commands (/slash-command-tools:create-girls-name, /slash-command-tools:create-boys-name), the execution consistently fails with a 400 API error across multiple Claude Code versions.

What Should Happen?

The custom slash command is invoked without errors, outputs the result, and exits.

Error Messages/Logs

API Error: 400 
{"type":"error","error":{"type":"invalid_request_error","message":"messages.2: 
`tool_use` ids were found without `tool_result` blocks immediately after: 
toolu_01DY3kvC8rxSLxdp97R2Xog8. Each `tool_use` block must have a corresponding 
tool_result` block in the next message."},"request_id":"req_011CTVmyhCV42cGy1pmwFmFS"}

Steps to Reproduce

Steps to Reproduce

  1. Create the three custom slash commands below (storyteller, create-girls-name, create-boys-name)
  2. Execute /storyteller command
  3. Error occurs when storyteller tries to call /slash-command-tools:create-girls-name or /slash-command-tools:create-boys-name

Expected Behavior

The storyteller orchestrator should successfully call both sub-agents, collect their generated names, and combine the results to create a cohesive story output.

Actual Behavior

API error due to malformed tool_use/tool_result message structure. The system appears to generate tool_use blocks when calling sub-agents but fails to provide corresponding tool_result blocks.

Version History

  • ❌ v1.0.123: Issue present
  • ❌ v1.0.124: Issue persists

Issue Persistence

This bug persists across multiple releases, indicating it's a core architectural issue with the orchestration feature rather than a simple regression. This makes the orchestration functionality effectively unusable.

Workaround

Single integrated commands work fine - the issue is specific to inter-command calls. Using all-in-one agents instead of orchestrated sub-agents avoids the problem.

Impact

This issue prevents users from creating modular, reusable slash commands and forces everything into monolithic single-agent implementations, significantly limiting the power and flexibility of the custom slash command feature.

Additional Notes

  • Individual commands (create-girls-name, create-boys-name) work perfectly when executed standalone
  • The problem is specifically with the /slash-command-tools:command-name calling mechanism within orchestrators
  • This appears to be related to how Claude Code handles the internal API message structure when chaining command executions

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

1.0.124

Claude Code Version

1.0.124

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Configuration Files

Orchestrator (fails):

---
name: storyteller
description: Calls /create-girls-name and /create-boys-name and creates a story from their results
---

# Name Story Orchestrator

This command orchestrates multiple agents to generate a creative story using randomly generated names.

## Task

1. Call the /slash-command-tools:create-girls-name command to get a girl's name
2. Call the /slash-command-tools:create-boys-name command to get a boy's name
3. Use both names to create a short, engaging story

## Implementation

Execute both slash commands and combine their results into a narrative that features both characters in an interesting scenario.

Sub-agent: create-girls-name

---
name: create-girls-name
description: Returns a random girl's name
allowed-tools: []
---

# Random Girl's Name Generator

Generate and return a random girl's name from a curated list of popular names.

## Task

1. Create a list of popular girl's names
2. Select one name randomly
3. Return the selected name in a friendly format

## Implementation

Use a simple random selection from predefined names including:

- Japanese names: Sakura, Yuki, Hana, Mei, Rin, Akari, Aoi, Ema, Kokoro, Nana
- Western names: Emma, Olivia, Ava, Sophia, Isabella, Mia, Charlotte, Amelia, Harper, Grace
- Other international names: Luna, Aria, Zoe, Maya, Nina, Lila, Cora, Ivy, Daphne, Rose

Select one name randomly and present it in a cheerful way.

Sub-agent: create-boys-name

---
name: create-boys-name
description: Returns a random boy's name
allowed-tools: []
---

# Random Boy's Name Generator

Generate and return a random boy's name from a curated list of popular names.

## Task

1. Create a list of popular boy's names
2. Select one name randomly
3. Return the selected name in a friendly format

## Implementation

Use a simple random selection from predefined names including:

- Japanese names: Hiroshi, Takeshi, Yuki, Haruto, Ren, Kaito, Sora, Riku, Daiki, Kenta
- Western names: Liam, Noah, Oliver, William, Elijah, James, Benjamin, Lucas, Henry, Alexander
- Other international names: Leo, Max, Felix, Oscar, Hugo, Theo, Kai, Nico, Luca, Marco

Select one name randomly and present it in a cheerful way.

View original on GitHub ↗

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