Monitor: auto-mute superseded watchers when a new Monitor targets the same file/pattern
Resolved 💬 3 comments Opened Apr 21, 2026 by jmoran-dev Closed Apr 24, 2026
When Monitor is re-armed on the same log file (e.g. because the CI gate restarted in a new artifacts directory), the old Monitor task keeps firing "stream ended" / "timed out" notifications long after it's been superseded. These pollute the conversation with events from watchers the agent isn't tracking anymore.
Repro
- Arm
Monitorontasks/logA.out. - Kill and restart the underlying script so its output goes to
tasks/logB.out. - Arm a second
MonitoronlogB.out.
Both Monitors emit events; the first fires [Monitor timed out — re-arm if needed.] after its timeout even though it's irrelevant to what the agent is currently tracking.
Observed over one ~4-hour session
Three superseded Monitors timed out and pinged the conversation after newer Monitors had replaced them on different files.
Proposed
Any of:
- Automatically stop a Monitor when a newer Monitor is armed with an overlapping description or the same underlying output file.
- Let the agent supersede old monitors via a flag on the new call (e.g.
supersede=true). - Add a first-class
Monitor.stoptool parity withTaskStop.
Environment
- Claude Code (CLI) running inside VS Code extension
- Opus 4.7 (1M context)
- Windows 11 + Git Bash
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗