OmniscioGuidesClaude Code Monitor tool
The Monitor tool: make Claude watch something and react
Claude can already send a command to the background. The Monitor tool is what feeds each output line back to Claude mid-conversation, so it can react to a log entry, a file change or a polled status as it arrives.
This page covers the watcher itself. The background tasks guide covers the shells and subagents running behind a session, which is the other list you can confuse with this one, and the tools guide covers the allow and deny rules a session reads.
Sources read November 25, 2026. By the Omniscio team. Updated .
What it is for
The Monitor tool lets Claude watch something in the background and react when it changes, without pausing the conversation. Anthropic lists five things to ask for:
- Tail a log file and flag errors as they appear.
- Poll a pull request or a CI job and report when its status changes.
- Watch a directory for file changes.
- Track output from a long-running script you point it at.
- Connect to a WebSocket feed and report each message as it arrives.
For most watches, Claude writes a small script, runs it in the background, and receives each output line as it arrives. For a server that already pushes events, it can open a WebSocket instead of running a script.
You do not call the tool yourself. You ask in words, and Claude decides whether the job is a watch, so the request reads like the work rather than like a command:
watch the dev server log and flag any error line as it appearsEvery watch has a deadline
Every watch Claude starts has a deadline: 5 minutes by default, at most 30, and at most 10 minutes in a non-interactive run given a single prompt with -p.
At the deadline the watch ends, and Claude gets one notice so it can start the watch again if it is still needed. That is the design, not a failure: a watch is a bounded wait, and a long one is a series of them.
A non-interactive run waits for its background work, and Anthropic documents Monitor watches among the things it waits for: the run continues until the watch times out or the 10-minute cap ends the wait, and Claude keeps responding to what the watch reports while it waits.
Stopping one
Stop a monitor by asking Claude to cancel it or by ending the session. When you stop a subagent that started monitors, for example from /tasks, those monitors stop with it.
A WebSocket watch has one more lever: its deadline applies to it too, and TaskStop cancels it early. Either way, a watch belongs to whatever started it, which is worth deciding before you open one on a long build.
The background tasks guide covers what /tasks shows and how a background shell differs from a watch.
The permission rules it inherits
When Monitor runs a command it uses the same permission rules as Bash, so the allow and deny patterns you set for Bash apply here too. In auto mode, Claude Code sets aside allow rules that name Monitor itself, along with the other broad allow rules it drops, so the classifier reviews Monitor commands the way it reviews Bash commands.
The consequence to know before you tighten your rules: a deny or ask rule written as Bash or Bash(*) also covers WebSocket watches. A deny rule in place at session start means Claude does not have the Monitor tool at all; a deny rule added during a session refuses the next call with a line that reads:
Permission to use Monitor has been denied: it runs code as Bash does, and a rule denies Bash.An ask rule prompts you instead, and Anthropic is explicit that nothing else can approve it on your behalf: you approve it, or a PermissionRequest hook does. Where nobody can answer, such as in dontAsk mode, the watch is denied. The ask rule, and a deny rule you add during a session, cover these watches in Claude Code v2.1.319 or later.
The fix is to narrow the rule to the commands you mean, such as Bash(rm *), rather than to every Bash command. The tools guide covers the rule format itself.
WebSocket watches
When a server already pushes events over a WebSocket, Claude can connect to it directly instead of writing a polling script. Each piece of socket activity either becomes an event or ends the watch.
- A text message becomes one event, even when the message spans several lines.
- A binary message is not passed through; Claude receives a placeholder such as
[binary frame, 512 bytes]instead. - A message larger than 1 MiB ends the watch, so subscribe to a filtered feed where one exists.
- A socket close ends the watch, and Claude receives the close code.
A WebSocket watch takes a ws input in place of a command, with a required url and an optional list of protocols, and a single call cannot combine the two. The URL has to be ws:// or wss://, with no embedded credentials or whitespace and ASCII characters only.
Anthropic denies URLs that point at a private, link-local or cloud-metadata address, including a hostname your machine resolves to one, and hosts in sandbox.network.deniedDomains. When allowManagedDomainsOnly is set in managed settings, it also denies any host outside the managed allowlist. Behind a proxy the address check does not follow the proxy's lookup, so the proxy has to block it.
If a watch behind a proxy fails with could not resolve <host>, restart on v2.1.319 or later with CLAUDE_CODE_PROXY_RESOLVES_HOSTS set to 1 so the proxy does the lookup.
Where it is not available, or not yet
- Windows: the tool is available only when Git Bash is installed.
- Provider and offline cases: on Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform or Microsoft Foundry, or with
DISABLE_TELEMETRYorCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICset, it needs Claude Code v2.1.310 or later, which applies when feature-flag fetching is off.
A plugin can also declare monitors that start automatically when the plugin is active, instead of Claude asking for one, so a watch can exist in a session where you never asked for it. The background tasks guide covers the other automation running behind a session.
One consequence of the deadline worth planning around: a watch is not a substitute for a build that takes an hour. The documented behaviour is that the watch ends, Claude is told once, and it can start again; a non-interactive run waits on the watch only until the cap.
Sources
Every line on this page rests on one of these. The date beside each one is the day we read it.
- Tools reference, for the Monitor tool entry, the five uses, the deadlines, stopping a watch, the Bash permission rules and refusals, the WebSocket behaviour and address denials, and the Windows and provider requirements. Read November 25, 2026.
- Headless mode, for what a non-interactive run waits for and the 10-minute cap on a watch. Read November 25, 2026.
The tool, its deadlines and the provider version floors all change between releases. Read the Monitor tool section again before you trust a copy of this page from a few months back.
Common questions
What is the Monitor tool in Claude Code?
It lets Claude watch something in the background and react when it changes without pausing the conversation: tailing a log for errors, polling a pull request or CI job, watching a directory, tracking a long script, or reading a WebSocket feed.
How long can a Monitor watch run?
Every watch has a deadline: five minutes by default and at most thirty. In a non-interactive run given a single prompt with -p, the cap is ten minutes. At the deadline the watch ends and Claude gets one notice, so it can start it again.
How do I stop a Monitor watch?
Ask Claude to cancel it, or end the session. A watch a subagent started stops when you stop that subagent, for example from /tasks.
Which permission rules apply to the Monitor tool?
It runs commands under the same permission rules as Bash, so allow and deny patterns written for Bash apply to Monitor too. A deny rule on every Bash command that is in place when the session starts leaves the session without the tool; one added during a session refuses the next call with a line saying it runs code as Bash does.
Does the Monitor tool work on Windows?
Only when Git Bash is installed, Anthropic says. On Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform and Microsoft Foundry, or with telemetry or nonessential traffic disabled, it needs Claude Code v2.1.310 or later, which applies when feature-flag fetching is off.
Watch several sessions at once
Omniscio runs several agent sessions side by side in one window, each with its own context and its own diff view, so a session that is waiting on a watch is one row among many. Any model, any harness: Claude Code, Codex, OpenCode, Devin, Pi and Hermes are all supported. A session whose process freezes right after you send it is picked up by Omniscio's auto-restart for stuck sessions.