watch-folder

watch-folder is a command for Claude Code from coltonbearden/carrel. It costs 20 tokens per session (1,215 once invoked), scanned A, original, MIT.

A command for monitoring a folder and running carrel actions when files appear or change.

In plain words
What is it for?
It helps run commands for newly created or modified files, with options for filtering, waiting briefly between events, one-time runs, time limits, and machine-readable logs.
Why use it?
It automates repeated file processing and can limit the work to selected file types or events.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the carrel-watch plugin — 1 skill, 2 commands shipped together

Good fit It helps run commands for newly created or modified files, with options for filtering, waiting briefly between events, one-time runs, time limits, and machine-readable logs.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/coltonbearden/carrel/watch-folder
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.

Clone the repo
git clone --depth 1 https://github.com/coltonbearden/carrel

Made for: Claude Code.

Or install carrel-watch, the plugin that ships this one along with the rest of its 1 skill, 2 commands.

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-folder

README.md
[![agentmods](https://agentmods.dev/badge/commands/coltonbearden/carrel/watch-folder/github.svg)](https://agentmods.dev/commands/coltonbearden/carrel/watch-folder)
Your own site
<a href="https://agentmods.dev/commands/coltonbearden/carrel/watch-folder"><img src="https://agentmods.dev/badge/commands/coltonbearden/carrel/watch-folder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for watch-folder

Your own site · 80×15
<a href="https://agentmods.dev/commands/coltonbearden/carrel/watch-folder"><img src="https://agentmods.dev/badge/commands/coltonbearden/carrel/watch-folder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 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,215 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00020 $0.01215
Opus 5.5 $0.00008 $0.00486
Sonnet 5.5 $0.00004 $0.00243
Haiku 4.5 $0.00002 $0.00121

Measured 1mo ago against content hash 26ad8d8477a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

watch-folder 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 1mo 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.

plugins/carrel-watch/commands/watch-folder.md · 77 lines

How it starts

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

Set up a folder watch for: $ARGUMENTS

Run the carrel CLI via Bash. Map the user's request onto the real flags in the --help block below (regenerated from the CLI by scripts/sync_plugins.py; if the installed carrel watch --help differs, trust the installed version — never invent flags):

Usage: carrel watch [OPTIONS] DIRECTORY

  Watch DIRECTORY and run shell actions on file events.

  Events for files an action is currently producing are suppressed via an in-flight set plus an
  output-name heuristic (outputs whose name starts with the source file's stem); other action
  outputs written into the watched directory WILL re-trigger — write outputs elsewhere or use --glob
  to narrow matches. --stable waits for a file to stop growing, --existing processes what is already
  there, --poll works where inotify does not (/mnt/c, shares), --done-dir/--error-dir file sources
  away after their actions, --log keeps a JSON trail. Ctrl-C exits cleanly.

  --done-dir/--error-dir refuse to start (exit 2) when they would move files git is tracking;
  --allow-tracked overrides. Actions themselves are never guarded — what a --run command does is the
  user's business.

Options:
  --on EVENTS                     Comma-separated events to react to: created, modified, deleted,
                                  moved, existing.  [default: created,modified]
  --glob PATTERN                  Only react to file names matching this glob (e.g. '*.pdf').
  --run CMD                       Shell action to run per event; repeatable, runs in order. {path},
                                  {name}, {stem}, {ext}, {dir} are substituted (shell-quoted).
                                  [required]
  --recursive                     Watch subdirectories too.
  --existing                      Queue the files already in DIRECTORY at start (event 'existing').
  --stable SECS                   Act only once a file's size and mtime have not changed for SECS
                                  (scanners, big copies).  [x>0]
  --stable-timeout SECS           With --stable: give up waiting and act after SECS regardless.
                                  [x>0]
  --poll                          Poll instead of inotify (needed on /mnt/c, network shares, some
                                  containers).
  --poll-interval SECS            With --poll: how often to scan.  [default: 1.0; x>0]
  --done-dir DIRECTORY            Move each source here after its actions all succeed.
  --error-dir DIRECTORY           Move each source here after an action fails.
  --log FILE                      Append one JSON record per action (and per move) to FILE.
  --allow-tracked                 With --done-dir/--error-dir: move files even when git tracks them.
  --force                         Deprecated spelling of --allow-tracked; warns when it bypasses the
                                  guard.
  --print-service [systemd|schtasks]
                                  Print a service definition that runs this exact watch at login,
                                  then exit.
  --debounce MS                   Coalesce events per path within this window.  [default: 500; x>=0]
  --once                          Exit after the first triggered action batch.
  --timeout SECS                  Hard stop after SECS seconds.  [x>0]
  --action-timeout SECS           Kill an action that runs longer than SECS (logged as rc=124).
                                  [default: 300.0; x>0]
  --json-lines                    Log one JSON object per action to stdout instead of human lines
                                  (--json implies this).
  --json                          Machine-readable JSON output.
  --help                          Show this message and exit.
  • --on: comma-separated events (created, modified, deleted, moved); default created,modified.
  • --glob: only react to matching filenames.
  • --run CMD (required; repeatable, runs in order): the action; {path}, {name} and {dir} are substituted (shell-quoted for you).
  • --once: exit after the first triggered action batch — use for demos/tests. --timeout SECS: hard stop. --action-timeout SECS: kill a runaway action (logged as rc=124).
  • --debounce MS (default 500): coalesce editor save-storms. --json-lines: machine-readable event log on stdout.

Read the full file on GitHub · 77 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. 1mo ago Changed · +2 lines 26ad8d8477a0
  2. 1mo ago Changed · +23 lines 51b60d680037
  3. 1mo ago Changed · +25 lines f58098e52631
  4. 1mo ago Changed d4c6990de9f2
  5. 1mo ago First seen · 27 lines · 20 tokens per session scan A 6819fd6bb188

Subscribe to this mod's changes

watch-folder is a command published in the GitHub repository coltonbearden/carrel (2 stars, last pushed 2d ago), licensed MIT. It adds 20 tokens to every session and 1,215 once invoked, about $0.0001 per session on Opus 5.5. 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-08-31.