setup-infrastructure

setup-infrastructure is a skill for Claude Code, Codex from dcb/homeassistant-claude-kit. It costs 65 tokens per session (3,219 once invoked), scanned E, original, MIT.

A setup procedure for connecting a project to Home Assistant, a platform for controlling and automating smart-home devices. It configures the API connection, secure shell access, and an initial configuration download, and can verify or repair that setup.

In plain words
What is it for?
Use it for first-time setup, reconnecting to Home Assistant, checking a broken token, configuring the connection, or confirming that the required infrastructure works.
Why use it?
It helps resolve connection and access problems before other Home Assistant tasks are run. It also explains when project data will be read and asks for consent first.

Skill for Claude CodeCodex

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 skills/dcb/homeassistant-claude-kit/setup-infrastructure
Any agent
npx skills add dcb/homeassistant-claude-kit --skill setup-infrastructure
Clone the repo
git clone --depth 1 https://github.com/dcb/homeassistant-claude-kit

Made for: Claude Code, Codex.

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 setup-infrastructure

README.md
[![agentmods](https://agentmods.dev/badge/skills/dcb/homeassistant-claude-kit/setup-infrastructure.svg)](https://agentmods.dev/skills/dcb/homeassistant-claude-kit/setup-infrastructure)
Your own site
<a href="https://agentmods.dev/skills/dcb/homeassistant-claude-kit/setup-infrastructure"><img src="https://agentmods.dev/badge/skills/dcb/homeassistant-claude-kit/setup-infrastructure.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,219 The whole file, excluding the scripts and references it only reads on demand.
Security scan E 4 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.00065 $0.03219
Opus 5 $0.00032 $0.01610
Sonnet 5 $0.00013 $0.00644
Haiku 4.5 $0.00006 $0.00322

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

Security

Grade E, and why

setup-infrastructure scanned grade E with 4 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 5d 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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

Or manually add `~/.ssh/id_rsa.pub` (or `id_ed25519.pub`) to the SSH add-on's

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

source .env && curl -sf -H "Authorization: Bearer $HA_TOKEN" "$HA_URL/api/" | python3 -c "import sys,json; d=json.load(sys.stdin); print('HA version:', d.get('version','unknown'))"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

your connection." Then proceed to Step 3 — the curl test validates the values work via

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

sha = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True,
.claude/skills/setup-infrastructure/SKILL.md · 301 lines

How it starts

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

Setup Infrastructure

This skill configures the mechanical layer: HA API connectivity, SSH access, and initial config pull. It is idempotent — run it any time to verify or repair the connection without affecting your actual configuration.

Only ask once per session. If the user already consented during an earlier invocation of this skill in the same conversation, skip this step entirely.

1a. Data consent — Before reading any Home Assistant data, inform the user:

"This skill will connect to your Home Assistant instance and read your entity registry, automation configs, and documentation files. This data is sent to Anthropic's API as part of this Claude conversation. See PRIVACY.md for full details. Continue? (yes / no)"

If the user says no, stop here and explain they can still use the repo manually.

1b. Privacy mode offer — Only ask if consent was given. Only ask once per session.

First check if privacy mode is already active: test -f .claude/privacy-patterns. If it is, say "Privacy mode is already enabled" and skip the offer.

If not active, ask:

"Would you like to enable privacy mode? This blocks Claude from directly reading your credentials, personal data files, and runtime state. Setup still works — shell commands handle connectivity. You can toggle this later with make privacy-on / make privacy-off. Enable privacy mode? (yes / no)"

If yes: cp .claude/privacy-patterns.example .claude/privacy-patterns If no: proceed without it.

Step 2: Check .env

Check whether .env exists in the repo root:

test -f .env && echo "exists" || echo "missing"

If missing: Tell the user to copy .env.example to .env and fill in:

Variable Description Example
HA_TOKEN Long-lived access token (HA → Profile → Security → Long-Lived Access Tokens) eyJ...
HA_URL Your HA URL (local or remote) http://homeassistant.local:8123
HA_HOST SSH hostname, IP, or SSH config alias homeassistant.local or ha
SSH_USER SSH add-on user (usually root) root
HA_REMOTE_PATH Remote config directory (see note below) /config/ or /homeassistant/
VITE_GO2RTC_URL go2rtc URL (camera streams) — leave empty if not using cameras http://homeassistant.local:1984

Read the full file on GitHub · 301 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. 5d ago First seen · 301 lines · 65 tokens per session scan E 37e8fc6034b2

Subscribe to this mod's changes

setup-infrastructure is a skill published in the GitHub repository dcb/homeassistant-claude-kit (119 stars, last pushed 7d ago), licensed MIT. It adds 65 tokens to every session and 3,219 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it E with 4 findings (reaches for credential files, downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.