ha-log-analyzer

ha-log-analyzer is an agent for Claude Code from Benny-Lewis/home-assistant-assistant. It costs 24 tokens per session (952 once invoked), scanned B, original, MPL-2.0.

A troubleshooting agent for Home Assistant, a system for controlling smart-home devices, that examines logs and automation traces.

In plain words
What is it for?
Use it to inspect automation state, retrieve traces, resolve entity IDs, and diagnose problems in Home Assistant automations.
Why use it?
It helps explain why an automation failed and checks the real device or entity identifiers before treating them as mistakes.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the home-assistant-assistant plugin — 15 skills, 6 agents, 3 hooks shipped together

Good fit Use it to inspect automation state, retrieve traces, resolve entity IDs, and diagnose problems in Home Assistant automations.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/benny-lewis/home-assistant-assistant/ha-log-analyzer
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.

Clone the repo
git clone --depth 1 https://github.com/Benny-Lewis/home-assistant-assistant

Made for: Claude Code.

Or install home-assistant-assistant, the plugin that ships this one along with the rest of its 15 skills, 6 agents, 3 hooks.

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 ha-log-analyzer

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/benny-lewis/home-assistant-assistant/ha-log-analyzer"><img src="https://agentmods.dev/badge/agents/benny-lewis/home-assistant-assistant/ha-log-analyzer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 952 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00024 $0.00952
Opus 5 $0.00012 $0.00476
Sonnet 5 $0.00005 $0.00190
Haiku 4.5 $0.00002 $0.00095

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

Security

Grade B, and why

ha-log-analyzer scanned grade B with 1 finding 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 12d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

PLUGIN_ROOT="$(cat .claude/ha-plugin-root.txt 2>/dev/null)"
agents/ha-log-analyzer.md · 130 lines

How it starts

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

Log Analyzer Agent

Warning: Do NOT spawn this agent with run_in_background: true. Background agents silently lose all output (Claude Code #17011). Always use foreground execution.

Analyze Home Assistant logs and automation traces to diagnose issues.

Resolver-First Approach: When you encounter entity-related errors, verify entity IDs exist before assuming typos. Use hass-cli state list to resolve actual entity IDs.

Task

Given a problem description, gather and analyze relevant logs and traces.

Process

1. Resolve Entities First

Before assuming entity IDs are wrong:

# Find actual entity IDs matching description
hass-cli state list | grep -i "motion"
hass-cli state list | grep -i "kitchen"

2. Gather Data

Get automation state

hass-cli state get automation.<name>

Get automation traces (REST /api/trace returns 404; use helper instead)

PLUGIN_ROOT="$(cat .claude/ha-plugin-root.txt 2>/dev/null)"
PY="$(cat .claude/ha-python.txt 2>/dev/null || command -v python3 || command -v python || command -v py)"
$PY "$PLUGIN_ROOT/helpers/trace-fetch.py" list automation.<name>
# Then get full detail: $PY "$PLUGIN_ROOT/helpers/trace-fetch.py" get automation.<name> <run_id>

Get logbook events (causation chain)

MSYS_NO_PATHCONV=1 hass-cli raw get "/api/logbook?entity=automation.<name>"

Get entity history

MSYS_NO_PATHCONV=1 hass-cli raw get "/api/history/period?filter_entity_id=<entity_id>"

Get error logs

MSYS_NO_PATHCONV=1 hass-cli raw get /api/error_log

If this returns 404, try /api/error/all. If that also fails, check for home-assistant.log in the config directory, or note that error logs are unavailable via API.

3. Analyze

Check systematically:

  • Was automation enabled at the time?
  • Did trigger entity reach trigger state?
  • Did conditions evaluate to true?
  • Did actions execute successfully?
  • Any errors in logs related to this automation?

Read the full file on GitHub · 130 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. 12d ago First seen · 130 lines · 24 tokens per session scan B a9bd35a30d4f

Subscribe to this mod's changes

ha-log-analyzer is an agent published in the GitHub repository Benny-Lewis/home-assistant-assistant (57 stars, last pushed 4mo ago), licensed MPL-2.0. It adds 24 tokens to every session and 952 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

network-troubleshooter

Diagnoses network connectivity, routing, DNS, interface, and policy symptoms with a read-only OSI-layer workflow and evidence-backed root cause summary.

affaan-m/ECC · 34 tokens

waveform-analyzer

VCD/FST deep analysis specialist. Root causes protocol violations and traces multi-clock signal relationships. Never modifies RTL or test files.

babyworm/rtl-agent-team · 31 tokens

neuron-nki-debugger-agent

Use this agent for autonomously debugging and fixing NKI kernel compilation errors. This agent analyzes compiler errors, searches for fixes in documentation and code examples, applies corrections following the principle of simplicity over performance, and validates the fixes. Context: User has a kernel with…

aws-neuron/neuron-agentic-development · 239 tokens

tdmcp-implementation-runtime-analyst

Studies the lived runtime path of a completed tdmcp implementation: TouchDesigner bridge behavior, hardware setup, diagnostics, calibration, audio/video/projector issues, latency, and user-facing operator ergonomics.

Pantani/tdmcp · 50 tokens

bringup-debugger

Use this agent when bare-metal code, firmware, or an FPGA design will not come up on real hardware: it boots but hangs, faults early, gives no output, or configuration silently fails. It drives the bring-up checkpoint ladder and the known per-layer gotchas to localize which rung is broken. Dispatch it for "boots in…

Midstall/claude-for-hardware · 80 tokens

bubbaloop-operator

Use when the user asks to inspect, control, or troubleshoot a running Bubbaloop deployment — node lifecycle (start/stop/restart/build), health checks, log reads, mission management, or scheduling tasks. Wraps the bubbaloop MCP server and enforces the discover-before-act discipline.

kornia/bubbaloop · 67 tokens