No slash command · from github-actions-plugin
Blocks on `gh run watch` to follow a GitHub Actions workflow run until completion without polling. Use after pushing or triggering a workflow to wait for CI results.
Ships in github-actions-plugin. 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.
| Use this skill when... | Use the alternative when... |
|---|---|
Watching a workflow run until it completes via blocking gh run watch | Use git-plugin:gh-cli-agentic for one-shot JSON queries of run/PR check state |
| Waiting for CI after a push, or triggering a workflow and following progress | Use git-plugin:git-fix-pr to diagnose AND auto-correct failing checks on a PR |
Chaining on a run's outcome with gh run watch --exit-status | Use github-actions-plugin:github-actions-inspection to read a finished run's logs and stack traces |
| Finding the latest in-progress run for a workflow | Use git-plugin:gh-cli-agentic to list completed runs by status filter |
Watch and monitor GitHub Actions workflow runs using gh run watch - a blocking command that follows runs until completion without needing timeouts or polling.
# Watch most recent run (interactive selection if multiple)
gh run watch
# Watch specific run ID
gh run watch $RUN_ID
# Compact mode - show only relevant/failed steps (recommended for agents)
gh run watch $RUN_ID --compact
# Exit with non-zero if run fails (useful for chaining)
gh run watch $RUN_ID --exit-status
# Combined: compact output, fail on error
gh run watch $RUN_ID --compact --exit-status
Key Flags:
| Flag | Description |
|---|---|
--compact | Show only relevant/failed steps (less output) |
--exit-status | Exit non-zero if run fails |
-i, --interval | Refresh interval in seconds (default: 3) |
# List in-progress runs
gh run list --status in_progress --json databaseId,name,status,createdAt
# List runs for specific workflow
gh run list -w "CI" --json databaseId,name,status,conclusion -L 5
# List runs for current branch
gh run list --branch $(git branch --show-current) --json databaseId,name,status
# List runs triggered by specific event
gh run list --event push --json databaseId,name,status -L 10
# List failed runs
gh run list --status failure --json databaseId,name,conclusion,createdAt -L 5
Status Values: queued, in_progress, completed, waiting, pending, requested
Conclusion Values (when completed): success, failure, cancelled, skipped, neutral, timed_out
# Get run status with jobs
gh run view $RUN_ID --json status,conclusion,jobs,name,createdAt
# View with step details
gh run view $RUN_ID --verbose
# Get failed logs only (most useful for debugging)
gh run view $RUN_ID --log-failed
# Get full logs
gh run view $RUN_ID --log
# View specific job
gh run view --job $JOB_ID
# Open in browser
gh run view $RUN_ID --web
--loggh run view --log is tab-delimited: every line is
<job>\t<step>\t<timestamp> <log line>. To scrape one step's stdout back to
its bare form — dropping the job and step columns and the per-line
timestamp — filter to the step name (field-2 substring) and strip the
timestamp, which is the first space-delimited token of field 3:
# All lines from the step whose name contains "clean warm run", de-columned
gh run view $RUN_ID --log \
| awk -F'\t' '/clean warm run/ { sub(/^[^ ]* /, "", $3); print $3 }'
This is the durable way to read a succeeded step's output for structured
markers — RESULT …, a PASS/FAIL line, a JSON blob a job printed — when
--log-failed doesn't apply (nothing failed; you just want the output). The
whole job's log is one stream, so narrow to the step first, then grep the
markers:
gh run view $RUN_ID --log \
| awk -F'\t' '/bench \(clean warm/ { sub(/^[^ ]* /, "", $3); print $3 }' \
| grep -E 'RESULT|SANITY'
Notes: match the step name as it appears in the workflow's name: (the awk
/pattern/ is a plain regex over the whole tab-joined line — anchor with a
distinctive substring to avoid matching the same text inside a log line);
[^ ]* matches the timestamp because it never contains a space, so a
mangled first token can't over-strip the line.
# Trigger workflow and immediately watch it
gh workflow run "CI" && sleep 2 && gh run watch --compact --exit-status
# Trigger with inputs
gh workflow run "Deploy" -f environment=staging -f version=1.2.3
# Get the latest run for a PR's head commit
RUN_ID=$(gh run list --branch $(gh pr view $PR --json headRefName --jq '.headRefName') -L 1 --json databaseId --jq '.[0].databaseId')
gh run watch $RUN_ID --compact --exit-status
# List all in-progress runs and watch the first one
gh run list --status in_progress --json databaseId,name --jq '.[0]'
# Get all active run IDs
gh run list --status in_progress --json databaseId --jq '.[].databaseId'
# 1. Find the run
RUN_ID=$(gh run list -L 1 --json databaseId --jq '.[0].databaseId')
# 2. Watch it (blocking - waits until complete)
gh run watch $RUN_ID --compact --exit-status
# 1. Find failed run
gh run list --status failure -L 1 --json databaseId,name,conclusion
# 2. Get failed logs
gh run view $RUN_ID --log-failed
# After pushing, find and watch the triggered run
git push origin HEAD
sleep 5 # Wait for GitHub to register the run
RUN_ID=$(gh run list --branch $(git branch --show-current) -L 1 --json databaseId --jq '.[0].databaseId')
gh run watch $RUN_ID --compact --exit-status
Right after a push or gh workflow run, the run may not be listed yet, so the
id lookup sometimes needs a retry loop. Check the command's exit status
separately from an empty result, bound the iterations, and stop on the first
API error:
for i in $(seq 1 20); do
id=$(gh run list --workflow "$WF" --branch "$BRANCH" -L 1 --json databaseId --jq '.[0].databaseId // empty') || { echo "gh run list failed; stopping" >&2; exit 1; }
[ -n "$id" ] && break
sleep 15
done
[ -n "$id" ] || { echo "no run listed after 20 tries" >&2; exit 1; }
gh run watch "$id" --compact --exit-status
until id=$(gh run list ...) && [ -n "$id" ]; do sleep 15; done treats a
failed call the same as "not listed yet". On HTTP 403: API rate limit exceeded it keeps polling, and each failed call still counts against the
quota. Once the id is known, gh run watch does the waiting. gh api rate_limit --jq .resources.core shows what is left.
Evidence (2026-11-10): an
untilloop of that shape polled throughHTTP 403: API rate limit exceededfor about 25 minutes and used up the account's 5,000/hour core REST limit.
Two watches return at once with a result about the wrong run. Both read as a
confident "done" over nothing (agent-patterns-plugin:tool-result-traps), so
wait for the new state to register before watching.
After a push, gh pr checks <n> --watch exits 1 with "no checks reported
on the '' branch" until the new head's checks register. Wait until
the PR's head is the pushed SHA and at least one check is listed:
sha=$(git rev-parse HEAD) # the commit just pushed
deadline=$(( $(date +%s) + 300 ))
until [ "$(gh pr view "$PR" --json headRefOid --jq .headRefOid)" = "$sha" ] \
&& [ "$(gh pr checks "$PR" --json name --jq length 2>/dev/null || echo 0)" -gt 0 ]; do
[ "$(date +%s)" -lt "$deadline" ] || { echo "checks for $sha not registered after 5 min" >&2; exit 1; }
sleep 10
done
gh pr checks "$PR" --watch
After gh run rerun <id>, gh run watch <id> returns the previous
attempt's conclusion while the run still shows completed. Record
run_attempt before the rerun and wait until it increments or the status
leaves completed:
before=$(gh api "repos/{owner}/{repo}/actions/runs/$RUN_ID" --jq .run_attempt)
gh run rerun "$RUN_ID"
deadline=$(( $(date +%s) + 300 ))
until state=$(gh api "repos/{owner}/{repo}/actions/runs/$RUN_ID" --jq '"\(.run_attempt) \(.status)"') \
&& { [ "${state% *}" -gt "$before" ] || [ "${state#* }" != completed ]; }; do
[ "$(date +%s)" -lt "$deadline" ] || { echo "rerun of $RUN_ID not queued after 5 min" >&2; exit 1; }
sleep 10
done
gh run watch "$RUN_ID" --compact --exit-status
A failed gh api call ends that until condition as false and the loop
retries until the deadline. Jobs for one attempt:
gh api "repos/{owner}/{repo}/actions/runs/$RUN_ID/attempts/<n>/jobs".
| Context | Command |
|---|---|
| Watch until done | gh run watch $ID --compact --exit-status |
| Find in-progress | gh run list --status in_progress --json databaseId,name |
| Latest run ID | gh run list -L 1 --json databaseId --jq '.[0].databaseId' |
| Failed logs | gh run view $ID --log-failed |
| Scrape a succeeded step's stdout | gh run view $ID --log | awk -F'\t' '/STEP/{sub(/^[^ ]* /,"",$3);print $3}' |
| Trigger + watch | gh workflow run "$NAME" && sleep 2 && gh run watch --compact |
| PR run status | gh pr checks $PR --json name,state,conclusion |
gh run watch Over Polling| Approach | Problem |
|---|---|
sleep + poll | Wastes time, may miss completion, timeout complexity |
| Webhook | Requires infrastructure, not CLI-friendly |
gh run watch | Blocks until complete, shows progress, returns exit code |
Benefits of gh run watch:
--compact reduces output to relevant steps only&& for conditional next steps# Watch with error handling
gh run watch $RUN_ID --compact --exit-status && echo "Success" || echo "Failed"
# Check if run exists before watching
gh run view $RUN_ID --json status 2>/dev/null && gh run watch $RUN_ID --compact
Use in command frontmatter:
- In-progress runs: !`gh run list --status in_progress --json databaseId,name --jq '.[0]'`
- Latest run: !`gh run list -L 1 --json databaseId,name,status,conclusion`
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
11 skills in this plugin
/actions-billing-usageMeasure GitHub Actions cost with the billing-usage API — per repo, month and SKU; net vs gross; per-job rounding; budgets and their hard stop. Use when optimizing CI cost or speed, before removing a workflow as expensive, or when jobs fail with zero steps because a budget ran out./ai-review-max-turnsTriage a red Claude-powered CI review check. Use when an AI review job fails or flakes: tell a real unpublished finding from turn-budget or ceiling overruns and infra reruns via subtype + is_error./claude-code-github-workflowsClaude Code GitHub Actions workflow patterns — PR reviews, issue triage, CI/CD integration. Use when creating or modifying workflows that integrate Claude Code./github-actions-auth-securityGitHub Actions auth and security for Claude Code — OIDC, AWS Bedrock, Vertex AI, secrets, permission scoping. Use when setting up workflow authentication or security./github-actions-inspectionFailing step, stack trace, and test output from a completed GitHub Actions run; rerun failed jobs. Use when a CI check finished red and you need the error extracted from its log./github-actions-mcp-configMCP server config for GitHub Actions — tool permissions, env vars, multi-server setups. Use when configuring MCP servers in GitHub Actions workflows.npx claudepluginhub laurigates/claude-plugins --plugin github-actions-pluginOther plugins' skills for the same job