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.
npx agentmods add commands/agentis-tools/ctx/duplicatesgit clone --depth 1 https://github.com/agentis-tools/ctxWhat 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 | $0.00000 | $0.00996 |
| Opus 5 | $0.00000 | $0.00498 |
| Sonnet 5 | $0.00000 | $0.00199 |
| Haiku 4.5 | $0.00000 | $0.00100 |
Grade A, and why
duplicates 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 2d 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 — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ctx duplicates
Detect structurally similar functions with MinHash near-duplicate search.
Synopsis
ctx duplicates [OPTIONS]
Description
The duplicates command compares MinHash fingerprints (built during ctx index) of every indexed function and method, including C/C++ and Zig functions and methods, and reports pairs whose normalized token shingles have a Jaccard similarity at or above the threshold.
Tokens are normalized before comparison - identifiers become ID, string and number literals become LIT, comments are dropped - so renamed variables and changed literals still match. Candidate pairs are found with LSH banding over 128-permutation MinHash signatures, then verified with the exact Jaccard similarity.
Breaking change: this replaces the old line-based detector.
--thresholdis a 0.0-1.0 Jaccard similarity over normalized 5-token shingles, not a percentage of matching lines; the old--similarity <PERCENT>/--min-lines <N>flags are gone. Existing indexes lack fingerprints: rebuild once withctx index --forceafter upgrading.
Prerequisites
Fingerprints are computed during indexing:
ctx index
Options
| Option | Description | Default |
|---|---|---|
--threshold <F> |
Jaccard similarity threshold (0.0-1.0) over normalized token shingles. Values below 0.5 are clamped to 0.5 (LSH candidate detection is unreliable below that) | 0.85 |
--min-tokens <N> |
Ignore functions with fewer than N normalized tokens | 50 |
--against <REF> |
Only report pairs where at least one function is in a file changed relative to REF | none |
--fail-on-found |
Exit 1 when any near-duplicate pair is reported | false |
--json |
Machine-readable output (global flag) | false |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success (default mode is informational, even with pairs found) |
| 1 | --fail-on-found was given and at least one pair was reported |
| 2 | Operational error (missing index, bad git ref, invalid threshold) |
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.
- 2d ago First seen · 119 lines · 0 tokens per session scan A 7624ce309f0c
duplicates is a command published in the GitHub repository agentis-tools/ctx (11 stars, last pushed 15d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 996 tokens. 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-08-30.
Other commands, from other repositories
coograph-review
Review the changes in scope for spec compliance, convention violations, logic bugs, and architectural issues. You review — you do not author. Never edit files.
coograph-verify
Verify that the described work is complete and correct. Provide evidence for every claim. You verify — you do not implement or fix style.
api-gen
Generate REST API endpoints with routes, validation, error handling, and tests.
component-gen
Generate React or Vue components with prop types, styling, accessibility, and tests.
code-review
Review staged git changes for bugs, security issues, and style violations.
pr-description
Generate a PR title and description from the current branch diff against main.