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.
/plugin marketplace add melodic-software/claude-code-plugins/plugin install code-metricsWrote 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.
[](https://agentmods.dev/skills/melodic-software/claude-code-plugins/audit-duplication)<a href="https://agentmods.dev/skills/melodic-software/claude-code-plugins/audit-duplication"><img src="https://agentmods.dev/badge/skills/melodic-software/claude-code-plugins/audit-duplication/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.
<a href="https://agentmods.dev/skills/melodic-software/claude-code-plugins/audit-duplication"><img src="https://agentmods.dev/badge/skills/melodic-software/claude-code-plugins/audit-duplication.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00103 | $0.03219 |
| Opus 5.5 | $0.00041 | $0.01288 |
| Sonnet 5.5 | $0.00021 | $0.00644 |
| Haiku 4.5 | $0.00010 | $0.00322 |
Grade A, and why
audit-duplication 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pre-computed context
Current branch: !git branch --show-current 2>/dev/null || echo "unknown"
Purpose
Duplication is the measure most likely to report noise, because some replication is deliberate: a repository that vendors one helper into seventeen plugins on purpose has seventeen copies and zero debt. This skill reports the clone groups a detector found, then subtracts the groups the target repository has already declared about itself, and stops there: no pass or fail, no severity, no finding. What to do about a surviving clone is the reader's call.
Collectors, tried in ladder order per lane:
| Collector | Lanes | Values per clone group | When |
|---|---|---|---|
jscpd |
every lane | lines, tokens |
jscpd resolves on PATH or in ./node_modules/.bin |
dupl |
Go only | lines, tokens null |
jscpd did not resolve and dupl did |
cpd (PMD) |
TypeScript/JavaScript, Python, Go, C# | lines, tokens |
jscpd did not resolve and pmd did (never for Bash: CPD has no shell language) |
No collector resolves means the lane's row says so with the tool's install hint and the run
continues. This plugin never installs, downloads, or npx-fetches a detector.
Run it
"${CLAUDE_SKILL_DIR}/scripts/audit-duplication.sh" # the change: diff from the merge-base plus uncommitted files
"${CLAUDE_SKILL_DIR}/scripts/audit-duplication.sh" src/ lib/ # explicit paths (a missing one is a usage error)
"${CLAUDE_SKILL_DIR}/scripts/audit-duplication.sh" --all # every tracked or untracked-but-not-ignored file
"${CLAUDE_SKILL_DIR}/scripts/audit-duplication.sh" --registry scripts/cross-plugin-source-registry.txt --all
"${CLAUDE_SKILL_DIR}/scripts/audit-duplication.sh" --json --all src/ # the code-metrics/v2 document instead of markdown
"${CLAUDE_SKILL_DIR}/scripts/audit-duplication.sh" --json --keep --all # the document, also kept as the next run's trend baseline
Present the markdown report as printed. It opens with the scope and a "Coverage of this run"
table (lane, collector, status, reason), then one row per clone group, largest first, listing
every instance as file:start-end, then a rollup per lane and per directory, then the summary
lines: files with clones, the duplicated-line total, how many groups a registry excluded, and
which lanes were partial. Files with clones leaves out any file holding nothing but excluded
groups; the scope's count keeps it. When an earlier report of this project with the same scope
mode was kept, the last line is the clone trend: this run's class count, the previous run's, and
the signed delta, then how many classes are new since that run and how many gained copies
(trend in the JSON); the first run in a project prints none. When the report opens with No clone detector ran in any lane, offer the user the install command that headline carries (npm install -g jscpd, or a
devDependency) and run it only when they confirm; never install silently and never npx-fetch it.
Keep the --json document when the numbers feed a comparison:
/verification:measure metrics consumes it when the verification plugin is installed (treat a
report whose status is empty on either side as INCONCLUSIVE); otherwise keep the JSON beside
your notes and compare by hand.
What ships with it
7 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.
- evals/evals.json 2.6 KB
- scripts/audit-duplication.sh 13 KB runs code
- scripts/audit-duplication.test.sh 23 KB runs code
- scripts/cluster-clones.py 6.0 KB runs code
- scripts/registry-filter.py 8.8 KB runs code
- scripts/test_cluster_clones.py 8.4 KB runs code
- scripts/test_registry_filter.py 13 KB runs code
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.
- 4d ago Changed · +12 lines 8a6bfca1bd44
- 16d ago Changed b23e39b33888
- 17d ago Changed · -112 tokens per session ab368ea0de84
- 18d ago Changed · +1 lines c8db7c72bf74
- 23d ago Changed ed751bc2a369
- 1mo ago Changed · +41 lines · +5 tokens per session 2f8143fb3ca5
- 1mo ago Changed · +1 lines e00b2f34c05b
- 1mo ago Changed · +5 lines 76778afadd2c
- 1mo ago First seen · 125 lines · 210 tokens per session scan A 0644faad98b6
audit-duplication is a skill published in the GitHub repository melodic-software/claude-code-plugins (25 stars, last pushed today), licensed MIT. It adds 103 tokens to every session and 3,219 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-09-06.
Other skills, from other repositories
parallel-orchestrator
Manage parallel Claude Code workstreams using git worktrees. Use when: splitting large tasks across multiple workers, coordinating parallel development, monitoring worker progress, integrating completed work, analyzing work item documents (code reviews, issue lists). Triggers: parallel, orchestrator, worktrees…
parallel-worker
Execute focused implementation tasks in a parallel workflow. Use when: working on assigned files in a worktree, making checkpoint commits, signaling dependencies or blockers, completing orchestrator-assigned tasks. Triggers: worker, checkpoint, worktree, assigned scope, commit prefix, parallel task.
optimize-local-search
For NP-hard optimization: TSP, scheduling, assignment problems. Uses greedy construction + local improvement (2-opt, hill climbing).
pass-function-as-arg
For generic algorithms: strategy pattern, callbacks, configurable behavior. Pass functions as parameters to customize algorithm behavior.
solve-constraint-puzzle
For constraint satisfaction: Sudoku, scheduling, N-queens, logic puzzles, SAT-like problems, assignment problems. Uses propagate-then-search pattern.
test-with-examples
For example-driven development: test cases as specifications, input/output pairs, documentation through examples.