
Gh PR checks exit code folds a by design red wait on the row
Stops agents misreading a by-design red CI check as a failed pull request
Gh PR checks exit code folds a by design red wait on the row is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 5
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Gh PR checks exit code folds a by design red wait on the row
This skill covers a quirk of the GitHub CLI: gh pr checks reports one exit status for the whole pull request, so a check a repository keeps red on purpose, such as a required aggregation context on drafts, makes the command exit 1 even when every job that ran passed. The skill explains how to tell exit code 8 (pending) from a real failure and how to write a wait loop that polls the row for a specific check and sets its own exit status.
The workflow it gives the agent is a set of steps: read the exit code table from gh pr checks help, poll the per-check TSV rows or the JSON output (name, state, bucket) for the check that matters, keep an explicit list of contexts that are red by design, and confirm a red from the job log before reporting it as a failure. It also includes a verification step to run the waiter against a healthy draft and check it exits 0.
It expects the GitHub CLI (gh) to be installed and authenticated, plus a shell with awk and sed. The examples were measured on gh 2.97.0.
When your agent uses it
`gh pr checks` returns ONE exit status for the whole pull request, so a check your repo keeps red ON PURPOSE — a required aggregation context that is red while a PR is a draft, a placeholder context, a job the workflow allows to fail — makes the command exit non-zero on a pull request where everything that actually ran passed. Use when: (1) you are writing a background wait loop or watchdog that polls a PR and decides from `$?`; (2) a background poll came back "failed with exit code 1" and you are about to diagnose a red that may not exist; (3) you are about to report a PR as failing, or hold a queue on it, on the strength of an exit status; (4) your repo deliberately reds a context on drafts so a draft cannot merge on a green no suite produced. The exit code cannot tell a by-design red from a real one, and a non-zero exit from a backgrounded poll is surfaced by the harness exactly like a failing job. Poll the ROW for the check you care about and exit 0 yourself; `8` means pending, not failure; and confirm a
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (7 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the agent-traffic-control plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add wan-huiyan/agent-traffic-control
/plugin install agent-traffic-control@wan-huiyan-agent-traffic-controlOr copy only this skill to ~/.claude/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row &&
cp -R "$tmp/plugins/agent-traffic-control/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row" ~/.claude/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row inside it instead.
Copy the skill folder to ~/.agents/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row &&
cp -R "$tmp/plugins/agent-traffic-control/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row" ~/.agents/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row inside it instead.
Copy the skill folder to ~/.cursor/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row &&
cp -R "$tmp/plugins/agent-traffic-control/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row" ~/.cursor/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/wan-huiyan/agent-traffic-control.git --path plugins/agent-traffic-control/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-rowOr copy the folder to ~/.gemini/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row &&
cp -R "$tmp/plugins/agent-traffic-control/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row" ~/.copilot/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row inside it instead.
Get the folder:
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.gitThen copy agent-traffic-control/plugins/agent-traffic-control/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row into your agent's skills folder as gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row. Agents that support SKILL.md read one folder per skill.
What it does
- Exit code interpretation
- Explains what gh pr checks exit codes 0, 1 and 8 mean and why pending differs from failure.
- Row-based polling
- Shows a shell loop that reads the state of one named check instead of the whole pull request.
- By-design red registry
- Advises keeping a list of intentionally red contexts so only unexpected reds count as failures.
- Log confirmation step
- Describes checking a job's log with gh run view before treating a red as expected or real.
- Waiter verification
- Lists a test to confirm a background waiter exits 0 on a healthy draft pull request.
Good for
- Wait for a specific CI check on a draft pull request before continuing work
- Write a background watchdog that polls a PR without misreading a deliberate red
- Check whether a failed background poll reflects a real CI failure
- Queue a pull request for landing only after its required check passes
Gh PR checks exit code folds a by design red wait on the row FAQ
When does Gh PR checks exit code folds a by design red wait on the row trigger?
It applies when writing a wait loop or watchdog that polls a pull request, when a background poll reports failed with exit code 1, when about to report a PR as failing based on an exit status, or when a repo deliberately reds a context on drafts.
What does gh pr checks exit code 8 mean?
According to the skill, exit code 8 means checks are still pending, not failed.
Does the skill change the repository's CI configuration?
No. It advises against making a by-design red context green and instead recommends fixing how the waiter reads the status.
Which tools are needed?
The skill uses the GitHub CLI (gh) along with shell tools such as awk and sed, and was measured on gh 2.97.0.
How do I install Gh PR checks exit code folds a by design red wait on the row in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row to use it in all your projects, or to .claude/skills/gh-pr-checks-exit-code-folds-a-by-design-red-wait-on-the-row in one project. Or install the agent-traffic-control plugin, which includes it: /plugin marketplace add wan-huiyan/agent-traffic-control, then /plugin install agent-traffic-control@wan-huiyan-agent-traffic-control.
Does Gh PR checks exit code folds a by design red wait on the row run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Gh PR checks exit code folds a by design red wait on the row?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Gh PR checks exit code folds a by design red wait on the row?
The closest alternatives to Gh PR checks exit code folds a by design red wait on the row are Gh, Iterate PR, Fix ci, Gh fix ci and Fix PR.
Where this comes from
- Description: from the skill's own SKILL.md.
More from wan-huiyan/agent-traffic-control

Teaches agents to refuse a flawed instruction only with measured evidence attached
- Open source
- 5 GitHub stars
- Developer tools

Catches silent deletions when a subagent edits large files with repeated blocks
- Open source
- 5 GitHub stars
- Developer tools

Holds a pull request from merging by stopping its agent, disarming auto-merge, then
- Open source
- 5 GitHub stars
- Developer tools

Checks that a batch of pull requests does not cite file paths that will never exist
- Open source
- 5 GitHub stars
- Developer tools

Checks whether a pull request truly landed by comparing file content, not commit subjects
- Open source
- 5 GitHub stars
- Developer tools

Checks a branch for stale-base changes that would silently undo newer main work
- Open source
- 5 GitHub stars
- Developer tools





