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:
- Real-time output streaming during execution
- Signal dispatch (SIGINT, SIGTERM, etc.) based on matched output
- 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.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗