claude-code-ha CLAUDE.md

claude-code-ha CLAUDE.md is an instructions file for coding agents from danbuhler/claude-code-ha. It costs 1,735 tokens per session, scanned A, original, MIT.

Project instructions for configuring Home Assistant, a system for controlling smart-home devices and automations, through its files and command-line tools.

In plain words
What is it for?
Use them to edit Home Assistant YAML configuration and look up entity, device, registry, automation, scene, state, or attribute information.
Why use it?
They provide a consistent way to find configuration, inspect devices and entities, and retrieve complete or quick status details.

Instructions file

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 instructions/danbuhler/claude-code-ha/claude-md
Clone the repo
git clone --depth 1 https://github.com/danbuhler/claude-code-ha

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 claude-code-ha CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/danbuhler/claude-code-ha/claude-md.svg)](https://agentmods.dev/instructions/danbuhler/claude-code-ha/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/danbuhler/claude-code-ha/claude-md"><img src="https://agentmods.dev/badge/instructions/danbuhler/claude-code-ha/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,735 This file is loaded in full into every session.
When invoked 1,735 The same file — it is already loaded in full.
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.01735 $0.01735
Opus 5 $0.00868 $0.00868
Sonnet 5 $0.00347 $0.00347
Haiku 4.5 $0.00173 $0.00173

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

Security

Grade A, and why

claude-code-ha CLAUDE.md 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.

CLAUDE.md · 252 lines

How it starts

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

Home Assistant Configuration

Instructions for Claude Code when working with Home Assistant.

File Structure

YAML configurations are primarily stored in /config/packages/*.yaml. When searching, check all yaml files in /config/*.yaml and the packages folder.

Configurations and automations should be in self-contained files in the packages/ folder.

Getting Entity/Device Information

Prefer ha-ws for detailed lookups - it provides full context:

# Get comprehensive entity info (registry, state, related automations/scenes)
ha-ws entity get <entity_id>

# Get comprehensive device info (all entities, related automations/scenes)
ha-ws device get <device_id>

# Use --json for full raw data
ha-ws --json entity get sensor.temperature

For quick state checks, ha-api is faster:

ha-api state light.kitchen      # Just the state value
ha-api attr sensor.temperature  # Just attributes

REST API CLI Tool

Use ha-api for REST API interactions:

ha-api <command> [options]

Commands

Command Description
states [filter] List all entities (optional grep filter)
state <entity_id> Get state of specific entity
domains List entity counts by domain
devices <device_class> Find entities by device_class (motion, door, temperature, etc.)
search <pattern> Search entity IDs by pattern
call <domain> <service> Call a service
attr <entity_id> Show all attributes of an entity
history <entity_id> [hrs] Get history for entity (default: 24 hours)
get <endpoint> GET any API endpoint
post <endpoint> [json] POST to any API endpoint with optional JSON body

Examples

ha-api devices motion           # Find all motion sensors
ha-api devices occupancy        # Find occupancy sensors
ha-api search kitchen           # Find entities containing "kitchen"
ha-api state light.living_room  # Get current state
ha-api attr sensor.temperature  # Show all attributes
ha-api call light turn_on       # Call a service

Read the full file on GitHub · 252 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 · 252 lines · 1,735 tokens per session scan A 07431cd4ccbb

Subscribe to this mod's changes

claude-code-ha CLAUDE.md is an instructions file published in the GitHub repository danbuhler/claude-code-ha (101 stars, last pushed 8mo ago), licensed MIT. It adds 1,735 tokens to every session, about $0.0087 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 instructions, from other repositories

firmware CLAUDE.md

Claude Code instructions for OpenIPC/firmware, covering claude.md, what this is, before you start: is this the right repository?, build and common tasks.

OpenIPC/firmware · 4,948 tokens

Tutorial_AwesomeModernCPP AGENTS.md

AGENTS.md instructions for Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP, covering agents.md, 这是什么, 通用 essentials(所有 agent 必读) and 你来做什么?(按场景路由).

Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP · 778 tokens

brilliant_sdk AGENTS.md

Instructions for brilliantlabsAR/brilliant_sdk, covering brilliant sdk — agent guide, how an app works (the pattern behind everything), minimal reading paths, verify without hardware and testing.

brilliantlabsAR/brilliant_sdk · 1,817 tokens

NeoMind CLAUDE.md

Claude Code instructions for camthink-ai/NeoMind, covering neomind — edge ai platform for iot, development commands, ecosystem repositories, extension package contract (.nep) and device type template contract (json).

camthink-ai/NeoMind · 4,457 tokens

zmk-config AGENTS.md

AGENTS.md instructions for urob/zmk-config, covering customization guide, ground rules, how the multi-board layout works, adding a new board and where to change what.

urob/zmk-config · 1,867 tokens

ext-apps CLAUDE.md

Claude Code instructions for modelcontextprotocol/ext-apps, a project described as: Official repo for spec & SDK of MCP Apps protocol - standard for UIs embedded AI chatbots, served by MCP servers.

modelcontextprotocol/ext-apps · 3 tokens