compare-codebases

compare-codebases is a skill for Claude Code, Codex from kucherenko/jscpd. It costs 82 tokens per session (3,181 once invoked), scanned A, original, MIT.

A method for comparing two folders function by function, even when they use different programming languages. It identifies matching functions and functions that exist in only one codebase.

In plain words
What is it for?
Use it to compare ports, check whether iOS and Android versions match, or see which parts of two applications or libraries differ.
Why use it?
It helps reveal missing functionality and shows how two implementations relate without relying only on names or line-by-line similarity.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to compare ports, check whether iOS and Android versions match, or see which parts of two applications or libraries differ.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kucherenko/jscpd/compare-codebases
About the project

jscpd is a source-code copy/paste detector that finds duplicated code blocks across files and reports the results in formats such as SARIF, HTML, and badges. Developers use it for code-quality checks, continuous integration, pre-commit hooks, and agent-assisted reviews across many programming-language formats. Its catalogue skills help coding agents run or interpret duplication checks.

kucherenko/jscpd · 6,399 stars · on GitHub · jscpd.dev

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.

Any agent
npx skills add kucherenko/jscpd --skill compare-codebases
Clone the repo
git clone --depth 1 https://github.com/kucherenko/jscpd

Made for: Claude Code, Codex.

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 compare-codebases

README.md
[![agentmods](https://agentmods.dev/badge/skills/kucherenko/jscpd/compare-codebases/github.svg)](https://agentmods.dev/skills/kucherenko/jscpd/compare-codebases)
Your own site
<a href="https://agentmods.dev/skills/kucherenko/jscpd/compare-codebases"><img src="https://agentmods.dev/badge/skills/kucherenko/jscpd/compare-codebases/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 compare-codebases

Your own site · 80×15
<a href="https://agentmods.dev/skills/kucherenko/jscpd/compare-codebases"><img src="https://agentmods.dev/badge/skills/kucherenko/jscpd/compare-codebases.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,181 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.00082 $0.03181
Opus 5.5 $0.00033 $0.01272
Sonnet 5.5 $0.00016 $0.00636
Haiku 4.5 $0.00008 $0.00318

Measured 5d ago against content hash 06a2f10a84fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

compare-codebases 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 5d 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.

skills/compare-codebases/SKILL.md · 149 lines

How it starts

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

compare-codebases

jscpd --compare A B pairs every function of folder A with the function of folder B that does the same job, and lists the functions of each folder that have no counterpart. The two folders may be in one language or in two (Python and TypeScript, Kotlin and Swift, Java and Rust). This skill explains how the comparison works and how to run one well. For porting code with the comparison as the progress measure, use the code-migration skill; for the rest of jscpd, the jscpd skill.

How the comparison works

jscpd finds the functions of JavaScript, TypeScript, JSX, TSX, Vue, Svelte, Astro, Python, Rust, Go, Java, Kotlin, C#, C, C++, PHP, Ruby, Scala and Swift files in both folders. It turns the code of each function into a vector with a code embedding model that runs inside jscpd (CodeRankEmbed by default), so two functions that do the same job point the same way even when their languages, names and structure differ. Functions of one folder are never compared with each other.

Functions pair in two steps:

  1. By code. Two functions pair when each is the other's closest match in the other folder, their cosine similarity reaches the model's threshold (0.4125 across languages and 0.6375 within one language, with CodeRankEmbed), and the similarity stands out from the function's other matches. A function close to the best one also pairs when it reaches a higher bar, so a feature written twice on one side gets two pairs. A pair stays only when it is the best match of at least one of its two functions, so a lookalike from another class does not join a function and its counterpart; a tie goes to the file of the same name. Functions shorter than --min-tokens (30 with --compare) or --min-lines (5) stay out of this step, because a short function resembles too many others.
  2. By name. A function left over pairs with a function of the other folder under the same name, once case, underscores, spaces and punctuation are ignored (encodeBinary, encode_binary, _encode_binary; the test title rounds cents and rounds_cents), when their similarity reaches the medium level (0.5625 across languages with CodeRankEmbed). A name pair skips the closest-match and stand-out checks of the first step, so it needs more than that step's threshold; otherwise every load and init of two codebases would pair. Size does not matter here, so a short port is found. A name pair has to stay within modules the first step linked. A module is the folder right under the deepest folder all files of a side share (notification in android/notification/…), and a file that sits higher than the rest, such as a build script, does not move that folder up. Two modules link when one holds the most of the other's pairs, counted for code and for tests separately. So checkPermissions of one plugin does not pair with its namesake in another.

Read the full file on GitHub · 149 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. 5d ago Changed 06a2f10a84fe
  2. 7d ago Changed ab181a40c09f
  3. 12d ago Changed 970197490083
  4. 14d ago Changed 328932444e4f
  5. 15d ago Changed · +9 lines 65a213fedc0b
  6. 16d ago First seen · 140 lines · 82 tokens per session scan A f158a9010e5e

Subscribe to this mod's changes

compare-codebases is a skill published in the GitHub repository kucherenko/jscpd (6,399 stars, last pushed yesterday), licensed MIT. It adds 82 tokens to every session and 3,181 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-30.

Related

Other skills, from other repositories

recipe-front-review

Reviews completed frontend implementation for governing-source compliance, scope economy, repository quality, and security, then applies user-approved React corrections.

shinpr/claude-code-workflows · 29 tokens

new-skill

Scaffold a new brooks-lint analysis skill so it passes npm run validate and npm run evals on the first try — generates skills/{name}/SKILL.md (with the mandatory "Do NOT trigger for:" clause and a Process section citing guide step ranges) plus skills/{name}/{name}-guide.md (sequentially numbered steps), then appends…

hyhmrright/brooks-lint · 145 tokens

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

dorodango

Polishes working code through successive quality passes in fresh subagents. Use after tests pass when code needs multi-dimension refinement before release.

athola/claude-night-market · 31 tokens

ring:migrating-to-lib-observability

Migrating a Lerian Go app off lib-commons observability imports (deprecated shims or removed APIs) to lib-observability via a fixed mapping table, then bumps go.mod and validates the build; ring:backend-go applies the edits. Covers log/zap/runtime/assert, opentelemetry/tracing, HTTP middleware, context helpers, and…

LerianStudio/ring · 104 tokens

ring:searching-code

Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip for broad architecture mapping (use…

LerianStudio/ring · 74 tokens