Tierward: Skill for Claude Code

.claude/skills/repo-hygiene/SKILL.md

repo-hygiene is a skill for Claude Code from marcoguillermaz/Tierward. It costs 168 tokens per session (2,790 once invoked), scanned C, original, MIT.

A periodic, read-only sweep for leftover branches, worktrees, session files, initiative files, and selected documentation.

In plain words
What is it for?
Use it for quick cleanup checks or broader scans of orphaned Git items, stale review snapshots, and unreferenced documentation candidates, with confirmation required before removal.
Why use it?
It helps find repository clutter and stale records without deleting anything automatically.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; mentions CLAUDE.md.

This is marcoguillermaz/Tierward's own configuration. It tells Claude Code how to work on Tierward itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Tierward configures →

Part of the tierward plugin — 29 skills, 1 command, 1 hook, 1 MCP server shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to marcoguillermaz/Tierward. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/marcoguillermaz/Tierward/main/.claude/skills/repo-hygiene/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/marcoguillermaz/Tierward

Made for: Claude Code.

Or install tierward, the plugin that ships this one along with the rest of its 29 skills, 1 command, 1 hook, 1 MCP server.

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 repo-hygiene

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/marcoguillermaz/tierward/repo-hygiene"><img src="https://agentmods.dev/badge/skills/marcoguillermaz/tierward/repo-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 168 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,790 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00168 $0.02790
Opus 5 $0.00084 $0.01395
Sonnet 5 $0.00034 $0.00558
Haiku 4.5 $0.00017 $0.00279

Measured 12d ago against content hash 15095ce97ffc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade C, and why

repo-hygiene scanned grade C with 1 finding 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 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (references/scan-branches-worktrees.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

Bash(rm -rf .claude/worktrees/*),
.claude/skills/repo-hygiene/SKILL.md · 106 lines

How it starts

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

Tierward repo variant - diverges deliberately from the scaffolded payload copy (packages/cli/templates/tier-{m,l}/...): adds the unregistered-worktree-dir scan, Step 2b (initiatives staleness), and the docs/reviews/ staleness pass. Do not sync this file back over the payload copies.

Runs in the main conversation, deliberately without context: fork. AskUserQuestion is unavailable to subagents/forked skill contexts, and this skill's confirm-then-execute design requires it mid-run. Do not add context: fork to this file.

Goal: search thoroughly, report every candidate with concrete evidence, execute only what the user explicitly confirms. Never guess-execute. Never touch docs/*.md regardless of confirmation.

Step 0 - Parse scope

$ARGUMENTS: default = quick scan (Steps 1, 2, 2b). target:full adds Step 3 (doc orphans + reviews staleness) - the slow, judgment-heavy pass. target:reviews runs ONLY the Step 3 reviews-staleness pass (skips the tracked-doc orphan sweep). State which mode is active before starting.

Always exclude .claude/worktrees/** from every Grep/Glob in Steps 2 and 3. Worktrees are full repo checkouts - without this exclusion every file inside every active worktree gets reported as a duplicate "root-level" finding.

Step 1 - Branch & worktree scan (mechanical, always runs)

Run the companion script:

bash .claude/skills/repo-hygiene/references/scan-branches-worktrees.sh

It is read-only and prints three sections:

  • SAFE_BRANCH_DELETE - bare branch names with no attached worktree, merged into every protected branch that exists on origin (see PROTECTED_BRANCHES at the top of the script), no open PR.
  • SAFE_WORKTREE_REMOVE - <branch>|<path> pairs, merged into all protected branches, clean working tree, no open PR. Lines prefixed KEEP| are explicitly excluded with a reason (uncommitted changes / not yet merged / open PR / gh check failed) - do not re-litigate these, the script already checked.
  • PRUNABLE_WORKTREE - paths registered in git worktree list whose actual directory no longer exists.
  • ORPHAN_WORKTREE_DIR - directories on disk under .claude/worktrees/ that are NOT registered in git worktree list (leftovers of a failed/manual removal + prune), with a content summary (files:N|newest:date). Git cannot report dirtiness for an unregistered dir, so these NEVER join the low-risk batch: each one gets its own separate confirmation in Step 5, after the content summary is shown, and is removed with rm -rf only on that explicit per-item confirm.

Read the full file on GitHub · 106 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 106 lines · 168 tokens per session scan C 15095ce97ffc

Subscribe to this mod's changes

repo-hygiene is a skill published in the GitHub repository marcoguillermaz/Tierward (4 stars, last pushed 5d ago), licensed MIT. It adds 168 tokens to every session and 2,790 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories