Ignoring Non-Fatal Tool Output / Stderr
Phase: Execution (Phase 3 in the failure chain documented in #32650)
Description
When Claude executes a tool (build script, SQL apply, git command, etc.) and the command exits with code 0 but prints warnings, errors to stderr, or text indicating a logical failure, Claude ignores the output entirely. As long as the tool call itself didn't hard-crash, Claude confidently proceeds and reports success.
Concrete Examples
-
SQL apply with warnings: MySQL outputs Query OK, 0 rows affected (0.01 sec) followed by 3 warnings — Claude reports "Applied cleanly" without checking what the warnings were. The warnings could indicate truncated data, implicit type conversions, or ignored duplicate keys.
-
Build with critical warnings: A C++ build completes (exit 0) but emits warnings about narrowing conversions, uninitialized variables, or deprecated function usage. Claude reports "Build succeeded" without noting the warnings, some of which may indicate runtime bugs.
-
Git operations with fuzz: git apply succeeds but reports fuzz factor or offset adjustments. Claude reports the patch applied cleanly when it may have applied to the wrong location.
-
Command output indicating logical failure: A query returns 0 rows when rows were expected, or a count doesn't match expectations. The command "succeeded" (exit 0) but the result indicates something went wrong. Claude treats exit-code-0 as categorical success.
Root Cause
Claude's success/failure evaluation appears to be primarily based on whether the tool call returned an error vs. completed normally. It does not systematically parse stdout/stderr content for indicators of partial failure, warnings, or unexpected results.
Expected Behavior
After any tool execution, Claude should:
- Check the exit code
- Parse stdout/stderr for warning indicators (the word "warning", "error" in output, unexpected counts, fuzz/offset messages)
- If warnings are present, surface them to the user before claiming success
- If the output indicates a logical failure (0 rows affected when rows were expected), flag it rather than treating exit-0 as success
Why This Is Distinct
Related Issues
Environment
- Claude Code 2.1.71
- Windows 11
- 100+ sessions of documented usage
Ignoring Non-Fatal Tool Output / Stderr
Phase: Execution (Phase 3 in the failure chain documented in #32650)
Description
When Claude executes a tool (build script, SQL apply, git command, etc.) and the command exits with code 0 but prints warnings, errors to stderr, or text indicating a logical failure, Claude ignores the output entirely. As long as the tool call itself didn't hard-crash, Claude confidently proceeds and reports success.
Concrete Examples
SQL apply with warnings: MySQL outputs
Query OK, 0 rows affected (0.01 sec)followed by3 warnings— Claude reports "Applied cleanly" without checking what the warnings were. The warnings could indicate truncated data, implicit type conversions, or ignored duplicate keys.Build with critical warnings: A C++ build completes (exit 0) but emits warnings about narrowing conversions, uninitialized variables, or deprecated function usage. Claude reports "Build succeeded" without noting the warnings, some of which may indicate runtime bugs.
Git operations with fuzz:
git applysucceeds but reports fuzz factor or offset adjustments. Claude reports the patch applied cleanly when it may have applied to the wrong location.Command output indicating logical failure: A query returns 0 rows when rows were expected, or a count doesn't match expectations. The command "succeeded" (exit 0) but the result indicates something went wrong. Claude treats exit-code-0 as categorical success.
Root Cause
Claude's success/failure evaluation appears to be primarily based on whether the tool call returned an error vs. completed normally. It does not systematically parse stdout/stderr content for indicators of partial failure, warnings, or unexpected results.
Expected Behavior
After any tool execution, Claude should:
Why This Is Distinct
Related Issues
Environment