watch-patterns

watch-patterns is a skill for Claude Code, Codex from komluk/scaffolding. It costs 76 tokens per session (2,374 once invoked), scanned A, original, MIT.

Guidance for watching tasks that take time to finish, such as a build, deployment, file transfer, cleanup job, or log stream. It explains how to check progress and recognise both completion and failure.

In plain words
What is it for?
Use it when writing polling loops, waiting for a remote task, or using a monitor or background process to observe ongoing work.
Why use it?
It helps avoid loops that run forever, miss failures, or mistake a lack of messages for progress.

Skill for Claude CodeCodex

Part of the scaffolding plugin — 35 skills, 9 commands, 13 agents shipped together

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 skills/komluk/scaffolding/watch-patterns
Any agent
npx skills add komluk/scaffolding --skill watch-patterns
Clone the repo
git clone --depth 1 https://github.com/komluk/scaffolding

Made for: Claude Code, Codex.

Or install scaffolding, the plugin that ships this one along with the rest of its 35 skills, 9 commands, 13 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/komluk/scaffolding/watch-patterns.svg)](https://agentmods.dev/skills/komluk/scaffolding/watch-patterns)
Your own site
<a href="https://agentmods.dev/skills/komluk/scaffolding/watch-patterns"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/watch-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,374 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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 $0.00076 $0.02374
Opus 5 $0.00038 $0.01187
Sonnet 5 $0.00015 $0.00475
Haiku 4.5 $0.00008 $0.00237

Measured 4d ago against content hash a4fcb4e82b28, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

watch-patterns scanned grade A with 1 finding 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 4d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| Transient errors | A remote probe MAY fail transiently: `OUT=$(curl -fsS "$URL" 2>&1) || OUT="PROBE_FAILED: $OUT"` — capture and classify; a blind `\|\| true` on every command converts persistent outage into silence. C
skills/watch-patterns/SKILL.md · 186 lines

How it starts

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

Watch Patterns Skill

Purpose

How to observe long-running operations correctly. Anyone can run a loop — the value is a watcher that never lies: it terminates, it detects failure as reliably as success, and its silence is never mistaken for progress.

Key architectural fact: a subagent cannot hold a long-lived observation. Notifications from an armed Monitor land in the conversation that armed it; a subagent finishes and dies. Observation is therefore always armed by the main loop — this skill is loadable anywhere for exactly that reason.

Auto-Invoke Triggers

  • Watching a CI run, deployment, file transfer, GC/prune job, or log stream
  • Writing any poll/until loop over a remote or local state
  • Using the Monitor tool or Bash(run_in_background) for observation

Decision Tree — Choose the Mechanism FIRST

The single most common failure is picking the wrong mechanism. Decide BEFORE writing any script:

Situation Mechanism
"Is it done now?" — answerable immediately One-shot check. Single command, no loop, no monitor.
ONE notification when a condition becomes true (deploy finished, download complete, GC done) Bash(run_in_background) + until loop with a terminal condition and a bounded iteration count. NOT Monitor.
REPEATING events, each occurrence matters (every error line, every restart) Monitor tool with a filter covering ALL terminal states.
CI run status (Gitea Actions) MCP polling: mcp__gitea__actions_run_read polled until status is terminal. Structured status beats scraping logs.
Metric/log condition (error rate, service down) MCP: mcp__grafana__query_prometheus / query_loki_logs. One query returns aggregated truth; a bash loop re-derives it badly.
You only need the outcome eventually, no urgency Do nothing now. Check once when the result is actually needed.

Anti-pattern (observed failure)

Unbounded tail -f / while true piped into Monitor when only ONE notification was needed → the tool stays armed until timeout, and every intermediate line risks a spurious notification. Single notification = Bash(run_in_background) + until; Monitor is for recurring events only.

Read the full file on GitHub · 186 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. 4d ago First seen · 186 lines · 76 tokens per session scan A a4fcb4e82b28

Subscribe to this mod's changes

watch-patterns is a skill published in the GitHub repository komluk/scaffolding (15 stars, last pushed 29d ago), licensed MIT. It adds 76 tokens to every session and 2,374 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

platform-operations

Unified platform operations guidance for CI/CD pipeline design, deployment strategies, observability, SLI/SLOs, and incident-ready rollouts. Use when building release workflows, production monitoring, or reliability controls.

rsmdt/the-startup · 45 tokens

vibe-ship

Generates a complete, production-ready deployment setup for any app in one pass -- Dockerfile, docker-compose.yml, .dockerignore, CI/CD (GitHub Actions), scalability config (health checks, resource limits, K8s on request), and security hardening (non-root user, secrets, dependency scanning). Auto-detects the stack…

sudais-khalid/vibe-ship · 214 tokens

web-ci-spec

Produce a sprint CI.md covering pipeline stages, secrets handling, deployment strategy, and rollback for GitHub Actions / Cloud Build / GitLab CI / etc. Coordinator-only — produces drafts, never modifies live workflows. Pauses for user confirmation.

howar31/magi-workflow · 52 tokens

deploy-planner

Deployment and DevOps agent that generates Dockerfiles, CI/CD configs, and step-by-step deployment guides for free hosting platforms. Triggers on: deploy, launch, hosting, Docker, CI/CD, production, go live, ship it.

batterfried-philosophy172/Agent-Startup-Skills · 52 tokens

dockerized-service-release-deployment-workflow

Create a Dockerized-service release contract with clean GitHub Actions builds, main-anchored tags, immutable digest manifests, published-release deployments, production approval, health checks, and exact-digest rollback.

gaelic-ghost/socket · 49 tokens

ci-workflow

Design and maintain .NET CI workflows for F#, C#, and mixed solutions with SDK setup, restore, build, test, format checks, package checks, caching, and matrix decisions.

gaelic-ghost/socket · 41 tokens