/code-tidying:tidy-diff <lines-file> [--turns <n>]from code-tidying
Tidies a change's file-and-line list before commit: simplifies code, removes comment deletions and generated-code residue, and applies docs-hygiene/ai-slop cleanup on markdown. Runs on detached HEAD or unattended lanes without a base ref.
Ships in code-tidying. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Arguments: $ARGUMENTS
HARD path exclusions: ${user_config.hard_exclusions} (unexpanded, empty, or any value outside
enforce and advisory means enforce).
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.
<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.
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.
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, "Decision records".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.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./ai-slop:audit fix <file> (if enabled) per
markdown file. Keep its fixes inside the listed lines and undo any outside them.A pass whose skill does not resolve in this session, or that the session's permissions refuse, is skipped and named with the reason; the next pass still runs.
With --turns <n>, count every tool call as a turn. Before starting a pass, compare the turns
spent with n: at or past it, run no further pass and name each one left as skipped for the
budget. Finish the edit in hand and its proof before stopping, so no file is left half-edited. Tidy
never fails its caller: running out of budget is a reported outcome, not an error.
Print, in order: the rows taken and the rows dropped with reasons; per pass, each edit applied by
file:line (with the COMMENT-ONLY verdict for a comment deletion) and each proposal with its
reason; each pass skipped and why; the turns spent against the budget. A pass with nothing to do
says "none". The caller re-runs its checks after this report, since a tidy edit can trip a linter.
/source-control:commit
It commits the tidied change as one commit with the change it tidies.
change-shape.sh exits 3 when the parser for a language is absent: no deletion there carries a
proof, so every comment in that file is a proposal.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub melodic-software/claude-code-plugins --plugin code-tidying7 skills in this plugin
/audit-comment-residueAudit comment residueRead-only classifier: flags residue in code comments (history narration, plan or session references, conversational asides, ticket/PR back-references, origin notes, workarounds with no link or removal condition). No edits. Use when: 'audit code comments' or report chat/ticket comments on commit/review. Not for edits: /code-tidying:remove-comments./audit-dead-codeportability-ok: R6 kept-adapter operation - dead-code-scan.sh grep analyzerRead-only hunt for dead and unused code via 4 analyzers (Knip TS/JS, vulture Python, gopls Go, grep shell/C#/other), adjudicated dead, uncertain, or alive. Use when: 'find dead code', 'remove unused code', unused exports, functions, orphaned files, or if anything calls a symbol. Find-and-delete starts here; deleting is /code-tidying:tidy./batch-simplifyBatch simplifyWhen bundled simplify resolves in this session, prefer it when asked to clean up one file or path; this skill for batch sweeps. Runs simplification over a time window, branch, directory, or repository, grouped by ecosystem in dependency order. Use when: 'batch simplify', 'simplify recent changes', or catch up after a multi-session sprint.Other plugins' skills for the same job