dedup

dedup is a skill for Claude Code, Codex from besimple-oss/broccoli. It costs 32 tokens per session (1,555 once invoked), scanned A, original, MIT.

A narrowly focused code-cleanup workflow that finds duplicate code in the changes between two Git commits and reuses shared utilities when possible. Git commits are saved versions of a codebase.

In plain words
What is it for?
Use it after making a set of changes when you want to remove newly introduced duplication and commit the resulting reuse changes.
Why use it?
It helps prevent new code from repeating logic that already exists, while keeping unrelated review or cleanup work out of scope.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; positional $N argument; mentions Claude Code.

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/besimple-oss/broccoli/dedup
Any agent
npx skills add besimple-oss/broccoli --skill dedup
Clone the repo
git clone --depth 1 https://github.com/besimple-oss/broccoli

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 dedup

README.md
[![agentmods](https://agentmods.dev/badge/skills/besimple-oss/broccoli/dedup.svg)](https://agentmods.dev/skills/besimple-oss/broccoli/dedup)
Your own site
<a href="https://agentmods.dev/skills/besimple-oss/broccoli/dedup"><img src="https://agentmods.dev/badge/skills/besimple-oss/broccoli/dedup.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,555 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.1 $0.00032 $0.01555
Opus 5 $0.00016 $0.00777
Sonnet 5 $0.00006 $0.00311
Haiku 4.5 $0.00003 $0.00155

Measured 6d ago against content hash cbf72162d752, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/run_dedup_loop.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.

prompt-templates/skills/dedup/SKILL.md · 114 lines

How it starts

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

Dedup Loop (dedupe-only)

Input: a git base SHA/ref to dedupe against. Default/recommended is auto, which resolves a branch-wide merge-base from integration/default refs first, then falls back to upstream (@{u}).

Preconditions

  • Confirm you are in the intended repo: git rev-parse --show-toplevel
  • Ensure you have a branch-wide base commit SHA (the fork-point/common-ancestor with the integration branch).
  • Start from a clean working tree (required):
    • git status --porcelain should be empty.
  • Ensure git can create commits (stop if missing):
    • If commits fail due to missing identity, configure user.name and user.email.
  • Ensure both CLIs are available (codex and claude) because reviewer/responder must be different vendors.

Scope / intent

  • This is NOT a general code review.
  • Only act on:
    • duplicate code introduced/expanded by BASE_SHA..HEAD, and/or
    • code introduced by BASE_SHA..HEAD that reimplements an existing shared util already in the repo.
  • Do not apply unrelated fixes (style, perf, security, naming, error handling) unless strictly required to complete a dedupe/reuse change safely.

Expected runtime

Typically runs 10–30 minutes, but allow at least 60 minutes.

Do not interrupt/restart the subagent if it looks stuck. The loop script owns stuck/timeout handling and will exit on its own when it completes or when --timeout is reached. Prefer watching the periodic heartbeat output (--heartbeat-seconds) instead of tailing logs.

Why Claude sometimes looked “stuck”

Claude Code print mode can be silent in --output-format text until it finishes (including during tool work). This repo defaults Claude subprocesses to --output-format stream-json --include-partial-messages so the wrapper sees measurable progress and inactivity timeouts mainly trigger on true hangs.

Run

resolve_skill_dir() {
  local name="$1"
  local repo_root=""
  repo_root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"

  local candidates=(
    "$repo_root/.agents/skills/$name"
    "$repo_root/.claude/skills/$name"
    "$HOME/.agents/skills/$name"
    "$HOME/.codex/skills/$name"
    "$HOME/.claude/skills/$name"
  )

  for d in "${candidates[@]}"; do
    if [[ -d "$d" ]]; then
      echo "$d"
      return 0
    fi
  done

  echo "Error: skill '$name' not found in repo-scoped or user-scoped skill dirs." >&2
  return 1
}

DEDUP_SKILL_DIR="$(resolve_skill_dir dedup)"
python3 "$DEDUP_SKILL_DIR/scripts/run_dedup_loop.py" auto

Read the full file on GitHub · 114 lines

Files

What ships with it

4 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. 6d ago First seen · 114 lines · 32 tokens per session scan A cbf72162d752

Subscribe to this mod's changes

dedup is a skill published in the GitHub repository besimple-oss/broccoli (285 stars, last pushed 4mo ago), licensed MIT. It adds 32 tokens to every session and 1,555 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

submit-review

Reference for how a finished ticket reaches human review in the Gaffer factory. Submission is RUNNER-OWNED — the agent commits its work and evidences the ACs, then stops; the runner records the delivery, pushes, opens the PR, and submits for review. Invoke when you think your work is ready to hand off, to confirm what…

tmj-90/gaffer · 95 tokens

high-quality-commit

コード変更を適切なgitコミット戦略でgit commitします。基本的には既存のgitコミットへのsquash戦略を採用し、必要に応じてブランチ全体のgitコミット履歴を再構成します。実装完了時やユーザーがgit commitを依頼した時に使用します。.

nek1987/auto-agent-harness · 83 tokens

agentic-jujutsu

Quantum-resistant, self-learning version control for AI agents with ReasoningBank intelligence and multi-agent coordination.

ruvnet/ruflo · 26 tokens

github-automation

GitHub workflow automation, PR management, issue tracking, and code review coordination. Integrates with GitHub Actions and repository management. Use when: PR creation, code review, issue management, release automation, workflow setup. Skip when: local-only changes, non-GitHub repositories.

ruvnet/ruflo · 61 tokens

git-commit

Stage, write, and structure git commits and pull requests cleanly. Read this before committing — for conventional-commit message format, when to split commits, and how to open a PR with the gh CLI.

spinabot/brigade · 46 tokens

commit-and-push

Create a well-formatted git commit and push to remote repository.

jmagly/aiwg · 17 tokens