gh-stack

gh-stack is a skill for Claude Code from sd0xdev/sd0x-harness. It costs 175 tokens per session (16,888 once invoked), scanned A, original, MIT.

A workflow for GitHub stacked pull requests, where several dependent changes are submitted as a chain of pull requests. It uses the GitHub gh-stack extension and asks for approval before each allowed operation.

In plain words
What is it for?
Use it to link, push, or submit a branch stack on GitHub with automatic submission of the chain.
Why use it?
It avoids manually creating and maintaining pull requests whose branches depend on one another. It also limits which stack commands can run and makes the approval requirement explicit.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; positional $N argument.

Part of the sd0x-dev-flow plugin — 101 skills, 16 agents, 5 hooks shipped together

Good fit Use it to link, push, or submit a branch stack on GitHub with automatic submission of the chain.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sd0xdev/sd0x-harness/gh-stack
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.

Any agent
npx skills add sd0xdev/sd0x-harness --skill gh-stack
Clone the repo
git clone --depth 1 https://github.com/sd0xdev/sd0x-harness

Made for: Claude Code.

Or install sd0x-dev-flow, the plugin that ships this one along with the rest of its 101 skills, 16 agents, 5 hooks.

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 gh-stack

README.md
[![agentmods](https://agentmods.dev/badge/skills/sd0xdev/sd0x-harness/gh-stack/github.svg)](https://agentmods.dev/skills/sd0xdev/sd0x-harness/gh-stack)
Your own site
<a href="https://agentmods.dev/skills/sd0xdev/sd0x-harness/gh-stack"><img src="https://agentmods.dev/badge/skills/sd0xdev/sd0x-harness/gh-stack/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gh-stack

Your own site · 80×15
<a href="https://agentmods.dev/skills/sd0xdev/sd0x-harness/gh-stack"><img src="https://agentmods.dev/badge/skills/sd0xdev/sd0x-harness/gh-stack.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 175 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 16,888 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00175 $0.16888
Opus 5.5 $0.00070 $0.06755
Sonnet 5.5 $0.00035 $0.03378
Haiku 4.5 $0.00017 $0.01689

Measured 19d ago against content hash d8a81ca05330, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gh-stack scanned grade A with 0 findings 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 19d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/gh-stack/SKILL.md · 723 lines

How it starts

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

GH Stack — Native Stacked PRs

Read first: @skills/push-ci/references/authorization-contract.md before any gh stack operation that pushes — § Push safety for the credential and the unshared attestation, § Efficacy Boundary for what the per-use approval authorizes. If that Read fails, stop and report it; run no pushing operation.

Wraps the github/gh-stack extension so a branch chain becomes a real Stack on GitHub — one PR per layer, chained bases, per-layer diff view, linked merges — instead of the hand-built chained-base PR set /create-pr --stack produces on its own.

Authorization

⚠️ This skill is one of the four workflows Anchor Register #4 enumerates (@rules/discretion.md).
⚠️ It may execute exactly three subcommands of the extension — `gh stack link`, `gh stack push`,
   `gh stack submit --auto` — and nothing else from it, `gh stack view` included: `view` syncs PR
   metadata and writes it back into `.git/gh-stack`, so it is not a read. What this skill needs to
   read, it reads without the extension (the first row of the table below).
⚠️ All three push, and they do not push the same way. Read from the extension's source at v0.1.1
   (§ Force form): `link` runs a plain `git push --atomic`; `push` and `submit --auto` run a
   per-branch, value-bearing `git push --force-with-lease=refs/heads/<b>:<sha>`. The approval
   names the form the chosen subcommand uses.
⚠️ Every `gh stack` invocation REQUIRES explicit per-use user approval via AskUserQuestion
   — no flag, no earlier approval and no delegating skill substitutes for it.
⚠️ Every other subcommand is printed for the user to run, never executed.
Operation Executor Authorization
gh --version, gh auth status (exit status only), gh extension list, gh pr list --json, gh pr view --json, gh api 'repos/{owner}/{repo}/stacks?pull_request=<n>' (GET), git rev-parse, git merge-base, and the extension's tracking file <git-dir>/gh-stack read with the Read tool this skill read-only
gh extension install github/gh-stack this skill Phase 1 AskUserQuestion — never installed silently
gh stack link, gh stack push, gh stack submit --auto this skill Phase 3 per-use AskUserQuestion naming the push form and the branches
gh stack view, gh stack rebase, gh stack sync, gh stack modify, gh stack merge, gh stack unstack, gh stack init, gh stack add, gh stack checkout user only — printed, never run outside the grant
gh pr edit for an attribution remediation this skill /create-pr § 7b contract (CLAUDE.md rule 3, Anchor)
git push by any other route /push-ci its own workflow

Read the full file on GitHub · 723 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. 19d ago Changed · +3 lines d8a81ca05330
  2. 20d ago Changed · +28 lines 432a3e17e02d
  3. 22d ago First seen · 692 lines · 175 tokens per session scan A 5074374c8727

Subscribe to this mod's changes

gh-stack is a skill published in the GitHub repository sd0xdev/sd0x-harness (193 stars, last pushed 8d ago), licensed MIT. It adds 175 tokens to every session and 16,888 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-24.

Related

Other skills, from other repositories