watch-ci

watch-ci is a command for Claude Code from damusix/atomic-claude. It costs 69 tokens per session (1,448 once invoked), scanned A, original, MIT.

A command that watches the automated checks for a Git branch or selected build run. CI, short for continuous integration, is the service that automatically builds and tests code after changes.

In plain words
What is it for?
Use it after pushing code to monitor checks from services such as GitHub Actions, GitLab CI, or CircleCI. You can watch the current branch, a run or pull-request number, another branch, or a named workflow.
Why use it?
It removes the need to repeatedly check whether a build or test run has finished. It can work out which CI service the project uses and report when the run reaches a final result.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions subagents; names the AskUserQuestion tool.

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/damusix/atomic-claude/watch-ci
Clone the repo
git clone --depth 1 https://github.com/damusix/atomic-claude

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/damusix/atomic-claude/watch-ci.svg)](https://agentmods.dev/commands/damusix/atomic-claude/watch-ci)
Your own site
<a href="https://agentmods.dev/commands/damusix/atomic-claude/watch-ci"><img src="https://agentmods.dev/badge/commands/damusix/atomic-claude/watch-ci.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 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,448 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.1 $0.00069 $0.01448
Opus 5 $0.00034 $0.00724
Sonnet 5 $0.00014 $0.00290
Haiku 4.5 $0.00007 $0.00145

Measured 6d ago against content hash 228e864ffd13, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

watch-ci 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 6d 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.

Jenkinsfile → Jenkins (curl against $JENKINS_URL)
context/commands/watch-ci.md · 139 lines

How it starts

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

Step 1 — Pre-flight

git rev-parse --is-inside-work-tree

If not inside a git repo, stop:

not a git repo. /watch-ci needs a versioned project with a CI provider.

Check signals are available — the subagent uses them to identify the CI provider:

test -f docs/wiki/index.md

If missing, warn (don't stop):

note: no docs/wiki/index.md found. subagent will fall back to file-tree heuristics
(.github/, .gitlab-ci.yml, .circleci/, Jenkinsfile, etc.).
suggest running /refresh-wiki after to improve future runs.

Step 2 — Capture context for the brief

git rev-parse --abbrev-ref HEAD     # current branch
git rev-parse HEAD                  # current SHA
git remote -v | head -1             # remote URL — provider hint
pwd                                  # absolute repo path

$ARGUMENTS may narrow the target. Pass it through verbatim — the subagent classifies it using provider-appropriate semantics:

  • empty → current branch's latest run(s)
  • integer → run / pipeline ID
  • #N or N → PR / MR number
  • branch name → that branch's runs
  • workflow / pipeline filename (.yml, .yaml) → that specific workflow

Don't classify in the foreground. Different providers use different shapes (GitHub run IDs, GitLab pipeline IDs, CircleCI workflow UUIDs), so the subagent decides.

Step 3 — Dispatch background subagent

Invoke the Agent tool with:

  • subagent_type: "general-purpose" — generic runner backed by Haiku via per-call model override.

  • model: haiku

  • run_in_background: true

  • description: "Watch CI for <branch-or-target>"

  • prompt: a self-contained brief containing:

    Watch CI for this repo and report when it reaches a terminal state.
    
    Repo: <absolute pwd>
    Branch: <current branch>
    HEAD SHA: <current SHA>
    Remote: <remote URL>
    Target hint ($ARGUMENTS): "<verbatim args, or 'current branch' if empty>"
    
    Step 1 — identify the CI provider:
      a. Read docs/wiki/index.md if it exists. The inferrer's schema
         includes a CI/CD section that names the provider and points at config files.
         Use it as the primary source of truth.
      b. If signals are absent or silent on CI, fall back to file-tree detection:
         .github/workflows/*.yml      → GitHub Actions    (use `gh`)
         .gitlab-ci.yml               → GitLab CI         (use `glab`)
         .circleci/config.yml         → CircleCI          (use `circleci`)
         Jenkinsfile                  → Jenkins           (curl against $JENKINS_URL)
         .buildkite/pipeline.yml      → Buildkite         (use `bk`)
         bitbucket-pipelines.yml      → Bitbucket Pipelines (curl REST API)
         azure-pipelines.yml          → Azure Pipelines   (use `az pipelines`)
      c. If no provider is identifiable, bail: print `no CI provider detected.` and stop.
    
    Step 2 — verify the CLI is available:
      `command -v <cli>` and (where applicable) auth check (e.g. `gh auth status`).
      If missing or unauthed: print `detected <provider>, but <cli> not installed/authed.
      install: <command>` and stop. Don't try to fall back to a different tool.
    
    Step 3 — resolve the target using $ARGUMENTS-equivalent semantics for the provider:
      - empty / "current branch" → runs/pipelines on <branch> @ <SHA>
      - integer → specific run/pipeline ID
      - `#N` / `N` → PR/MR number; resolve to head SHA, then watch runs on that SHA
      - branch name → runs on that branch
      - `.yml`/`.yaml` → specific workflow/pipeline file on <branch>
      Print one line: `watching <provider>: <resolved target>`.
    
    Step 4 — poll until terminal state:
      Cadence 30-60s. Use streaming watch where the provider supports it
      (`gh run watch <id> --exit-status`, `glab ci view --live <id>`, etc).
      Cap total wait at 10 minutes. If still running, report current state and stop.
      READ-ONLY. Do not rerun, cancel, or modify anything.
    
    Step 5 — report concisely:
      - Per workflow/pipeline: outcome (success/failure/cancelled/timed-out).
      - On failure: failing step/job name + 1-3 line error excerpt from logs.
      - Note any side effects (e.g. release-please opened a PR, deployment URL).
      - One paragraph total. The user is in another conversation; respect their context.
    

Read the full file on GitHub · 139 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. 6d ago First seen · 139 lines · 69 tokens per session scan A 228e864ffd13

Subscribe to this mod's changes

watch-ci is a command published in the GitHub repository damusix/atomic-claude (84 stars, last pushed yesterday), licensed MIT. It adds 69 tokens to every session and 1,448 once invoked, about $0.0003 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.