hcloud-cleanup

hcloud-cleanup is a command for Claude Code from danjdewhurst/hcloud-skills. It costs 18 tokens per session (400 once invoked), scanned A, original, MIT.

A guide for finding potentially unused Hetzner Cloud resources, such as unattached volumes, unassigned IP addresses, powered-off servers, empty networks, unused SSH keys, and old snapshots.

In plain words
What is it for?
Use it to scan the active project, review categorized cleanup candidates, and decide which resources to remove.
Why use it?
It helps reveal resources that may still incur costs or add clutter after they are no longer needed.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the hcloud plugin — 7 skills, 3 commands, 1 hook shipped together

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 commands/danjdewhurst/hcloud-skills/hcloud-cleanup
Clone the repo
git clone --depth 1 https://github.com/danjdewhurst/hcloud-skills

Made for: Claude Code.

Or install hcloud, the plugin that ships this one along with the rest of its 7 skills, 3 commands, 1 hook.

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 hcloud-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/commands/danjdewhurst/hcloud-skills/hcloud-cleanup.svg)](https://agentmods.dev/commands/danjdewhurst/hcloud-skills/hcloud-cleanup)
Your own site
<a href="https://agentmods.dev/commands/danjdewhurst/hcloud-skills/hcloud-cleanup"><img src="https://agentmods.dev/badge/commands/danjdewhurst/hcloud-skills/hcloud-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 400 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.1 $0.00018 $0.00400
Opus 5 $0.00009 $0.00200
Sonnet 5 $0.00004 $0.00080
Haiku 4.5 $0.00002 $0.00040

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

Security

Grade A, and why

hcloud-cleanup 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 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.

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.

commands/hcloud-cleanup.md · 35 lines

What it actually says

Scan for unused or orphaned resources and help clean them up.

Steps

  1. Show context: Run hcloud context active to confirm scope.

  2. Scan for unused resources by running these commands:

    a. Unattached volumes: Run hcloud volume list -o json and filter for volumes where server is null/empty.

    b. Unassigned floating IPs: Run hcloud floating-ip list -o json and filter for IPs where server is null/empty.

    c. Unassigned primary IPs: Run hcloud primary-ip list -o json and filter for IPs where assignee is null/empty.

    d. Powered-off servers: Run hcloud server list --status off to find servers that may be forgotten.

    e. Empty networks: Run hcloud network list -o json and filter for networks with no servers attached.

    f. Unused SSH keys: Run hcloud ssh-key list and note any that may not be in use (can't be determined automatically, but list them for review).

    g. Orphaned snapshots: Run hcloud image list --type snapshot to review old snapshots.

  3. Present findings: Show a categorized summary of potentially unused resources with their details (name, ID, age, size where applicable).

  4. Clean up: For each category with findings, ask if the user wants to delete them. Process deletions one category at a time, confirming before each batch.

  5. Summary: Show what was cleaned up and what remains.

Important: Always check for protection before attempting deletion. If a resource has protection enabled, note this and skip it unless the user explicitly asks to remove protection first.

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 · 35 lines · 18 tokens per session scan A 3d81a7fc016b

Subscribe to this mod's changes

hcloud-cleanup is a command published in the GitHub repository danjdewhurst/hcloud-skills (3 stars, last pushed 6mo ago), licensed MIT. It adds 18 tokens to every session and 400 once invoked, about $0.0001 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-31.