dedup

dedup is a skill for Claude Code, Codex from tonydzi/second-brain-starter-kit. It costs 72 tokens per session (1,091 once invoked), scanned A, original, MIT.

A tool for finding notes that are identical or very similar across a knowledge vault, then helping merge them by marking one as replaced rather than deleting it. A vault is a collection of connected notes, such as an Obsidian workspace.

In plain words
What is it for?
Cleaning up duplicate rules, concepts, people, or leads; scanning notes for similar content; and preparing safe, human-reviewed merges.
Why use it?
Duplicate notes make information harder to trust and maintain. The review step helps distinguish real duplicates from notes that merely cover related topics.

Skill for Claude CodeCodex

Part of the second-brain-skills plugin — 57 skills shipped together

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.

agentmods
npx agentmods add skills/tonydzi/second-brain-starter-kit/dedup
Any agent
npx skills add tonydzi/second-brain-starter-kit --skill dedup
Clone the repo
git clone --depth 1 https://github.com/tonydzi/second-brain-starter-kit

Made for: Claude Code, Codex.

Or install second-brain-skills, the plugin that ships this one along with the rest of its 57 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 dedup

README.md
[![agentmods](https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/dedup.svg)](https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/dedup)
Your own site
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/dedup"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/dedup.svg" alt="Measured on agentmods" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,091 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00072 $0.01091
Opus 5 $0.00036 $0.00545
Sonnet 5 $0.00014 $0.00218
Haiku 4.5 $0.00007 $0.00109

Measured 4d ago against content hash b0ea50a10380, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

skills/dedup/SKILL.md · 53 lines

How it starts

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

/dedup — find & merge duplicates (supersede, never delete)

🧒 When reporting to a non-technical operator: end with a child-simple "In plain words" recap in their language.

🖥️ Dashboard first (the operator works visually)

python "$IMPORTS_ROOT/build_dedup_dashboard.py" (it runs the scan itself) → open $OBSIDIAN_VAULT/_Dashboards/Dedup-Dashboard.html: candidate clusters by topic, colour = similarity (🔴 ≥0.7 almost certainly a duplicate); each cluster shows which note to keep (the newer one) and which becomes superseded. DISPLAY ONLY; merging is done by hand below (supersede, never delete). Complementary notes are left alone.

Step 1 — Scan (deterministic; AK-47, ~free; token law)

python "$IMPORTS_ROOT/dedup_scan.py" → scans ACTIVE notes by theme, difflib similarity → candidate clusters in $IMPORTS_ROOT/dedup_report.txt. For a DIFFERENT folder, copy the script and change its OPS path. Start at similarity ≥0.5 (high-confidence), then ≥0.4 for the next tier — loop-until-dry (stop when remaining clusters are complementary/noise).

Step 2 — Judge each cluster (NOT every look-alike is a dup)

  • Identical → keep the original (lowest msg_id), mark the echo superseded.
  • Same topic, different nuance, non-conflicting → keep the NEWER; graft the older's unique nuances into it.
  • Conflict → NEWER wins (the operator's law: fresher beats older on the same topic). BUT an explicit origin: anton rule is overridden only by the operator or an explicit supersedes.
  • Complementary (different facets/recipients) → LEAVE. Merging loses nuance (e.g. "notify the operator" vs "notify teacher" vs "notify nanny" = 3 rules, not 1).
  • Money / sensitive / ambiguous → do NOT merge; FLAG for the operator.

Step 3 — Apply the merge (truth layer)

  • Canonical note: add audience, supersedes: "[[loser]]", graft nuances into the body.
  • Loser note: status: activesuperseded; add superseded_by: "[[canonical]]"; add body marker > ⊘ Merged into [[canonical]] — <reason>. NEVER delete (git-reversible; nothing lost).
  • Record in the sidecar $IMPORTS_ROOT/superseded_rules.json ("<msg_id>": {"by": "<canonical_fn>"}) so the decision survives a pipeline rebuild.

Read the full file on GitHub · 53 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. 4d ago First seen · 53 lines · 72 tokens per session scan A b0ea50a10380

Subscribe to this mod's changes

dedup is a skill published in the GitHub repository tonydzi/second-brain-starter-kit (5 stars, last pushed 5d ago), licensed MIT. It adds 72 tokens to every session and 1,091 once invoked, about $0.0004 per session on Opus 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-08-31.

Related

Other skills, from other repositories

wiki-retrieve

Build and query a vault-local contextual BM25 retrieval index with optional multilingual Nomic cosine reranking; use for retrieve, hybrid retrieval, BM25, rerank, contextual retrieval, chunk search, vault search, semantic search, find relevant passages, or retrieval diagnostics. Derived caches stay under .vault-meta…

AgriciDaniel/claude-obsidian · 81 tokens

obsidian-bases

Explain, draft, and validate Obsidian Bases .base files with filters, formulas, properties, summaries, and table, card, or list views. Use for Obsidian Bases, database-like vault views, dynamic tables, reading lists, task trackers, filters, formulas, summaries, and .base file edits.

AgriciDaniel/claude-obsidian · 69 tokens

save

Save a user-selected answer, decision, insight, or session summary into an Obsidian vault as one reviewed transaction. Use only when the user explicitly asks to preserve specific conversation content, not when they supply a file or URL to ingest. Triggers: /save, save this, save that answer, file this conversation…

AgriciDaniel/claude-obsidian · 80 tokens

wiki-fold

Create a bounded, extractive, structurally idempotent rollup of recent Obsidian wiki log entries, with dry-run preview by default and one optional transaction apply. Use for manual log compression without modifying child pages. Triggers: fold the log, run a fold, run wiki-fold, log rollup, roll up log entries, commit…

AgriciDaniel/claude-obsidian · 76 tokens

wiki-mode

Read or configure the vault filing methodology and suggest destinations for planned knowledge creation under Generic, LYT, PARA, or Zettelkasten. Use for wiki mode, methodology mode, what is my vault mode, set vault mode, switch to PARA, use LYT, Zettelkasten setup, change mode, configure mode, or methodology routing.…

AgriciDaniel/claude-obsidian · 83 tokens

wiki-cli

Detect and use the official Obsidian command-line interface for read-only vault access; use for wiki-cli, Obsidian CLI, Obsidian read, Obsidian search, vault transport, which transport, transport detection, backlinks, tags, or Obsidian command line. Mutations always go through the claude-obsidian transaction core.

AgriciDaniel/claude-obsidian · 74 tokens