ap-git-hygiene

ap-git-hygiene is a skill for Claude Code, Codex from agentproto/ts. It costs 85 tokens per session (1,249 once invoked), scanned A, original, Apache-2.0.

Look at, clean up and hand off git work through the agentproto daemon: branchgc (plan, verdicts, restore), worktreestatus/worktreegc, maintainrun and propen. Trigger when asked to find stale or merged branches and worktrees, delete them safely, undo a branch cleanup, run repo maintenance, or open a pull request for a…

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install with agentmods
npx agentmods add skills/agentproto/ts/ap-git-hygiene
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 agentproto/ts --skill ap-git-hygiene
Clone the repo
git clone --depth 1 https://github.com/agentproto/ts

Made for: Claude Code, Codex.

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 ap-git-hygiene

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentproto/ts/ap-git-hygiene/github.svg)](https://agentmods.dev/skills/agentproto/ts/ap-git-hygiene)
Your own site
<a href="https://agentmods.dev/skills/agentproto/ts/ap-git-hygiene"><img src="https://agentmods.dev/badge/skills/agentproto/ts/ap-git-hygiene/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 ap-git-hygiene

Your own site · 80×15
<a href="https://agentmods.dev/skills/agentproto/ts/ap-git-hygiene"><img src="https://agentmods.dev/badge/skills/agentproto/ts/ap-git-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,249 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 unknown 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.00085 $0.01249
Opus 5.5 $0.00034 $0.00500
Sonnet 5.5 $0.00017 $0.00250
Haiku 4.5 $0.00009 $0.00125

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

Security

Grade A, and why

ap-git-hygiene 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 today.

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.

packages/skill-pack-agentproto/src/skills/ap-git-hygiene/SKILL.md · 103 lines

How it starts

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

ap-git-hygiene

MCP profile

branch_gc*, worktree_gc, worktree_gc_status and maintain_run are on the daemon's admin and full profiles. worktree_status and pr_open are also on core. In a session narrowed to a profile that lacks a tool it is not in tools/list, so a call fails before reaching the daemon.

Deleting is the last step, never the first. Every cleanup tool here defaults to a dry run that changes nothing; only apply: true deletes, and the daemon re-checks each ref or worktree right before touching it.

Tools

Task: look before you delete

  1. worktree_status for the picture: which worktrees have an open PR, are dirty or have a live session.
  2. worktree_gc and branch_gc as dry runs, with wait: false for a big repo. Poll worktree_gc_status / branch_gc_status about every 30 seconds.
  3. Read the plan by class. reclaim is proven safe, hold is never touched, review (branches) and salvage (worktrees) need a decision.
  4. Delete only when the task asked for it: branch_gc with apply: true and explicit scopes; worktree_gc with apply: true and the dry run's plan as expectedPlan. Do not widen the scope to "clean everything".
  5. Keep the restoreLog path the branch apply returns.

Task: decide a branch the plan could not

  1. branch_gc_review_worktree with action: "add" gives a detached checkout of the tip, so nothing touches the live working tree. Read the diff there.
  2. branch_gc_verdict records what you found for that exact tip sha. gate.agree: true with evidence says deleting loses nothing. A verdict deletes nothing by itself.
  3. branch_gc_review_worktree with action: "remove" cleans up.
  4. A tip below the line-coverage guard is deleted only with a human's approval: ask the operator to run agentproto branch gc approve <sha> --by <name>. An agent session cannot record it.

Read the full file on GitHub · 103 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. today First seen · 103 lines · 85 tokens per session scan A e93a7f502783

Subscribe to this mod's changes

ap-git-hygiene is a skill published in the GitHub repository agentproto/ts (11 stars, last pushed today), licensed Apache-2.0. It adds 85 tokens to every session and 1,249 once invoked, about $0.0003 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-12-02.

Related

ap-git-hygiene compared with skills from other repositories

ap-git-hygiene next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ap-git-hygieneagentproto/tsSkill11todayApache-2.0A85Claude Code, Codex
otto-pr-review-loopomnigent-ai/omnigentSkill12ktodayApache-2.0A17Claude Code, Codex
resolve-drive-promnigent-ai/omnigentSkill12ktodayApache-2.0A21Claude Code, Codex
feature-publishomnigent-ai/omnigentSkill12ktodayApache-2.0A24Claude Code, Codex
otto-review-remediationomnigent-ai/omnigentSkill12ktodayApache-2.0A16Claude Code, Codex
otto-drive-promnigent-ai/omnigentSkill12ktodayApache-2.0A14Claude Code, Codex
describe-prhumanlayer/humanlayerSkill13k9d agoApache-2.0A15Claude Code, Codex