Skip to main content
statuslinesSource-backedReview first Safety Privacy

PR Closing Keywords Statusline

Claude Code statusline that checks the active pull request body for GitHub closing keywords and shows whether issue auto-closure linkage is present.

by MkDev11·added 2026-06-04·
Claude Code
HarnessClaude Code
Language:bash
Review first review before installing

Open the source and read safety notes before installing.

Safety notes

  • Closing keywords are workflow signals, not proof that the PR actually satisfies the linked issue.
  • Some repositories use manual issue closure or external trackers, so missing keywords should be interpreted with project policy.
  • Keep automated PR body edits separate from this read-only statusline.

Privacy notes

  • The script prints only aggregate closing-reference counts and the pull request number.
  • It reads the pull request body, which can contain private planning details in private repositories.
  • Private repository access follows the local GitHub CLI account and organization policy.

Prerequisites

  • GitHub CLI installed and logged in for the current repository.
  • jq available for reading pull request JSON.
  • The current branch has an associated pull request with a body that can be read by the local account.

Schema details

Install type
config
Troubleshooting
No
Runtime and command metadata
Script language
bash
Script body
#!/usr/bin/env bash
set -u

main() {
if ! command -v gh >/dev/null 2>&1; then
  echo "linkage: gh missing"
  exit 0
fi
if ! command -v jq >/dev/null 2>&1; then
  echo "linkage: jq missing"
  exit 0
fi

pr_json=$(gh pr view --json number,body 2>/dev/null || true)
if [ -z "$pr_json" ]; then
  echo "linkage: no active PR"
  exit 0
fi

number=$(printf '%s' "$pr_json" | jq -r '.number // empty')
body=$(printf '%s' "$pr_json" | jq -r '.body // ""')
closing_refs=$(printf '%s\n' "$body" | grep -Eio '\b(close[sd]?|fix(e[sd])?|resolve[sd]?)[: ]+#([0-9]+)' | wc -l | tr -d ' ')

if [ "$closing_refs" -gt 0 ]; then
  state="linked"
else
  state="missing close"
fi

printf 'linkage: PR #%s | closing refs %s | %s\n' "$number" "$closing_refs" "$state"
}

case $- in
  *n*) ;;
  *) main "$@" ;;
esac
Full copyable content
{
  "statusLine": {
    "type": "command",
    "command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/pr-closing-keywords-statusline.sh"
  }
}

About this resource

Source notes

  • GitHub documents closing keywords that link pull requests to issues and close the linked issues when the pull request merges.
  • This entry checks for those documented keywords in the active pull request body rather than relying on GitHub CLI metadata docs.

Duplicate check

Checked existing statuslines, live HeyClaude statuslines, open pull requests, and repository content for pr-closing-keywords-statusline, PR issue linkage, closing keywords, GitHub pull request linkage, and gh-pr-issue-linkage-statusline. The earlier cli.github.com submission was self-closed after #960 showed that source domain overlaps the accepted repository-health statusline; this replacement uses GitHub's issue-linking documentation and a closing-keyword-focused scope.

Disclosure

Editorial statusline recipe. No paid placement or affiliate link is used.

#github#pull-requests#issues#claude-code

Source citations

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.