Agent skill

Watch

by SethGammon in SethGammon/Citadel

File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills.

MITAuto-check passedData & Analytics

Install Watch

skills CLI
$ npx skills add SethGammon/Citadel --skill watch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SethGammon/Citadel watch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SethGammon/Citadel.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/watch .claude/skills/watch && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
watch
GitHub stars
922
Token cost
~2.9k tokens
SKILL.md length
1,236 words
Files
2
Skills in repo
48
Repo updated
First seen
Licence
MIT

At a glance

File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills.

  • Works in 12 steps: Check for existing watch → Determine baseline commit → Create poll schedule (--remote only) → …
  • Appropriate skills
  • SKILL.md covers Orientation, Default execution path (READ…, Commands and Protocol, plus 5 more sections
  • Calls git and npm

What it does

Watch is an agent skill from SethGammon/Citadel. File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through /do. Use for automatic reactions to file changes; do NOT use for one-off inspection or tasks needing human judgment per file.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `__benchmarks__/marker-dedup-two-scans.md`).

It sits in Data & Analytics, covering Data pipelines and ETL. It works with Git. The repository describes itself as: The operating layer for Claude Code + OpenAI Codex: persistent project memory, intent routing, safety hooks, cost telemetry, and parallel agent fleets. The licence is MIT.

When your agent uses it

  • Appropriate skills
  • Automatic reactions to file changes
  • Do NOT use for one-off inspection
  • Tasks needing human judgment per file

Example prompts

  • “/watch”

Requirements

  • Node.js

Workflow steps

12 steps, taken from the step headings in SKILL.md.

  1. Check for existing watch
  2. Determine baseline commit
  3. Create poll schedule (--remote only)
  4. Write state file
  5. Confirm (--remote only)
  6. Load state
  7. Detect changed files
  8. Scan for marker comments
  9. Classify unmarked changes
  10. Dispatch markers
  11. Write intake items
  12. Update state

What it can do on your machine

Read from SKILL.md and the folder at commit e41ff1d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Watch loads about 2.9k tokens when it runs. Until then it costs about 96 tokens; SKILL.md has 1,236 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SethGammon/Citadel at commit e41ff1d, republished under its MIT licence (© SethGammon). 1,236 words, ~2,882 tokens.

Download SKILL.mdSave it as .claude/skills/watch/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
watch
description
File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through /do. Use for automatic reactions to file changes; do NOT use for one-off inspection or tasks needing human judgment per file.
license
MIT
user-invocable
true
auto-trigger
false
trigger_keywords
watch, watch files, watch changes, file sentinel, monitor files, watch start, watch stop, watch scan, marker comments, @citadel
last-updated
2026-03-29

/watch -- File Sentinel

Use when the user wants automatic reactions to file changes or marker comments (@citadel:). Do NOT use for one-off file inspection or tasks that need human judgment per file.

Orientation

Use when: running a file sentinel that triggers a skill or command automatically when watched paths change. Don't use when: monitoring CI status on a PR (use /pr-watch); running a one-shot verification check (use /verify).

Default execution path (READ FIRST)

/watch start does NOT call CronCreate by default. Only pass --remote to use Anthropic's routine system, and only after explicit user confirmation. CronCreate counts against the 15 routine runs / 24h cap — at the default 5-minute interval a watch exhausts the quota in under an hour.

Default flow — /watch start (no --remote flag)
  1. Do Steps 1 and 2 below (check existing watch, determine baseline commit).
  2. Skip Step 3 — do NOT call CronCreate. Leave cronId: null in state.
  3. Write the state file (Step 4) with status: "watching".
  4. Output:
    Watch state created: .planning/watch-state.json
      Baseline: {commit hash, first 7 chars}
    
    To start real-time watching, run in a separate terminal:
      npm run watch:local
    
    For cloud-persistent polling (machine off, user away):
      /watch start --remote     (uses CronCreate, counts against 15/day cap)
Opt-in routine flow — /watch start --remote

Only when --remote is explicitly passed:

  1. Confirm: "This will use CronCreate, which counts against your 15 routine runs / 24h quota. At a 5-minute interval this exhausts the quota in under an hour. Continue? (y/N)"
  2. On confirmation, run the full Step 1–5 protocol including CronCreate.

Commands

CommandBehavior
/watch startDefault: create state, prompt user to run npm run watch:local
/watch start --remoteUse CronCreate polling (counts against 15/day quota — requires confirmation)
/watch start --interval {N}mSet poll interval for --remote mode (default: 5m)
/watch stopStop watching, tear down cron
/watch statusShow watch state, last scan time, pending actions
/watch scanRun a single scan now (manual trigger)

Protocol

/watch start
Step 1: Check for existing watch
  1. Read .planning/watch-state.json if it exists
  2. If status is "watching":
    • Show current state: last scan time, interval, pending actions count
    • Ask: "A watch is already active. Stop it and start a new one?"
    • If yes: run /watch stop first, then continue
    • If no: abort
Step 2: Determine baseline commit
  1. Run git rev-parse HEAD to get the current commit hash
  2. If not a git repo: fall back to timestamp-based detection (store current time as lastScanTime, skip commit-based diffing)
  3. Store this as lastScanCommit
Step 3: Create poll schedule (--remote only)
CronCreate:
  interval: "{N}m"  (default: 5m)
  command: "/watch scan"

Save the cron ID in the state file.

Step 4: Write state file

Write .planning/watch-state.json:

json
{
  "status": "watching",
  "lastScanCommit": "abc1234",
  "lastScanTime": null,
  "interval": "5m",
  "cronId": "{id from step 3 or null}",
  "pendingActions": {},
  "processedMarkers": {},
  "stats": {
    "scansRun": 0,
    "markersFound": 0,
    "intakeItemsCreated": 0,
    "skillsDispatched": 0
  }
}
Step 5: Confirm (--remote only)
Watch started.
  Interval:  every {N}m
  Baseline:  {commit hash, first 7 chars}
  State:     .planning/watch-state.json

/watch stop
  1. Read .planning/watch-state.json. If missing or not "watching": "No watch is active."
  2. CronDelete: {cronId} — if cronId is missing or deletion fails, continue.
  3. Update state: "status": "stopped", "cronId": null. Preserve all other fields.
  4. Output:
    Watch stopped.
      Scans completed:      {stats.scansRun}
      Markers found:        {stats.markersFound}
      Intake items created: {stats.intakeItemsCreated}
      Skills dispatched:    {stats.skillsDispatched}

/watch status
  1. If .planning/watch-state.json missing: "No watch configured. Use /watch start to begin."
  2. Output state fields: status, lastScanTime, lastScanCommit, interval, pendingActions.length, stats.
  3. If pendingActions non-empty, list each: [{action}] {file}:{line} -- {description}

/watch scan
Step 1: Load state
  1. Read .planning/watch-state.json
  2. If missing: create default state with lastScanCommit from git rev-parse HEAD and status: "watching".
Step 2: Detect changed files

Git mode (primary):

  1. git diff --name-only {lastScanCommit} HEAD (committed changes)
  2. git diff --name-only (unstaged) and git diff --name-only --cached (staged)
  3. Merge and deduplicate all three lists

Fallback mode (no git):

  1. find . -newer {timestamp_file} -type f
  2. Exclude node_modules/, .git/, .planning/, dist/, build/

If no files changed: update lastScanTime and stats.scansRun, exit early.

Step 3: Scan for marker comments

Search changed files for:

PatternLanguages
// @citadel: {action} {description}JS, TS, Go, Rust, C, Java
# @citadel: {action} {description}Python, Shell, YAML, Ruby
/* @citadel: {action} {description} */CSS, multi-line C-style
<!-- @citadel: {action} {description} -->HTML, Markdown

Action-to-skill mapping:

ActionSkill
review/review
test/test-gen
fix/systematic-debugging
document/doc-gen
refactor/refactor
todointake item

Unknown actions become intake items with the action preserved as metadata.

Deduplication: Every marker gets a stable identity hash: sha256 over {file path}, {action}, and the normalized marker text (trimmed, internal whitespace collapsed), joined with NUL separators and truncated to 16 hex chars. Line numbers are excluded, so the hash survives line shifts. processedMarkers is a map keyed by this hash with {file, action, firstSeen, lastSeen}; pendingActions uses the same hash keys. Both maps are pruned past 500 entries by dropping the oldest lastSeen. Markers whose hash is already in processedMarkers are skipped.

Show full SKILL.md (533 more words)Show less
Step 4: Classify unmarked changes
File patternAuto-action
*.test.*, *.spec.*, __tests__/*Queue: "run tests" intake item
*.md in docs/ or project rootQueue: "doc staleness check" intake item
src/**/*.ts, src/**/*.tsxQueue: "changed source" intake item
package.json, tsconfig.jsonQueue: "config change" intake item (high priority)
Step 5: Dispatch markers

For each new marker:

  1. /do {action} in {file} at line {line}: {description}
  2. Log dispatch, add to processedMarkers, increment stats.skillsDispatched

Batch limit: Dispatch at most 5 per scan. Queue overflow in pendingActions.

Step 6: Write intake items

Filename: watch-{action}-{file slug}-{epoch ms}.md in .planning/intake/

markdown
---
title: "{action} {file}:{line}"
status: pending
priority: normal
target: {file path}
source: watch
marker_hash: {16-char marker hash}
---

Marker comment found at {file}:{line}:
`{raw marker line}`

{description, if any}

Before writing, skip the item if the marker hash is already in processedMarkers, or if any existing .planning/intake/*.md carries a matching marker_hash in its frontmatter. Every new intake item records its marker_hash so future scans (and concurrent processes) can detect it.

Step 7: Update state
  • lastScanCommit: git rev-parse HEAD
  • lastScanTime: current ISO timestamp
  • Increment stats.scansRun, stats.markersFound
  • Update pendingActions and processedMarkers
Step 8: Report

Manual scan:

Scan complete.
  Files changed:      {N}
  Markers found:      {new} ({total} total)
  Actions dispatched: {N} (batch limit: 5)
  Intake items:       {N} written to .planning/intake/
  Pending actions:    {N}

Cron poll: silent.


Integration Points

  • Intake pipeline: Writes to .planning/intake/ for /autopilot.
  • Intent router: Routes markers through /do — never invokes skills directly.
  • Daemon: /daemon can start a watch alongside a campaign.

Fringe Cases

.planning/ missing: Create on first scan. Not a git repo: Fall back to timestamp detection; warn once. No files changed: Update stats, exit silently. Unknown action: Treat as intake item, preserve raw action. Deleted file: Skip marker scanning; write intake item noting deletion. Large diff (100+ files): Cap at 50 per scan, queue rest. Binary files: Skip during marker scanning. Corrupted state: Reset to defaults, preserve processedMarkers if readable. CronCreate not available: Warn and suggest manual /watch scan. Scan overlap: Scans serialize through a lock directory (.planning/watch-state.json.lock, acquired via atomic mkdir with ~10 retries at 100ms). Each scan records scanStartedAt and scanPid in state under the lock, and holds the lock across the state read-modify-write and intake writes. A scan that cannot acquire the lock and finds another scan started under 60 seconds ago logs a skip notice and exits cleanly. A lock older than 30 seconds (by mtime) is treated as stale and removed. Marker removed: Stale processedMarkers entries age out via the 500-entry oldest-lastSeen prune.


Contextual Gates

Disclosure: "Starting file watch on [paths]. Triggers [skill] on change. Stop with Ctrl+C." Reversibility: amber — runs sentinel that triggers other skills on file change; triggered skills may modify files; stop with Ctrl+C and run /watch stop Trust gates:

  • Any: start watch and view scan reports
  • Familiar (5+ sessions): triggered skills run autonomously on file change; novices should use with caution and review dispatched actions

Quality Gates

  • Scan completes in under 10 seconds for repos up to 100K lines
  • No duplicate intake items for the same file and classification
  • No re-dispatched already-processed markers
  • Batch limit of 5 dispatches per scan enforced
  • State file updated atomically at end of scan
  • Works on Windows, macOS, Linux (Node.js fs + git CLI)
  • CronCreate failure does not leave watch in inconsistent state

Exit Protocol

  • /watch start: Output confirmation block. No HANDOFF.
  • /watch stop: Output stop summary with lifetime stats.
  • /watch scan (manual): Output scan report with counts.
  • /watch scan (cron): Silent.
  • /watch status: Output current state.
  • On error: Clear message with fix. Never leave cron running if state is inconsistent.

© SethGammon, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/watch of SethGammon/Citadel.

  • SKILL.md
  • __benchmarks__/marker-dedup-two-scans.md

Open the folder on GitHubat commit e41ff1d

Compare with similar skills

Watch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Watch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Watch this skillSethGammon/Citadel922—~2.9kAutomated safety check: PassMIT
Dbt Databricks PR Readydatabricks/dbt-databricks380—~2.8kAutomated safety check: PassApache-2.0
Monitor With HaolemeHaolemeApp/Haoleme157—~1.3kAutomated safety check: PassAGPL-3.0
Veomni ReviewByteDance-Seed/VeOmni2.2k—~1.7kAutomated safety check: PassApache-2.0
Crawl4AI Web Scrapingsmallnest/goclaw5981 repos~2.5kAutomated safety check: PassMIT
Glue 09 10 Migrationaws-samples/aws-glue-samples1.5k—~2.4kAutomated safety check: PassMIT-0

Similar skills

  • Dbt Databricks PR Ready

    databricks/dbt-databricks

    Official

    A skill your agent uses for an open dbt-databricks pull request, including your own PR or a fork PR, to assess merge readiness and optionally repair selected gaps on the PR head branch.

    380 GitHub stars~2.8k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Monitor With Haoleme

    HaolemeApp/Haoleme

    Selectively monitor important long-running or resource-intensive commands with Haoleme by prefixing them with hao, so status, output, and completion notifications sync to the mobile app.

    157 GitHub stars~1.3k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Veomni Review

    ByteDance-Seed/VeOmni

    Pre-PR code review gate. An agent skill from ByteDance-Seed/VeOmni.

    2.2k GitHub stars~1.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Crawl4AI Web Scraping

    smallnest/goclaw

    Scrapes sites, handles JavaScript-heavy pages and extracts structured data with Crawl4AI, through its crwl CLI or Python SDK, including schema-based extraction without an LLM.

    598 GitHub starsUsed in 1 repo~2.5k tokens
    Data & AnalyticsAuto-check passed
  • Glue 09 10 Migration

    aws-samples/aws-glue-samples

    Official

    Upgrade an AWS Glue ETL job from Glue version 0.9 or 1.0 to Glue 4.0.

    1.5k GitHub stars~2.4k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Official

    Migrate a legacy AWS Glue development endpoint to a Glue interactive session, following the official AWS migration checklist.

    1.5k GitHub stars~3.6k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed

More from SethGammon/Citadel

All 48 skills in this repo
  • Create Skill

    SethGammon/Citadel

    Creates new skills from the user's repeating patterns. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.9k tokensUpdated 6 days ago
    Auto-check passed
  • Houseclean

    SethGammon/Citadel

    Cross-drive storage audit and cleanup. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.2k tokensUpdated 6 days ago
    Auto-check passed
  • Loop

    SethGammon/Citadel

    Bounded foreground repetition for the current session. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.4k tokensUpdated 6 days ago
    Auto-check passed
  • Triage

    SethGammon/Citadel

    GitHub issue and PR investigator. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.7k tokensUpdated 6 days ago
    Auto-check passed
  • Archon

    SethGammon/Citadel

    Autonomous multi-session campaign agent. An agent skill from SethGammon/Citadel.

    922 GitHub stars~5.4k tokensUpdated 6 days ago
    Auto-check passed
  • Fleet

    SethGammon/Citadel

    Parallel campaign orchestrator. An agent skill from SethGammon/Citadel.

    922 GitHub stars~6.3k tokensUpdated 6 days ago
    Auto-check passed

Works with

Questions about Watch

What does Watch do?

File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Watch is an agent skill from SethGammon/Citadel. File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills.

When should I use Watch?

Watch fits situations like: appropriate skills; automatic reactions to file changes; do NOT use for one-off inspection; tasks needing human judgment per file.

How do I install Watch in Claude Code?

Run `npx skills add SethGammon/Citadel --skill watch -a claude-code`. Or copy the skill folder (skills/watch in SethGammon/Citadel) into .claude/skills/watch in your project. Claude Code loads it when a task matches its description.

How do I install Watch in Codex?

Run `npx skills add SethGammon/Citadel --skill watch -a codex`. Or copy the skill folder (skills/watch in SethGammon/Citadel) into .agents/skills/watch in your project. Codex loads it when a task matches its description.

Can I use Watch in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SethGammon/Citadel --skill watch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/watch, .gemini/skills/watch, .github/skills/watch and .opencode/skills/watch in your project.

What does Watch need to run?

Going by SKILL.md and its folder, Watch needs the command-line tools its instructions call (git and npm). Our summary lists: Node.js.

Does Watch access the network?

SKILL.md contains no URLs. Its commands use git and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Watch safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Watch use?

Watch is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Watch use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Watch?

Skills that share tags, products or a category with Watch: Dbt Databricks PR Ready (databricks/dbt-databricks, 380 stars), Monitor With Haoleme (HaolemeApp/Haoleme, 157 stars), Veomni Review (ByteDance-Seed/VeOmni, 2.2k stars) and Crawl4AI Web Scraping (smallnest/goclaw, 598 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Watch?

SethGammon (a GitHub user) maintains it in SethGammon/Citadel, which has 922 GitHub stars. The repository holds 48 skills in this directory. The repository was last updated on October 1, 2026.

Source: SethGammon/Citadel on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.