home-assistant-assistant: Instructions file for Claude Code

AGENTS.md

home-assistant-assistant AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from Benny-Lewis/home-assistant-assistant. It costs 3,063 tokens per session, scanned A, original, MPL-2.0.

Shared instructions for a Home Assistant coding-agent plugin. Home Assistant is software for controlling smart-home devices, and the plugin lets users describe automations, scripts, scenes, and dashboards in ordinary language instead of editing YAML by hand.

In plain words
What is it for?
Use it to create or modify Home Assistant automations, scripts, scenes, dashboards, and related YAML configuration.
Why use it?
They set safety rules for generated configuration, such as checking whether device features are supported, protecting secrets, and avoiding deployment without explicit approval.

Instructions file for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: SessionStart hook event, but also the file is AGENTS.md. Also seen: reads .claude/ paths; mentions subagents; positional $N argument.

This is Benny-Lewis/home-assistant-assistant's own configuration. It tells Claude Code, Codex and OpenCode how to work on home-assistant-assistant 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 home-assistant-assistant configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Benny-Lewis/home-assistant-assistant. 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/Benny-Lewis/home-assistant-assistant/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Benny-Lewis/home-assistant-assistant

Made for: Claude Code, Codex, OpenCode.

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 home-assistant-assistant AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/benny-lewis/home-assistant-assistant/agents-md/github.svg)](https://agentmods.dev/instructions/benny-lewis/home-assistant-assistant/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/benny-lewis/home-assistant-assistant/agents-md"><img src="https://agentmods.dev/badge/instructions/benny-lewis/home-assistant-assistant/agents-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 home-assistant-assistant AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/benny-lewis/home-assistant-assistant/agents-md"><img src="https://agentmods.dev/badge/instructions/benny-lewis/home-assistant-assistant/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,063 This file is loaded in full into every session.
When invoked 3,063 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.03063 $0.03063
Opus 5 $0.01532 $0.01532
Sonnet 5 $0.00613 $0.00613
Haiku 4.5 $0.00306 $0.00306

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

Security

Grade A, and why

home-assistant-assistant AGENTS.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 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.

AGENTS.md · 225 lines

How it starts

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

AGENTS.md

Shared guidance for Claude Code and Codex when working in this repository.

Project Overview

This is a Claude Code and Codex plugin for Home Assistant. It allows users to manage Home Assistant configurations through natural language: creating automations, scripts, scenes, and dashboards by describing what they want instead of manually editing YAML.

Type: Claude Code and Codex plugin (markdown-based, no build system or compiled code)

Safety Invariants

All generated YAML and commands enforce eight safety invariants (canonical wording in references/safety-invariants.md):

  1. No unsupported attributes - Always check supported_features/supported_color_modes before suggesting device attributes
  2. No semantic substitution - Never replace "after no motion" (inactivity) with raw timers
  3. AST editing only - No brittle string replacement; use Edit tool with precise old/new strings
  4. No secrets printed - Never echo tokens; show "TOKEN is set" not the value
  5. Never deploy unless explicitly requested - All side-effectful skills require explicit user request and confirmation
  6. Evidence tables - All validation outputs show "what ran vs skipped"
  7. Minimal edits only - Make only the specific changes requested; do not reorganize adjacent content
  8. Verify after config edits - Offer deploy/reload after YAML changes; validate entity IDs exist before use

Plugin Architecture

The plugin has two agent-facing surfaces that share one canonical workflow source:

  • Claude Code reads .claude-plugin/, skills/, agents/, and hooks/.
  • Codex installs plugins/home-assistant-assistant/ from .agents/plugins/marketplace.json; inside that package, Codex reads .codex-plugin/, skills/, codex/, and packaged support files.
  • Canonical Home Assistant behavior stays in root skills/ and references/; Codex wrappers adapt invocation/tool semantics without forking domain logic and read packaged canonical copies from canonical-skills/.
.claude-plugin/
  plugin.json               # Claude plugin manifest - metadata, component discovery
.agents/plugins/
  marketplace.json          # Codex marketplace source; points at ./plugins/home-assistant-assistant
plugins/home-assistant-assistant/
  .codex-plugin/plugin.json # Codex plugin manifest for the installable package
  skills/                   # Codex-visible wrapper skills; the only SKILL.md tree in the package
  canonical-skills/         # Packaged shared workflow docs as README.md files, not SKILL.md
  codex/                    # Codex hooks and adapter reference
  helpers/, references/, templates/
skills/
  ha-automations/           # Automation creation + domain knowledge (user-invocable)
  ha-scripts/               # Script creation + domain knowledge (user-invocable)
  ha-scenes/                # Scene creation + domain knowledge (user-invocable)
  ha-config/                # Config organization knowledge (user-invocable)
  ha-jinja/                 # Jinja templating knowledge (user-invocable)
  ha-lovelace/              # Dashboard design knowledge (user-invocable)
  ha-naming/                # Naming conventions + audit + plan (user-invocable)
  ha-apply-naming/          # Naming execution (user-invocable, NO model invocation)
  ha-devices/               # Device knowledge + new device workflow (user-invocable)
  ha-troubleshooting/       # Debugging knowledge (user-invocable)
  ha-onboard/               # Setup wizard + connection + settings (user-invocable)
  ha-deploy/                # Deploy + rollback (user-invocable, in-skill confirmation gates)
  ha-validate/              # Validation workflow + procedures (user-invocable, agent-preloadable)
  ha-analyze/               # Setup analysis + recommendations (user-invocable)
  ha-resolver/              # Entity resolution (NOT user-invocable, agent-preloaded)
codex-skills/
  ha-*/                     # Source Codex wrapper skills copied into the installable package skills/ tree
codex/
  hooks.json                # Codex hook mapping
  session_check.py          # Codex SessionStart check (no Bash dependency)
  env_guard.py              # Codex PreToolUse guard, including PowerShell env dumps
  references/skill-adapter.md
agents/
  *.md                      # 6 subagents: config-debugger, ha-config-validator,
                            # device-advisor, naming-analyzer, ha-entity-resolver,
                            # ha-log-analyzer
helpers/
  area-search.py            # Area-based entity search (registry cross-referencing)
  entity-registry.py        # Entity registry operations
  ha-overview.py            # HA setup overview generation
  trace-fetch.py            # Automation trace fetching
  lovelace-dashboard.py     # Lovelace dashboard fetch/save/verify/find-entities
hooks/
  hooks.json                # Event-driven hooks (SessionStart, PreToolUse, PostToolUse)
  session-check.sh          # Claude async env check (HASS_TOKEN, HASS_SERVER, python detection)
  env-guard.sh              # PreToolUse guard for Bash commands
  docs-check.sh             # Documentation validation
  docs-check.py             # Documentation validation helper
references/
  safety-invariants.md      # Core safety rules referenced by all skills
  settings-schema.md        # Settings file schema
  hass-cli.md               # hass-cli usage reference
  ha-web-ui.md              # HA web UI reference
  dashboard-api.md          # WebSocket API contract for storage dashboards
templates/
  templates.md              # Reference templates for generated configs

Read the full file on GitHub · 225 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. 10d ago First seen · 225 lines · 3,063 tokens per session scan A e1a6aa587f22

Subscribe to this mod's changes

home-assistant-assistant AGENTS.md is an instructions file published in the GitHub repository Benny-Lewis/home-assistant-assistant (57 stars, last pushed 3mo ago), licensed MPL-2.0. It adds 3,063 tokens to every session, about $0.0153 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

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens