Real-time Output Monitoring and Dynamic Process Control for Bash Tool

Resolved 💬 5 comments Opened Jul 12, 2025 by npinto Closed Dec 10, 2025

Feature Request: Real-time Output Monitoring and Dynamic Process Control in Bash Tool

Summary

The Bash tool currently lacks real-time output monitoring and dynamic signal handling. This limits Claude Code’s ability to automate tasks that require conditional interruption, such as sending Ctrl-C when specific output appears.

Current Behavior

  • Runs commands to completion or with a fixed timeout
  • Captures output only after completion or timeout
  • Cannot send signals based on output content

Desired Behavior

Support for:

  1. Real-time output streaming during execution
  2. Signal dispatch (SIGINT, SIGTERM, etc.) based on matched output
  3. Interactive process control that mimics human terminal use

Example Use Case

Running ./sleep.sh (prints 1–10 with 1s delay each), and interrupting when "3" appears. Current implementation forces arbitrary timeout guesses.

Proposed API Enhancements

Bash(
  command="./sleep.sh",
  interrupt_on_output="3",
  signal="SIGINT"
)

Or more flexible:

Bash(
  command="./sleep.sh",
  output_handler=lambda output: "SIGINT" if "3" in output else None
)

Benefits

  • Enables automation of interactive CLI workflows
  • Facilitates signal-handling tests
  • Enables conditional runtime control
  • Emulates real terminal interactions

Impact

Improves Claude Code’s utility for interactive and interrupt-driven CLI automation.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 1.0.48
  • Feedback ID: 59b16051-93ab-4df5-8f3d-c026262720f9

---

Let me know if you'd like it styled for a GitHub issue, internal doc, or other format.

View original on GitHub ↗

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