claude-code-ha: Instructions file for Claude Code

CLAUDE.md

claude-code-ha CLAUDE.md is an instructions file for Claude Code 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions Claude Code.

This is danbuhler/claude-code-ha's own configuration. It tells Claude Code how to work on claude-code-ha 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 claude-code-ha configures →

Reuse

Borrowing it

Nothing to install: this file belongs to danbuhler/claude-code-ha. 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/danbuhler/claude-code-ha/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/danbuhler/claude-code-ha

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/danbuhler/claude-code-ha/claude-md/github.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/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 claude-code-ha CLAUDE.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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.01735 $0.01735
Opus 5.5 $0.00694 $0.00694
Sonnet 5.5 $0.00347 $0.00347
Haiku 4.5 $0.00173 $0.00173

Measured 2mo ago against content hash 07431cd4ccbb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 (107 stars, last pushed 10mo ago), licensed MIT. It adds 1,735 tokens to every session, about $0.0069 per session on Opus 5.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

claude-code-ha CLAUDE.md compared with instructions from other repositories

claude-code-ha CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
claude-code-ha CLAUDE.mddanbuhler/claude-code-haInstructions file10710mo agoMITA1,735Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot