[BUG] Tool usage fails when initializing with CLI prompt argument

Resolved 💬 5 comments Opened May 1, 2025 by Tuchis Closed Jan 3, 2026

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [x] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 0.2.97 (Claude Code), 0.2.94 (Claude Code)
  • Operating System: macOS 15.4.1
  • Terminal: iTerm2, Terminal App

Bug Description

When running Claude Code with the prompt argument, the program fails to execute tool calls as intended. Instead of interacting with the system (e.g., creating or reading files), it only prints the intended tool commands to the console, then proceeds without actually performing the tool actions.

Steps to Reproduce

  1. Install Claude Code with version 0.2.97
  2. Run claude with prompt using CLI: claude "Create hello_world.py in that folder"

Expected Behavior

The tool should execute system interactions, such as creating or reading files, and display the resulting action.
Example expected output:

> Create hello_world.py in that folder

⏺ Write(file_path: hello_world.py)…
  ⎿ Wrote 1 lines to hello_world.py
     print("Hello, World!")

⏺ Created hello_world.py successfully.

Actual Behavior

Instead of executing the tool calls, Claude just prints the commands without actually running them:

> Create hello_world.py in that folder

⏺ I'll create the hello_world.py file for you.

  print("Hello, World!")

Example when asking it to read a file:

> Read secret_file.txt in the folder and tell me the answer

⏺ I'll check the contents of secret_file.txt for you.

  cat secret_file.txt

We can see, that Claude outputs intended command cat, but doesn't interact with tool call.

Additional Context

Issue may be related to Issue #919

  • This issue only occurs when using the prompt argument on startup.
  • When entering the same command manually in the interactive window (even the same one), the tools execute correctly.

Example:

> Read secret_file.txt in the folder and tell me the answer

⏺ I'll read the secret_file.txt file for you.

  cat secret_file.txt

> Read secret_file.txt in the folder and tell me the answer

⏺ I'll read the secret_file.txt file for you now.

⏺ Read(secret_file.txt)…
  ⎿  Read 2 lines (ctrl+r to expand)

⏺ The answer is "hello world"

Affected versions:

  • Bug present in versions 0.2.94 and 0.2.97
  • Works correctly in version 0.2.92

View original on GitHub ↗

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