watch

watch is a command for coding agents from openclaw/crabbox. It costs 0 tokens per session (1,013 once invoked), scanned A, original, MIT.

A command that reruns another command whenever files in the local repository change, using the same held remote lease.

In plain words
What is it for?
Automatically rerunning tests or checks during development, with options for keeping or releasing the remote machine.
Why use it?
It removes the need to stop and restart checks manually after every code change.

Command

About the project

Crabbox is a remote execution control plane that lets a local command run on managed cloud capacity, an SSH host, or another delegated sandbox while syncing code, streaming output, and recording evidence. It is for maintainers, contributors, teams, AI agents, and automation that need repeatable remote testing, builds, browser checks, or platform-specific validation. The catalogue add-ons provide commands and instructions for controlling Crabbox runs.

openclaw/crabbox · 1,368 stars · on GitHub · crabbox.sh

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/openclaw/crabbox/watch
Clone the repo
git clone --depth 1 https://github.com/openclaw/crabbox

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for watch

README.md
[![agentmods](https://agentmods.dev/badge/commands/openclaw/crabbox/watch.svg)](https://agentmods.dev/commands/openclaw/crabbox/watch)
Your own site
<a href="https://agentmods.dev/commands/openclaw/crabbox/watch"><img src="https://agentmods.dev/badge/commands/openclaw/crabbox/watch.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,013 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01013
Opus 5 $0.00000 $0.00507
Sonnet 5 $0.00000 $0.00203
Haiku 4.5 $0.00000 $0.00101

Measured 2d ago against content hash d5c313555e6d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

watch scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/watch.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

watch

crabbox watch runs a command on a warm lease, then watches the local repository and re-runs the command whenever synced files change. Each iteration goes through the normal crabbox run pipeline against the same held lease, so sync fingerprints, run history, results, artifacts, and attach behave exactly as they do for run. It automates the manual warm-lease loop described in the performance guide.

crabbox watch -- pnpm test:changed
crabbox watch --id swift-crab -- go test ./...
crabbox watch --debounce 500ms --idle-exit 10m -- pnpm check
crabbox watch --provider hetzner --keep -- make test

Requires an SSH lease provider that advertises the crabbox-sync feature (see crabbox providers). Delegated and archive-sync providers are rejected with an error; use crabbox run for those.

Lease lifecycle

  • With --id, watch reuses an existing claimed lease and never releases it; exiting the loop leaves the box running, like crabbox run --id.
  • Without --id, watch acquires a fresh lease (all warmup lease-creation flags apply) and releases it on every exit path: idle exit, Ctrl-C, and failures. Pass --keep to retain the lease instead.

Change detection

The initial run starts immediately. After that, filesystem events are debounced (default 250ms) and each batch is qualified against the exact sync universe: Git tracked and non-ignored untracked files, minus the built-in excludes, sync.exclude config, and .crabboxignore rules, and limited to the sync.include whitelist when one is configured. Ignored churn such as node_modules or build output never triggers a run and never counts as activity. Edits to .gitignore, .crabboxignore, or repo-local config are picked up live. Newly created directories are watched recursively; symlinked directories outside the repository root are not followed.

Runs never overlap. A change that lands while a run is active queues exactly one rerun, which starts from the newest tree once the active run finishes. A non-zero remote exit is a normal iteration result and the loop keeps watching; watcher, lease, and sync failures end the loop. One Ctrl-C exits and applies the lease lifecycle rules above.

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 88 lines · 0 tokens per session scan A d5c313555e6d

Subscribe to this mod's changes

watch is a command published in the GitHub repository openclaw/crabbox (1,368 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,013 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.