haggle: Agent for Claude Code

.claude/agents/energy-domain-expert.md

energy-domain-expert is an agent for Claude Code from NaanyaBiz/haggle. It costs 61 tokens per session (845 once invoked), scanned A, original, Apache-2.0.

A specialist for Home Assistant energy sensors and Australian electricity data. It explains the metadata and historical-statistics rules needed for Home Assistant's Energy dashboard.

In plain words
What is it for?
Use it when defining energy or money sensors, importing past usage, handling NEM12 electricity files, or calculating tariffs and costs.
Why use it?
It prevents energy readings from being labelled, timestamped, or accumulated in ways that make the dashboard show incorrect results.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is NaanyaBiz/haggle's own configuration. It tells Claude Code how to work on haggle itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything haggle configures →

Reuse

Borrowing it

Nothing to install: this file belongs to NaanyaBiz/haggle. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/NaanyaBiz/haggle/main/.claude/agents/energy-domain-expert.md
Clone the repo
git clone --depth 1 https://github.com/NaanyaBiz/haggle

Made for: Claude Code.

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 energy-domain-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/naanyabiz/haggle/energy-domain-expert/github.svg)](https://agentmods.dev/agents/naanyabiz/haggle/energy-domain-expert)
Your own site
<a href="https://agentmods.dev/agents/naanyabiz/haggle/energy-domain-expert"><img src="https://agentmods.dev/badge/agents/naanyabiz/haggle/energy-domain-expert/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 energy-domain-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/naanyabiz/haggle/energy-domain-expert"><img src="https://agentmods.dev/badge/agents/naanyabiz/haggle/energy-domain-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 845 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.00061 $0.00845
Opus 5 $0.00030 $0.00423
Sonnet 5 $0.00012 $0.00169
Haiku 4.5 $0.00006 $0.00085

Measured 3d ago against content hash 7c1077b82647, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

energy-domain-expert 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 3d 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.

.claude/agents/energy-domain-expert.md · 82 lines

How it starts

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

You are an expert in Home Assistant's Energy dashboard requirements and Australian electricity market data formats.

Energy dashboard sensor contracts

For the Energy dashboard to accept a sensor, it must have:

device_class = SensorDeviceClass.ENERGY
state_class  = SensorStateClass.TOTAL_INCREASING  # for cumulative kWh
native_unit_of_measurement = UnitOfEnergy.KILO_WATT_HOUR

Use TOTAL_INCREASING, not TOTAL, for the main consumption sensor. HA infers resets automatically from decreasing values. TOTAL with last_reset is only appropriate when you know the exact reset timestamp (e.g. bill period boundaries).

import_statistics() — mandatory for this integration

AGL data is always historical (intervals happened in the past). A live state sensor would attribute 48h-old consumption to "now", which breaks Energy dashboard graphs.

Use recorder.statistics.async_import_statistics():

from homeassistant.components.recorder.models import StatisticData, StatisticMetaData
from homeassistant.components.recorder.statistics import async_import_statistics

metadata = StatisticMetaData(
    has_mean=False,
    has_sum=True,
    name="AGL Consumption",
    source=DOMAIN,
    statistic_id=f"{DOMAIN}:consumption_{contract_number}",
    unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
)
statistics = [
    StatisticData(
        start=interval.dt,           # slot-start UTC datetime
        sum=cumulative_kwh_so_far,   # running total (not delta)
        state=interval.kwh,          # delta for the interval
    )
    for interval in readings
]
async_import_statistics(hass, metadata, statistics)

The sum field is the cumulative total (monotonically increasing), not the interval delta. Build the running sum from the earliest available reading.

Sensor design for haggle

Entity device_class state_class unit Notes
consumption ENERGY TOTAL_INCREASING kWh Fed via import_statistics
consumption_today ENERGY TOTAL kWh Resets at local midnight
consumption_period ENERGY TOTAL kWh Resets at bill period start
bill_projection MONETARY MEASUREMENT AUD Forecast
unit_rate MONETARY MEASUREMENT AUD/kWh From /plan
supply_charge MONETARY MEASUREMENT AUD/day From /plan

Read the full file on GitHub · 82 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. 3d ago Changed · +4 lines 7c1077b82647
  2. 7d ago First seen · 78 lines · 61 tokens per session scan A 5c5e98bc1a87

Subscribe to this mod's changes

energy-domain-expert is an agent published in the GitHub repository NaanyaBiz/haggle (13 stars, last pushed yesterday), licensed Apache-2.0. It adds 61 tokens to every session and 845 once invoked, about $0.0003 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-09-04.

Related

Other agents, from other repositories

ha-esphome-config-reviewer

Produces one bundled, read-only device-level review of an ESPHome device configuration: config-pattern conformance, credential and API/OTA hardening, schema currency against the official ESPHome docs, Home-Assistant-driven binding correctness, display rendering discipline, display design conformance (palette roles…

nolte/claude-home-assistant · 223 tokens

ha-esphome-fleet-reviewer

Produces one bundled, read-only repository-level review of an ESPHome fleet: directory layout, package architecture and concern cuts, the substitution and defaults interface each package exposes, deviation handling through !extend / !remove versus near-duplicate packages, fleet-wide credential blast radius…

nolte/claude-home-assistant · 200 tokens

ha-integration-reviewer

Produces one bundled, read-only integration-review report for a Home Assistant Custom Integration: quality-scale tier assessment, security/hardening review, and cross-cutting consistency checks (manifest-tier coherence, translations, diagnostics redaction, device classes, spec drift, upstream-docs spot-check).…

nolte/claude-home-assistant · 213 tokens

ha-blueprint-author

Authors one Home Assistant blueprint (automation, script, or template domain) as a single self-contained YAML file conforming to the ha/blueprint-patterns spec — correct blueprint: header, declared inputs with type-appropriate selectors, the !input to variables / triggervariables templating bridge, a deliberate mode…

nolte/claude-home-assistant · 206 tokens

ha-integration-verifier

Diagnoses a deployed Home Assistant Custom Integration in a running HA pod inside a Kind / local Kubernetes cluster — pod-status check, recent-log scan with error-pattern detection, installed-files verification — and return a structured health report. Read-only: never deploys, never restarts, never modifies state. Use…

nolte/claude-home-assistant · 179 tokens

antenna-engineer

Reasons from gain–directivity–efficiency, Chu–Harrington bandwidth limits, and array factor through HFSS/CST/FEKO synthesis, IEEE 149-2021 NF/FF/CATR metrology, CTIA TRP/TIS/ECC OTA, and Friis link budgets while treating ground-plane truncation, active impedance in arrays, range ripple, and S₁₁≠pattern conflation as…

K-Dense-AI/scientific-agents · 97 tokens