gh-squash-merge-closes-only-one-issue

Diagnoses and fixes GitHub squash-merge auto-close leaving referenced issues open.

3|Updated May 8, 2026
One-click install
npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill gh-squash-merge-closes-only-one-issue-wan-huiyan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gh-squash-merge-closes-only-one-issue
Source: https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/gh-squash-merge-closes-only-one-issue
Command: npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill gh-squash-merge-closes-only-one-issue-wan-huiyan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a PR title or body lists multiple issues as "Closes #447, #448, #449", GitHub's auto-close parser binds the keyword to only the first issue. After a squash-merge, the remaining issues stay open even though the fix shipped, causing confusion and stale issue trackers. ## Core Features & Use Cases - Prevention (Path A): Format PR bodies with one closing keyword per issue ("Closes #447. Closes #448.") so GitHub closes every referenced issue on merge. - Recovery (Path B): Post-merge shell loops using gh issue close $N --comment to close leftover issues with a traceable reference to the merged PR. - Batch cleanup: A tuple-based loop pattern for closing many leftover issues across multiple merged PRs in seconds. - Use Case: You merged four PRs covering nine audit issues, then gh issue list --state open shows six still open. Run the recovery loop to close them all with comments linking back to their PRs. ## Quick Start Check which issues referenced in my merged PR are still open and close the leftovers with a comment referencing the PR number.

Frequently Asked Questions about gh-squash-merge-closes-only-one-issue

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why did GitHub only close one issue when my PR said Closes #1, #2, #3?▼

GitHub's auto-close parser binds one keyword to one issue. "Closes #1, #2, #3" is interpreted as closing #1 plus plain references to #2 and #3. Write one keyword per issue, like "Closes #1. Closes #2. Closes #3.", to close them all.

How do I close issues left open after a squash-merge?▼

Run gh issue close for each leftover issue with a comment referencing the merged PR, for example: gh issue close 448 --comment "Closed by PR #457". A shell loop over the issue numbers closes them all in seconds.

Does the auto-close keyword work in the PR title as well as the body?▼

Yes, GitHub parses both the PR title and body for closing keywords, but the one-keyword-one-issue rule applies to both. Adding properly formatted Closes lines anywhere in the body is enough even if the title uses a comma list.

Which keywords trigger GitHub issue auto-close on merge?▼

GitHub recognizes close, closes, closed, fix, fixes, fixed, resolve, resolves, and resolved in any case. Each keyword binds only to the immediately following issue reference, so repeat the keyword for every issue you want closed.

How can I check before merging whether all issues will auto-close?▼

Open the PR on github.com and check the Development or Linked issues section in the sidebar. If only one issue is listed there, the parser matched only one, so fix the PR body formatting before merging.