ha-find-duplicates

ha-find-duplicates is a command for Claude Code from ESJavadex/claude-homeassistant-plugins. It costs 10 tokens per session (259 once invoked), scanned A, original, MIT.

A Home Assistant command for finding repeated or overlapping automations and scripts in configuration files.

In plain words
What is it for?
It scans a Home Assistant configuration, reports exact duplicates, similar items, and conflicting triggers, then suggests what to keep and how to consolidate them.
Why use it?
It helps reveal duplicate behavior and trigger conflicts that can make a smart-home setup hard to understand or unpredictable.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the homeassistant-config plugin — 1 skill, 1 command, 1 agent shipped together

Good fit It scans a Home Assistant configuration, reports exact duplicates, similar items, and conflicting triggers, then suggests what to keep and how to consolidate them.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/esjavadex/claude-homeassistant-plugins/ha-find-duplicates
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.

Clone the repo
git clone --depth 1 https://github.com/ESJavadex/claude-homeassistant-plugins

Made for: Claude Code.

Or install homeassistant-config, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

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 ha-find-duplicates

README.md
[![agentmods](https://agentmods.dev/badge/commands/esjavadex/claude-homeassistant-plugins/ha-find-duplicates/github.svg)](https://agentmods.dev/commands/esjavadex/claude-homeassistant-plugins/ha-find-duplicates)
Your own site
<a href="https://agentmods.dev/commands/esjavadex/claude-homeassistant-plugins/ha-find-duplicates"><img src="https://agentmods.dev/badge/commands/esjavadex/claude-homeassistant-plugins/ha-find-duplicates/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 ha-find-duplicates

Your own site · 80×15
<a href="https://agentmods.dev/commands/esjavadex/claude-homeassistant-plugins/ha-find-duplicates"><img src="https://agentmods.dev/badge/commands/esjavadex/claude-homeassistant-plugins/ha-find-duplicates.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 259 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.00010 $0.00259
Opus 5 $0.00005 $0.00130
Sonnet 5 $0.00002 $0.00052
Haiku 4.5 $0.00001 $0.00026

Measured 10d ago against content hash 948bb6b0e730, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

ha-find-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 10d 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.

homeassistant-config/commands/ha-find-duplicates.md · 43 lines

What it actually says

Find Duplicate Automations and Scripts

Scan Home Assistant configuration files to find duplicate automations and scripts.

Instructions

Run the duplicate finder script to analyze the configuration:

python3 ${PLUGIN_DIR}/skills/homeassistant-config/scripts/find_duplicates.py ${1:-.} --verbose

If no path argument is provided, analyze the current directory.

Analysis Steps

  1. Run the script above to find duplicates
  2. Report findings to the user in a clear format:
    • Exact duplicates: Items with identical triggers/actions
    • Similar items: Items with similar names or overlapping functionality
    • Conflicting automations: Multiple automations that could fire for the same event
  3. For each duplicate found, suggest:
    • Which one to keep (the more complete/better named one)
    • How to consolidate them if they have different conditions
    • Entity IDs that may need updating after removal

Output Format

Present results as:

Exact Duplicates

  • List automations/scripts with identical logic

Similar Automations

  • List automations with similar triggers or entity targets

Recommendations

  • Specific actions to take for cleanup
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. 10d ago First seen · 43 lines · 10 tokens per session scan A 948bb6b0e730

Subscribe to this mod's changes

ha-find-duplicates is a command published in the GitHub repository ESJavadex/claude-homeassistant-plugins (26 stars, last pushed 9mo ago), licensed MIT. It adds 10 tokens to every session and 259 once invoked, about $0.0001 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.