[BUG] Opus 4.7 (1M) intermittently emits empty-string values for tool_use.input fields, killing the session
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?
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:
- Start a Claude Code session with model = Opus 4.7 (1M context).
- Work normally for a while — mix of Bash, Read, Edit, TaskCreate, Skill calls (parallel and single).
- At some point a tool call returns "Tool ran without output or errors" with no real error.
- 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.
- 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:
- 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.
- Prompt-cache / KV-cache contamination at tool_use string positions in long sessions.
- 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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗