ha-git-backup

ha-git-backup is a skill for Claude Code, Codex from NickoScope/nickol-knx-mcp. It costs 187 tokens per session (1,772 once invoked), scanned A, original, MIT.

A two-part backup and synchronisation system for Home Assistant, the home-automation platform. It keeps configuration history in a private GitHub repository and stores encrypted full backups in GitHub Releases.

In plain words
What is it for?
It is for backing up Home Assistant configuration, recording changes, protecting secrets, creating encrypted recovery archives, rotating backups, and testing restoration.
Why use it?
It separates tracking configuration changes from recovering the complete system, including data that ordinary Git history may not contain.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for backing up Home Assistant configuration, recording changes, protecting secrets, creating encrypted recovery archives, rotating backups, and testing restoration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nickoscope/nickol-knx-mcp/ha-git-backup
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.

Any agent
npx skills add NickoScope/nickol-knx-mcp --skill ha-git-backup
Clone the repo
git clone --depth 1 https://github.com/NickoScope/nickol-knx-mcp

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 ha-git-backup

README.md
[![agentmods](https://agentmods.dev/badge/skills/nickoscope/nickol-knx-mcp/ha-git-backup/github.svg)](https://agentmods.dev/skills/nickoscope/nickol-knx-mcp/ha-git-backup)
Your own site
<a href="https://agentmods.dev/skills/nickoscope/nickol-knx-mcp/ha-git-backup"><img src="https://agentmods.dev/badge/skills/nickoscope/nickol-knx-mcp/ha-git-backup/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-git-backup

Your own site · 80×15
<a href="https://agentmods.dev/skills/nickoscope/nickol-knx-mcp/ha-git-backup"><img src="https://agentmods.dev/badge/skills/nickoscope/nickol-knx-mcp/ha-git-backup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 187 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,772 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 10
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Tool Misuse · line 70
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.00187 $0.01772
Opus 5 $0.00093 $0.00886
Sonnet 5 $0.00037 $0.00354
Haiku 4.5 $0.00019 $0.00177

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

Security

Grade A, and why

ha-git-backup 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.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/backup_offsite.sh, scripts/ha_git_sync.sh, scripts/install.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/ha-git-backup/SKILL.md · 111 lines

How it starts

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

HA Git Backup — a two-circuit system

Philosophy: git gives you history, a backup gives you recovery. These are different jobs — different circuits solve them. Projects like GithubConfigSync mix the two and implement git on top of the Contents API — we use real git.

Architecture

CIRCUIT 1: CONFIG HISTORY (what changed and when)
/config (git repo) ──deploy key──▶ GitHub private repo (ha-config)
  ├── triggers: daily 03:30 / pre-update / button / HA restart
  ├── secret protection: .gitignore → pre-commit scan → age mirror
  └── commit: "[trigger] N files | HA 2026.7.1" + file list

CIRCUIT 2: RECOVERY (full state, including .storage)
HA native backup (.tar) ──age──▶ GitHub Releases (ha-config)
  ├── schedule: weekly + before updates
  ├── rotation: 8 releases
  └── restore drill: 1st of the month (mandatory)

The 3-2-1 rule: the config lives (1) on the HA host, (2) in the GitHub git repo, (3) as a full tarball in Releases — plus a local NAS copy if you have one.

IRON RULES

  1. Deploy key, not a PAT. Fine-grained WRITE access to ONE repository. A classic token with the repo scope = access to all your private repos → forbidden.
  2. A secret in the diff blocks the commit. The pre-commit hook runs secret_scan.sh. Bypassing with --no-verify — only deliberately, with the reason logged.
  3. .storage/ does NOT go to git (auth, tokens), except the lovelace* whitelist — dashboards. The full .storage lives only in the encrypted Circuit-2 tarball.
  4. A backup without a restore drill is not a backup. Monthly: download the release → age -dtar -t → verify .storage/core.config_entries is inside.
  5. Do not rewrite the scripts from scratch. The logic (lock, retry, notify, rotation) is already in scripts/ — read and use them.

Quick start (fresh install)

  1. Create an empty private repo ha-config on GitHub.
  2. Read references/setup.md — step by step: deploy key, install via the SSH add-on.
  3. Run scripts/install.sh inside HA — it does git init, .gitignore, hook, remote, first dry-run.
  4. Add the contents of assets/configuration_snippet.yaml to configuration.yaml and assets/automations.yaml to your automations. A full HA restart is required (shell_command and command_line are NOT loaded by a quick reload).
  5. Circuit 2: scripts/backup_offsite.sh needs a fine-grained PAT + an age key. See references/setup.md §4.
  6. Run the first restore drill IMMEDIATELY — before the system is ever needed.

Read the full file on GitHub · 111 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 · 111 lines · 187 tokens per session scan A f31df7170269

Subscribe to this mod's changes

ha-git-backup is a skill published in the GitHub repository NickoScope/nickol-knx-mcp (23 stars, last pushed today), licensed MIT. It adds 187 tokens to every session and 1,772 once invoked, about $0.0009 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.