claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] API Error 400 "tool use concurrency issues" occurs only in print mode (-p), not in interactive mode

Open convcha opened this issue 4 weeks ago • 0 comments

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 running Claude Code in print mode (-p flag), even simple commands like echo hello fail with "API Error: 400 due to tool use concurrency issues."

This error does NOT occur in interactive mode - only in print/pipeable mode.

I'm aware that #11421 is still open for the same error message, but that issue describes a different scenario:

  • #11421: Occurs in interactive mode during parallel tool execution (3 Bash commands running simultaneously)
  • This issue: Occurs in print mode (-p) with simple prompts like echo hello, with NO parallel tool execution involved

Since this appears to be a print-mode-specific manifestation of the underlying issue (and print mode was not covered in #11421 or the many closed duplicates like #8763, #9433, #9103, #9002, #15261), I'm filing a new issue to track this specific case.

What Should Happen?

Claude Code should execute simple commands in print mode without API errors, just as it does in interactive mode.

Error Messages/Logs

~ via 🥟 v1.3.6
❯ claude -p --dangerously-skip-permissions "echo hello"
API Error: 400 due to tool use concurrency issues.

~ via 🥟 v1.3.6 took 9s
❯ claude -p "echo hello"
API Error: 400 due to tool use concurrency issues.

Steps to Reproduce

  1. Open terminal
  2. Run claude -p "echo hello" or claude -p --dangerously-skip-permissions "echo hello"
  3. Observe the 400 error

Note: The same prompt works fine in interactive mode (claude without -p).

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.7

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • This appears to be a print-mode-specific issue, as interactive mode works without problems
  • Multiple MCP servers are configured, but the error occurs even with minimal prompts
  • Related open issue: #11421 (different scenario - interactive mode with parallel tools)
  • Related closed issues: #8763, #9433, #9103, #9002, #15261

convcha avatar Jan 14 '26 11:01 convcha