/ci-watch:ci-watchfrom ci-watch
Land a change by pushing straight to the default branch and keep working, while a background hook waits on the CI it triggered and wakes the session when it ends — a one-line FYI on green, a resolved report when something is wrong. Use when the user says "push to main", "don't wait for the checks", "watch CI in the background", "interrupt me only if it fails", "no PR, just push", or when a `ci-watch GREEN` / `RED` / `NO_RUNS` / `STILL_RUNNING` / `WATCH_FAILED` reminder arrives and has to be acted on. Also use to watch a commit by hand: "is CI green for <sha>", "watch the checks on main". Covers the pre-push leak gates, what each wake-up means, and how to fix forward.
Ships in ci-watch. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The plugin's PostToolUse hook runs after every Bash command that pushes. It waits on
every GitHub Actions run the pushed commit triggered — or, for a gitlab.com remote,
every GitLab pipeline, through glab. Other GitLab hosts stay quiet (unwatched). All green → it wakes the
session with ONE ci-watch GREEN line, an FYI with nothing to act on. Anything else → it
wakes the session with a summary and a path to the full JSON report. Every outcome writes
a report, so a green push and a lost watch never look the same.
Use the landing command: "${CLAUDE_PLUGIN_ROOT}/scripts/ci-land", run from the checkout
(-C <dir> elsewhere, --dry-run for the plan, --help for the rest). In one process it
refuses a dirty tree, fetches and rebases, runs the repo's own .ci-land/check if there is
one, runs the leak gates, then pushes the sha those gates scanned to <default>. The gates
are gitleaks plus the client-literal list, and nothing skips them. It uses SSH when workflow
files changed. This hook watches a ci-land run like any push.
ci-land worktree <name> creates .claude/worktrees/<name> off
origin/<default> and prints the path for EnterWorktree.The same steps by hand, where the command can't run:
gitleaks git --log-opts="origin/<branch>..HEAD" --redact --no-banner, plus any
project-specific literal check.git fetch && git rebase origin/<branch>.git push origin HEAD:<branch>. Do not wait on CI;
go on with the next task. Never force-push the default branch. A red build gets a
fix-forward commit.ci-watch GREEN wake-up needs no action: don't poll,
don't re-check, just carry on. Mention it only where a landing is being reported anyway.The hook fires only for pushes the agent runs. A push the user types (! git push)
or makes outside the session is unwatched. Watch it by hand (below).
It arrives as a system reminder that Claude Code labels a "Stop hook blocking error"
from PostToolUse:Bash. That is just how an asyncRewake exit 2 is shown, so it isn't a
broken hook. The text starts ci-watch <STATUS>: <owner/repo>@<sha12> "<subject>".
| Status | Meaning | Do |
|---|---|---|
GREEN | Every run passed, and at least one succeeded | Nothing. Carry on |
RED | A run ended failure, cancelled, timed_out or similar; on GitLab failed, canceled, or manual (blocked on a manual job that may not fail) | Read the report; fix forward; push again. manual needs a human to play the job |
NO_RUNS | Nothing ran on the commit within the appear window, or every run was skipped | The repo has no push trigger for this branch, or every workflow was path-filtered or if:-gated out. Tell the user. This is not a pass |
STILL_RUNNING | A run was still going at the 45-min ceiling | Watch it by hand with the same sha; don't assume either outcome |
WATCH_FAILED | The push landed, but a GitHub or GitLab lookup failed (network, rate limit, expired login) | Watch it by hand once gh / glab works again |
The report has everything the next step needs, so don't look anything up:
##[error], cut to that step's time window;gh run view … --log-failed and gh run rerun … --failed commands (on GitLab,
glab ci trace <job> and glab ci retry <job>).On GitLab a pipeline is the "run" and its jobs have no steps, so step is null and the
excerpt is cut around the trace's ERROR: lines. A job with allow_failure: true is never
reported.
Diagnose from the excerpt and the changed files first. Reach for the full log only if the excerpt doesn't explain it. A rerun is right only for a flake; a real failure needs a fix.
failures[] by error signature first. One cause that turns several jobs red
(e.g. gate failing because build did) is ONE cause.gh run rerun … --failed, with no agent at all. NO_RUNS and STILL_RUNNING never fan out.superpowers:dispatching-parallel-agents. Run one
background, read-only diagnoser per cause, and give each the report path and its job
id(s). Use a fresh subagent by default. Use a fork only when the fix depends on intent
the commit message doesn't carry.This is orchestrator-workers
(https://www.anthropic.com/engineering/building-effective-agents). Subagent results return
to the spawner (https://code.claude.com/docs/en/sub-agents). The PR-lane alternative,
anthropics/claude-code-action's examples/ci-failure-auto-fix.yml, does not apply here:
it is gated on pull_requests[0], and a direct push has no PR.
node "<plugin>/scripts/ci-watch.js" --sha <sha> [--repo owner/name | gitlab.com/<path>] [--cwd <checkout>]
Without --repo, the checkout's origin URL picks the forge. Run it with run_in_background. Exit codes: 0 green (prints the one GREEN line on stdout), 1 red, 3 no runs,
4 still running, 64 usage or lookup error. The report lands in $CLAUDE_PLUGIN_DATA, or
<tmp>/ci-watch outside a hook.
gh run list --commit needs all 40 characters. The
script always reads the full sha from the API; pass a short one only through --sha,
which expands it.--sha by hand counts every run on the commit.workflow_run chain that starts only when its parent
ENDS. The script requires the run set (ids and statuses) to stay unchanged for the settle
period after everything has completed.concurrency group is keyed on the ref. Key it on github.sha for push events, or
every superseded push reports RED (cancelled).git push origin feat main watches nothing.
Push one branch per command.asyncRewake is measured to 25 min (a 2026-11-07 spike woke an idle session after
1500 s). The worst case here is about 52 min under the 60-min hook timeout. No cap is
documented, but that range is unmeasured.gh run view --log-failed drops step attribution. It labels lines UNKNOWN STEP.
That is why the excerpt comes from the raw job log (gh api …/jobs/<id>/logs).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kattakath/skills --plugin ci-watch