[Feature Request] Auto-propose fix when shell commands fail with non-zero exit code

Resolved 💬 1 comment Opened Apr 28, 2026 by ericol Closed May 30, 2026

Bug Description
Feature Request: Auto-propose fix when a ! command fails

Currently, when a user runs a ! shell command, the output is wrapped in a <local-command-caveat> that instructs Claude to ignore it unless explicitly asked.
This works well for successful commands, but creates friction when a command fails.

Requested behavior: When a ! command exits with a non-zero status, Claude should override the caveat and proactively respond — either proposing a corrected
command for the user to review, or (for straightforward failures) offering to fix it directly.

Why this matters: Users run ! commands directly because it's faster and avoids Claude misinterpreting the request. But these commands often depend on file
context (paths, project structure, environment) that can cause them to fail. Right now, a failed command requires the user to manually re-engage Claude with
something like "fix that" — an extra round-trip that negates the speed benefit of running the command directly in the first place.

Proposed trigger: Exit code ≠ 0. The caveat behavior would remain unchanged for successful commands.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.121
  • Feedback ID: 56db9e15-7bea-4a20-99c5-9a416633583d

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗