tidy

A repository-cleanup workflow that checks whether documentation matches the actual project and removes tracked clutter using Git, the version-control system that records recoverable changes.

In plain words
What is it for?
Use it to fix false documentation, identify dead or generated files, untrack files while keeping them locally, and prepare one reviewable cleanup commit.
Why use it?
It helps correct outdated project claims and reduce cruft while keeping removals reviewable and recoverable. It does not perform code refactoring or rewrite history.

Command

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.

agentmods
npx agentmods add commands/zevtos/agentpipe/tidy
Clone the repo
git clone --depth 1 https://github.com/zevtos/agentpipe
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,451 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00049 $0.01451
Opus 5 $0.00024 $0.00726
Sonnet 5 $0.00010 $0.00290
Haiku 4.5 $0.00005 $0.00145

Measured 2d ago against content hash 919da2d7a039, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tidy 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 2d 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.

commands/tidy.md · 87 lines

How it starts

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

You are orchestrating a repository tidy-up: making the repo's own claims true again and removing cruft that should not be tracked. The whole point is that git is the safety net — every change lands in one reviewable commit, every removal is recoverable, and nothing irreversible happens without the user's word. This is hygiene, not refactoring: code smells and duplication go to /refactor, and history surgery (purging secrets or large blobs from past commits) is out of scope — only ever flagged, never performed.

Context

@CLAUDE.md

Focus Area

$ARGUMENTS

Auto-context

  • Tracked changes (must be empty to start): !git status --porcelain --untracked-files=no
  • Everything present (untracked + ignored): !git status --porcelain --untracked-files=all
  • Repo root: !git rev-parse --show-toplevel 2>/dev/null || echo "NOT A GIT REPO"

Safety contract

Tidy classifies every change by reversibility and acts on its own only at the recoverable end:

Change Recoverable via Tidy policy
Fix a false claim in a tracked file (count, dead internal link, renamed/removed reference) the commit apply
Untrack a generated file, keep it on disk (git rm --cached) + add the .gitignore rule the commit apply
Remove tracked junk from disk (git rm) git history apply
Remove untracked junk a labelled git stash stash, never git clean
Purge a large blob / secret from history (git-filter-repo, BFG) — (rewrites history) detect & hand off only

Hard rules:

  • Clean tracked tree is a prerequisite so the whole run is one revertible commit. If the tree is dirty, stop and ask the user to commit or stash first.
  • Never git clean -f. Untracked files were never in history; deleting them is irreversible. Move them aside with a labelled git stash and report the name so the user can restore or drop it.
  • .gitignore only affects untracked files — an already-committed artifact must be git rm --cached-ed in the same commit, or the rule is a no-op.
  • Secrets are not a cleanup task. If a committed secret is found, STOP: tell the user to rotate/revoke it first (it survives in clones, forks, cached views, and PRs even after a rewrite), then hand off to git-filter-repo. Never rewrite history.
  • Fix only what is provably false. Ambiguous cases (intentional external links, templated/example references, judgment calls) go to NEEDS REVIEW, not auto-fix.

Read the full file on GitHub · 87 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. 2d ago First seen · 87 lines · 49 tokens per session scan A 919da2d7a039

Subscribe to this mod's changes

tidy is a command published in the GitHub repository zevtos/agentpipe (11 stars, last pushed 2mo ago), licensed MIT. It adds 49 tokens to every session and 1,451 once invoked, about $0.0002 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-30.