audit-duplication

audit-duplication is a skill for Claude Code from melodic-software/claude-code-plugins. It costs 69 tokens per session (3,349 once invoked), scanned A, original, MIT.

A code-analysis skill for finding repeated blocks of source code, called duplication or clones, in selected files or across a repository.

In plain words
What is it for?
It measures duplicated lines and tokens, reports each copy's file and line range, and uses available detectors for several programming languages.
Why use it?
It shows repeated code without declaring it a defect, so developers can decide whether the repetition is intentional or worth removing.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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-metrics plugin — 6 skills shipped together

Good fit It measures duplicated lines and tokens, reports each copy's file and line range, and uses available detectors for several programming languages.

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-metrics

Made for: Claude Code.

Or install code-metrics, the plugin that ships this one along with the rest of its 6 skills.

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 audit-duplication

README.md
[![agentmods](https://agentmods.dev/badge/skills/melodic-software/claude-code-plugins/audit-duplication/github.svg)](https://agentmods.dev/skills/melodic-software/claude-code-plugins/audit-duplication)
Your own site
<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.

agentmods 80×15 button for audit-duplication

Your own site · 80×15
<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>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,349 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.00069 $0.03349
Opus 5.5 $0.00028 $0.01340
Sonnet 5.5 $0.00014 $0.00670
Haiku 4.5 $0.00007 $0.00335

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

Security

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

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/audit-duplication.sh, scripts/audit-duplication.test.sh, scripts/cluster-clones.py, …), 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-metrics/skills/audit-duplication/SKILL.md · 198 lines

How it starts

The opening of the file, as written. The whole thing — 198 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 language:

Collector Languages Values per clone group When
jscpd every language 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 language'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/v3 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

Read the full file on GitHub · 198 lines

Files

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.

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 · -34 tokens per session 14588a4a598a
  2. 2d ago Changed 09ac25995c10
  3. 3d ago Changed 17c710668a74
  4. 5d ago Changed · +4 lines d32bff68232a
  5. 7d ago Changed · +4 lines 6c5c719ee2d9
  6. 10d ago Changed · +6 lines b2854dd40588
  7. 11d ago Changed 258b654f4f58
  8. 13d ago Changed f6ccc7a15078
  9. 25d ago Changed 07699348b9a0
  10. 26d ago First seen · 184 lines · 103 tokens per session scan A a60faed40de2

Subscribe to this mod's changes

audit-duplication is a skill published in the GitHub repository melodic-software/claude-code-plugins (33 stars, last pushed today), licensed MIT. It adds 69 tokens to every session and 3,349 once invoked, about $0.0003 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.

Related

audit-duplication compared with skills from other repositories

audit-duplication next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
audit-duplicationmelodic-software/claude-code-pluginsSkill33todayMITA69Claude 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
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code