claude-code - 💡(How to fix) Fix [BUG] Opus 4.7 (1M) intermittently emits empty-string values for tool_use.input fields, killing the session

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Tool ran without output or errors (每次工具调用都返回这一行,无 stack trace、无 API error、无 rate limit;底层 tool_use.input 形如 {"command": "", "description": ""}。)

Root Cause

Looks like a harness bug at first glance because the surface symptom is "Tool ran without output or errors", but the underlying cause is model-side: the model is emitting {"command": "", "description": ""} etc. as the tool input. Schema-correct, value-empty.

Fix Action

Fix / Workaround

Heuristic workaround that reliably works: if two consecutive tool calls return "Tool ran without output or errors", /clear or open a new session immediately.

Code Example

Tool ran without output or errors
  (每次工具调用都返回这一行,无 stack trace、无 API error、无 rate limit;底层 tool_use.input 形如 {"command": "", "description": ""}。)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

In Claude Code with Opus 4.7 (1M context), the assistant intermittently enters a failure mode where tool_use blocks are schema-correct but every string-typed input value is emitted as "" (empty string). The harness then runs empty commands / opens empty paths and surfaces "Tool ran without output or errors" or empty errors.

Once triggered, the failure persists for the rest of the session. The model cannot self-recover. Upgrading the CLI does not help. Only starting a new session clears it.

Affected tools observed (not tool-specific): Bash, Read, Write, Edit, TaskList, TaskCreate, Skill. Reproduces with both parallel and single tool calls.

Looks like a harness bug at first glance because the surface symptom is "Tool ran without output or errors", but the underlying cause is model-side: the model is emitting {"command": "", "description": ""} etc. as the tool input. Schema-correct, value-empty.

Hit 3 times in one day across separate sessions (2026-05-28).

What Should Happen?

Tool_use.input string fields should contain the intended argument values (commands, file paths, descriptions, etc.), not empty strings. The model should not enter a self-reinforcing failure mode where prior empty-input tool_use blocks in conversation history bias subsequent generations toward empty inputs.

Error Messages/Logs

Tool ran without output or errors
  (每次工具调用都返回这一行,无 stack trace、无 API error、无 rate limit;底层 tool_use.input 形如 {"command": "", "description": ""}。)

Steps to Reproduce

Not deterministic, but the pattern is consistent:

  1. Start a Claude Code session with model = Opus 4.7 (1M context).
  2. Work normally for a while — mix of Bash, Read, Edit, TaskCreate, Skill calls (parallel and single).
  3. At some point a tool call returns "Tool ran without output or errors" with no real error.
  4. Observation: from that point onward, ~every subsequent tool_use emits empty-string values for all string inputs. Bash runs empty commands, Read opens empty paths, Edit produces no diff, etc.
  5. Restarting the same session does not clear it. Upgrading the CLI does not clear it. /clear or starting a fresh session does clear it.

Heuristic workaround that reliably works: if two consecutive tool calls return "Tool ran without output or errors", /clear or open a new session immediately.

Decisive evidence to pull from server-side logs: the raw tool_use.input JSON for an affected turn. That confirms whether string fields are literally "" vs missing keys vs malformed JSON repaired downstream — the distinction matters because it separates a constrained-decoding zero-length-sample regression from a JSON-repair artifact.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

I'm not sure if it's related to the version, because I encountered this problem in both version 2.1.132 and 2.1.153. The only peculiar thing is that this problem only occurred today and it has never happened before.

Claude Code Version

2.1.132 and 2.1.153.

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

Exact model: claude-opus-4-7 (1M context) OS: macOS, Darwin 25.3.0 Shell: zsh Frequency: 3 occurrences in one day (2026-05-28), separate sessions.

Hypotheses, model-side, ordered by likelihood:

  1. Constrained-decoding regression on tool_use.input.<string> fields — zero-length string sampled, then self-reinforced because prior empty-input tool_use blocks appear in conversation history and the model imitates its own outputs.
  2. Prompt-cache / KV-cache contamination at tool_use string positions in long sessions.
  3. Parallel tool_use emission edge case — less likely as sole cause; reproduces with single calls too.

Suggested triage: pull raw tool_use.input JSON for an affected turn. If string fields are literally "" (not missing keys, not repaired malformed JSON), that points at constrained-decoding sampling. If keys are missing or values are getting normalized post-hoc, that points at the JSON-repair path.

Impact while in failure mode: cannot edit files, run shell commands, read files, list tasks, or invoke skills. User must manually copy plans/diffs out of chat. Session-killing for agentic workflows.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING