Claude Code Monitor Tool: Stream Live Events from Background Scripts

Claude Code

Claude Code v2.1.98 introduces the Monitor tool, a new built-in capability that lets users stream live events from background scripts running within their session. Rather than launching a script and waiting blindly for it to finish, developers can now observe its output in real time as Claude Code processes it. This is particularly valuable for long-running build processes, test suites, and automation scripts where visibility into intermediate progress matters.


The Monitor Tool: Real-Time Visibility Into Background Scripts

Claude Code v2.1.98 introduces the Monitor tool, a significant addition to the agent observability toolkit. The tool addresses a fundamental friction point in agentic workflows: when Claude Code launches a background script, users have historically had to wait for the process to complete before seeing any output. Monitor changes this by enabling live streaming of events from background scripts directly into the active session.

What Monitor Does

When a background script is running within a Claude Code session, the Monitor tool allows Claude to observe its stdout events as they are emitted β€” line by line, in real time. This means Claude can react to output as it happens rather than waiting for the process to exit. A test suite that emits per-test results, a build system that logs compilation steps, or a file watcher that signals detected changes can all be observed and acted upon incrementally.

This capability is conceptually similar to what developers do when they tail a log file or pipe output through a real-time filter. The difference is that Monitor integrates this observation natively into Claude Code's tool execution model, making it composable with other agentic actions.

Use Cases

Long-running test suites are among the most compelling applications. Rather than waiting for an entire test run to finish before diagnosing failures, Claude can identify failing tests as they occur and begin analyzing root causes while the remaining tests continue executing.

Build and compilation pipelines benefit similarly. Claude can detect compilation errors mid-build, surface warnings that appear early in the output, and take corrective action β€” or advise the user β€” without waiting for the full build to complete.

File watchers and process monitors gain new utility. A watcher process that emits events on file changes can be observed by Monitor, allowing Claude to respond to changes in the project in near real time.

Observability Within the Broader Claude Code Architecture

Monitor does not exist in isolation β€” it fits into a broader observability and orchestration story that Claude Code has been building across recent releases. The hooks system (introduced to allow scripts to run at key lifecycle points), Channels (for inter-agent communication), and Dispatch (for launching subagents) together form the scaffolding of Claude Code's agentic infrastructure. Monitor extends this foundation by providing a read path into running processes, complementing the write and coordination capabilities that already exist.

With Monitor, Channels, and Dispatch in place, Claude Code sessions can now both launch background work and continuously observe it β€” a key step toward more autonomous, self-correcting agentic loops.

Other Notable Changes in v2.1.98

Bash Tool Permission Fixes

v2.1.98 also addresses a set of bugs affecting Bash tool permissions. The specific issues are not detailed in the public changelog, but the fix signals continued investment in making permission management more predictable and less prone to edge-case failures β€” an important area given how central the Bash tool is to Claude Code's value proposition.

/resume Session Picker Improvements

The /resume command, which allows users to return to a previous Claude Code session, received improvements to its session picker interface in this release. The picker UI has been refined to make it easier to identify and select the right session to resume, reducing friction in multi-session workflows where developers switch between several in-flight tasks.