pr-cleanup

pr-cleanup is an agent for Claude Code from skyfox675/agents-skills. It costs 82 tokens per session (415 once invoked), scanned A, original, MIT.

A watcher that tidies up after an agent’s pull request is closed, whether it was merged or abandoned.

In plain words
What is it for?
Use it to remove spent local branches and worktrees, close linked issues after merges, and release locks while leaving abandoned issues open.
Why use it?
It prevents leftover branches, worktrees, issue assignments, and claim locks from cluttering the project or blocking future work.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Good fit Use it to remove spent local branches and worktrees, close linked issues after merges, and release locks while leaving abandoned issues open.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/skyfox675/agents-skills/pr-cleanup
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.

Clone the repo
git clone --depth 1 https://github.com/skyfox675/agents-skills

Made for: Claude Code.

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 pr-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/agents/skyfox675/agents-skills/pr-cleanup.svg)](https://agentmods.dev/agents/skyfox675/agents-skills/pr-cleanup)
Your own site
<a href="https://agentmods.dev/agents/skyfox675/agents-skills/pr-cleanup"><img src="https://agentmods.dev/badge/agents/skyfox675/agents-skills/pr-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 82 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 415 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.00082 $0.00415
Opus 5 $0.00041 $0.00208
Sonnet 5 $0.00016 $0.00083
Haiku 4.5 $0.00008 $0.00042

Measured 7d ago against content hash 4bd538cf7da2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

pr-cleanup 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 7d 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.

.claude/agents/pr-cleanup.md · 17 lines

What it actually says

You are pr-cleanup — one lane: tidy up after PRs close.

Follow the pr-cleanup skill (and the issue-locking skill — gh-issue-locking / jira-issue-locking — for the close-on-merge + lock-release protocol).

  • Closed PRs only (author OR assignee = your login); never act on open PRs, never force a merge, never clean another operator's work.
  • MERGED → close the linked issue (Closes #N / transition Jira to done), remove the claim marker, clear assignee, post a brief closing note. Mandatory: integration-branch merges do not auto-close issues.
  • Closed-unmerged (abandoned) → release the lock (remove marker + clear assignee, note the PR closed unmerged) but leave the issue open — it stays re-dispatchable.
  • Local cleanup: delete the closed branch, git worktree remove the spent worktree, prune. Before deleting, confirm it belongs to a closed PR and not in-flight work — when unsure, skip and report.
  • End: caveman per-tick report (closed N (merged M / abandoned A), issues closed #x, locks released #y, branches/worktrees removed K); gh/git/tracker commands and lock markers byte-exact, the closing comment in normal prose via humanizer.
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. 7d ago First seen · 17 lines · 82 tokens per session scan A 4bd538cf7da2

Subscribe to this mod's changes

pr-cleanup is an agent published in the GitHub repository skyfox675/agents-skills (10 stars, last pushed 6d ago), licensed MIT. It adds 82 tokens to every session and 415 once invoked, about $0.0004 per session on Opus 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-08-31.