MCPcopy Create free account
hub / github.com/corca-ai/nose

github.com/corca-ai/nose

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.21.0 ↗ · + Follow · compare 4 versions
14,714 symbols 66,409 edges 1,939 files ⚖ MIT 1,092 documented · 7% updated 4d agov0.20.0 · 2026-07-22★ 702 open issues

Browse by type

Functions 13,380 Types & classes 1,334
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

nose

nose finds duplicated code — literal copy-paste, renamed copies, and the same logic written in a different style or language — across Python, JavaScript, TypeScript, Go, Rust, Java, C, Ruby, Swift, plus declarative CSS (computed-style equivalence) and HTML markup (rendered-DOM equivalence), including the <script>/<style>/markup regions inside Vue, Svelte, and HTML. It proves its semantic matches are real — equal fingerprint ⟹ equal behavior, never a false equivalence — and ranks candidates by refactoring value for triage or CI. One self-contained Rust binary; no runtime, services, or network.

What semantic means

Other copy-paste detectors compare token runs. nose lowers code into a normalized semantic IL, so it can catch repeated computation even when the code does not look copied:

import java.util.Arrays;

class PairTotals {
    static int nested(int[] xs, int[] ys) {
        int total = 0;
        for (int x : xs) {
            for (int y : ys) {
                total += x + y;
            }
        }
        return total;
    }

    static int streamed(int[] xs, int[] ys) {
        return Arrays.stream(xs)
            .flatMap(x -> Arrays.stream(ys).map(y -> x + y))
            .reduce(0, (total, value) -> total + value);
    }
}

The methods look unrelated as text, but both visit the same ordered pairs and sum x + y from zero. nose reports them as one exact family only when it can prove the stream source, flattening, reduction seed and step, and callback effects. Change one of those and the methods stay separate. See clone types for the distinction between verified and similarity-based findings.

Install

# Homebrew (macOS / Linux):
brew install corca-ai/tap/nose

# Or the install script (downloads a prebuilt binary):
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/corca-ai/nose/releases/latest/download/nose-cli-installer.sh | sh

Quick start

Point nose query at a directory to inspect its duplication. It prints a summary and runnable next commands, so you can filter, group, or open one family without memorizing flags:

$ nose query src
nose finds duplication in code and docs.
nose finds; you judge. Filter, group, sort, or open families to explore.
analyzed 23 files · python 14 · typescript 9

4 duplicated-code families.
  verified 1 (exact 1 · shared-core 0) · copy-paste 1 · similar 2
  verified = machine-checked evidence · exact = same unit behavior · shared-core = shared computation

best candidates:
  src/loaders/users.py:1  load_users  2 copies · 8/10 shared, 2p · ~8 removable · similar   nose query src id=b221962180
  …
next commands — replace <path> with your path; terms combine with AND:
  filter  nose query <path> witness=exact   keep only the exact-behavior families
  group   nose query <path> group=dir       totals by directory (or: witness, lang, scope)
  open    nose query <path> id=<id> full     one family: every copy + the extraction skeleton

nose query is the one command for every workflow over that dataset. Use it broadly for agent/human exploration, and pin it tightly when it is a CI gate:

# Explore and triage
nose query src                               # summary, best candidates first
nose query src id=<fam> full                 # open one family: every copy + extraction skeleton
nose query src base=origin/main              # PR check: a change applied to one copy but not its siblings
nose query src --format markdown             # a ranked report to paste into a PR or issue
nose query src --format json                 # the versioned machine-readable contract
nose query docs                              # also reports same-language near-duplicate Markdown prose

# Gate on copy-paste only, with an explicit size budget
nose query src --mode syntax --min-size 80 'lines>25' --fail-on any
nose query src --mode syntax --min-size 80 'shared>20' --fail-on any
nose query src --mode syntax --min-size 80 'dup>80' --fail-on any

By default it runs all three channels — syntax (copy-paste runs), semantic (exact same-logic Type-4 clones), and near (fuzzy near-duplicates) — and respects .gitignore; pass --mode to run exactly the channels you list. See agent-recipe for the exploration loop and continuous integration for stable copy-paste-only gates, baselines, and SARIF.

Faster local feedback

Reuse unchanged analysis when you rerun a query, or keep a foreground JSONL session open for an editor or local tool:

nose query . --cache-dir .nose-cache
nose query . --cache-dir .nose-cache --watch --format jsonl

Caching is explicit and does not change the findings. Watch mode starts no daemon or network service. See query cache and watch mode.

Documentation

Status

Pre-1.0. Current capability, language, JSON, benchmark, and soundness details live in the wiki so claims have one source of truth:

License

MIT

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 11,535
Method 1,845
Class 1,014
Enum 300
Struct 15
Interface 5

Languages

Rust74%
Python21%
Swift2%
TypeScript2%
Ruby1%
Java1%

Modules by API surface

scripts/scheduling-lifecycle-boundary-audit.py103 symbols
bench/labels/default_head_taxonomy.py67 symbols
bench/type4/python_loop_demorgan_proof_facts.py64 symbols
bench/labels/label_refresh.py56 symbols
eval/divergence_fire/precision_protocol.py55 symbols
bench/labels/residual_ranking.py52 symbols
scripts/check-soundness-scorecard.py51 symbols
eval/divergence_fire/replay.py51 symbols
crates/nose-semantics/src/constructor_contracts.rs48 symbols
bench/type4/proof_carrying_frontier.py48 symbols
scripts/python-hof-runtime-audit.py47 symbols
crates/nose-semantics/src/packs/v1.rs47 symbols

For agents

$ claude mcp add nose \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page