tidy-diff

tidy-diff is a skill for Claude Code from melodic-software/claude-code-plugins. It costs 91 tokens per session (1,854 once invoked), scanned A, original, MIT.

A cleanup step for the lines changed in one working-tree change. It simplifies code, removes proven-unused comments, and applies writing cleanup to Markdown without changing behavior.

In plain words
What is it for?
Use it before committing to tidy changed code and documentation, including in detached or unattended work.
Why use it?
It makes a change easier to review while touching only the named lines and without needing a branch, commit, or base reference.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the code-tidying plugin — 7 skills, 1 agent shipped together

Good fit Use it before committing to tidy changed code and documentation, including in detached or unattended work.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add melodic-software/claude-code-plugins
Claude Code
/plugin install code-tidying

Made for: Claude Code.

Or install code-tidying, the plugin that ships this one along with the rest of its 7 skills, 1 agent.

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 tidy-diff

README.md
[![agentmods](https://agentmods.dev/badge/skills/melodic-software/claude-code-plugins/tidy-diff/github.svg)](https://agentmods.dev/skills/melodic-software/claude-code-plugins/tidy-diff)
Your own site
<a href="https://agentmods.dev/skills/melodic-software/claude-code-plugins/tidy-diff"><img src="https://agentmods.dev/badge/skills/melodic-software/claude-code-plugins/tidy-diff/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 tidy-diff

Your own site · 80×15
<a href="https://agentmods.dev/skills/melodic-software/claude-code-plugins/tidy-diff"><img src="https://agentmods.dev/badge/skills/melodic-software/claude-code-plugins/tidy-diff.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,854 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.00091 $0.01854
Opus 5.5 $0.00036 $0.00742
Sonnet 5.5 $0.00018 $0.00371
Haiku 4.5 $0.00009 $0.00185

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

Security

Grade A, and why

tidy-diff 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 yesterday.

The scan reads SKILL.md. This mod also ships 3 executable files (evals/fixtures/orders.ts, evals/fixtures/report.py, scripts/change-shape.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.

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.

plugins/code-tidying/skills/tidy-diff/SKILL.md · 125 lines

How it starts

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

Variables

Arguments: $ARGUMENTS

HARD path exclusions: ${user_config.hard_exclusions} (unexpanded, empty, or any value outside enforce and advisory means enforce).

Purpose

A change reaches review tidier when its author tidies it before the one commit that carries it, so the review judges final code and no tidy push restarts it. This skill is that step for a change that exists only in the working tree: it edits the change's own lines and nothing else, keeps behavior unchanged, and reports what it did and what it left.

The caller names the scope. This skill never derives it from a branch, a base ref, HEAD or the index, which is why it runs the same on a detached head, in a lane that runs no git command, and in a session that has not committed yet.

Input

<lines-file> holds one row per changed hunk, <start><TAB><count><TAB><path>, the shape ${CLAUDE_PLUGIN_ROOT}/scripts/added-lines.sh prints: <path> repository-relative, <start> the first changed line in the current file and <count> how many follow. A new file is one row from line 1. A row with <count> 0 (a pure deletion) names no line to tidy and is skipped.

Drop, and name in the report with the reason, every row whose path is absolute, has a .. segment, is a symbolic link, is not a regular file, or matches the GLOBAL HARD list in tidy's exclusions (path entries lift only under advisory). No row left: report "nothing to tidy" and stop.

No <lines-file>: report that the caller writes one with ${CLAUDE_PLUGIN_ROOT}/scripts/added-lines.sh <base>, and stop. This skill derives no scope itself.

--turns <n>: the turns this run may spend. Without it there is no budget.

Passes

Run them in this order, each only over the rows left. A code file is any listed file that is not markdown (.md, .mdx); a markdown file goes to passes 4 and 5 only, so a change that is all markdown runs only the markdown passes.

  1. Simplify the code lines. Read each listed hunk with enough of its file to see what it calls and what calls it. Apply reuse (an existing helper in place of new code), simplification (a needless branch, variable, wrapper or conversion removed) and efficiency (repeated work in a loop hoisted, a needless second read dropped) cleanups inside the listed lines. Every edit preserves behavior: a cleanup that would change an output, an error, an order or a public signature is a proposal, never an edit. This pass does not call the bundled simplify skill; it works on the line list itself. Pointer for the targets simplify takes: the /simplify row in All commands. Recheck trigger: that row lets simplify take a line list. The record for that surface is bundled-simplify.md.
  2. Delete zero-information comments in the code lines. Classify each comment that sits in a listed line per triage.md, skipping the exempt surfaces in safety.md. Apply class A only, the safe mode of /code-tidying:remove-comments, proving each deletion before the real file changes: write the file with the comment deleted to the scratch directory the session's instructions name (else the system temp directory), keeping its extension, then run ${CLAUDE_SKILL_DIR}/scripts/change-shape.sh <file> <scratch copy>. Only on exit 0 (COMMENT-ONLY) make the same deletion in the real file; any other exit leaves the real file untouched and the comment becomes a proposal quoting the verdict. Class B and class C are proposals. No rename, no move, no rewrite.
  3. Strip generated-code residue from the code lines. Sweep each listed hunk for the residue kinds in generated-code-residue.md, in its order, and act on each finding as its In tidy-diff column says: an edit pass 1 allows is applied under pass 1's rule, and every other fix is a proposal naming the residue kind and the fix, including each choice of a loud failure over a quiet wrong answer. Comments are pass 2's alone: pass 2 already triaged every comment in the listed lines, and this pass edits none.
  4. Apply the docs-hygiene writing rules to the markdown lines. For markdown an agent loads (a SKILL.md, an agent, a rule, CLAUDE.md, AGENTS.md, a reference file a skill reads) invoke /docs-hygiene:write-for-agents <file> (if enabled); for other markdown invoke /docs-hygiene:write-for-humans <file> (if enabled). Apply what it asks only to the listed lines: cut restatement, filler and hedging, and keep every fact, link and constraint.
  5. Fix AI prose patterns in the markdown lines. Invoke /ai-slop:audit fix <file> (if enabled) per markdown file. Keep its fixes inside the listed lines and undo any outside them.

Read the full file on GitHub · 125 lines

Files

What ships with it

5 files 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. yesterday Changed · -50 tokens per session df2daf9c37f2
  2. 3d ago Changed · +1 tokens per session 41eb6cb82e70
  3. 5d ago Changed 30554eea16ad
  4. 17d ago Changed · -1 lines 3f9edeeb9479
  5. 18d ago Changed · +2 lines 0e4ca37446bc
  6. 23d ago Changed · -1 lines 9d98d6f40b7a
  7. 26d ago Changed e942edd0098c
  8. 29d ago Changed · +11 lines · +6 tokens per session 5c99f85c80ee
  9. 1mo ago First seen · 114 lines · 134 tokens per session scan A b0cc0658b19b

Subscribe to this mod's changes

tidy-diff is a skill published in the GitHub repository melodic-software/claude-code-plugins (33 stars, last pushed today), licensed MIT. It adds 91 tokens to every session and 1,854 once invoked, about $0.0004 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-10-29.

Related

tidy-diff compared with skills from other repositories

tidy-diff next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tidy-diffmelodic-software/claude-code-pluginsSkill33todayMITA91Claude Code
refactor-decompose-functionjimmc414/claude-code-plugin-marketplaceSkill4yesterdayMITA28Claude Code
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14kyesterdayCC0-1.0A113Claude Code, Codex