| name | host-di[REDACTED_OPENAI_KEY] |
| description | Alert when the Mac runner host's free disk drops below 50GB, auto-clean safe targets (evidence bundles, scratchpads, merged-PR worktrees) below 20GB. Closes the gap where mac-runner-di[REDACTED_OPENAI_KEY] (retired) and ezgha's own docker-daemon-view disk floor only ever saw CONTAINER-side disk, never true HOST free space. Use when user says "check host disk", "disk guardian stuck", or after a low-disk incident on the MacBook runner host. |
| type | skill |
| scope | repo |
| owner | $USER |
| version | 1.0.0 |
| triggers | ["host disk low","check host free space","clean up evidence bundles"] |
| allowed-tools | ["Bash","Read"] |
| context | ["Provenance: 2026-07-03 incident (bead rev-g5bwl) — host disk hit 100% (285MB free/926GB) mid runner-fleet recovery, corrupting colima's containerd content store (blob I/O errors) and nearly re-crashing the fleet.","This is independent of ezgha's own disk floor check (ez-gh-actions src/docker_backend.rs, min_free_disk_gb): that check measures disk 'as seen by the docker daemon' and only gates new container spawns. It does not see or clean host-side, non-docker files — the actual root cause of the 2026-07-03 incident.","Two tiers: WARN (<50GB) and CRITICAL (<20GB, auto-clean runs). Both tiers post a Slack alert by reading ezgha's already-configured webhook from ~/.config/ezgha/config.toml at runtime (rev-a6pww) -- never hardcoded, degrades to a log-only line if the config/field/curl call is missing or fails. Auto-clean targets, safest-first: evidence bundles under /tmp/your-project.com/* older than 2 days, scratchpads under /private/tmp/claude-501/* older than 3 days, then merged-PR agent worktrees under /private/tmp/wa-*.","Worktree cleanup is the highest-risk target and has four independent safety gates: (1) the worktree's own `origin` remote must actually be $GITHUB_REPOSITORY, never trusted by branch-name alone; (2) the branch must have a CONFIRMED merged PR via `gh pr list --state merged` whose headRefOid matches the worktree's current HEAD exactly, never inferred from name/age or a reused/rebased branch; (3) zero uncommitted changes (git status --porcelain empty); (4) `git worktree remove` is called WITHOUT --force, so git's own refusal is the real backstop.","Mac-host-scoped only (uses macOS-specific `df -g`). The Linux fleet (jeff-ubuntu) has its own separate hardening tracked under bead rev-runn001, not this skill."] |
/host-di[REDACTED_OPENAI_KEY] — Mac runner host free-space alert + auto-clean
The problem it solves
mac-runner-di[REDACTED_OPENAI_KEY] (retired along with self-hosted-oss) and ezgha's
own disk floor check (docker_backend.rs, min_free_disk_gb) both only ever
see disk space from inside the container/docker-daemon view. Neither one sees
or cleans host-side files that don't belong to a container: evidence bundles
under /tmp/your-project.com/*, Claude scratchpads under
/private/tmp/claude-501/*, and stray git worktrees left behind after a PR
merges. On 2026-07-03, exactly this kind of host-side accumulation drove free
disk to 285MB/926GB, corrupting colima's containerd content store mid-recovery.
Usage
bash .claude/skills/host-di[REDACTED_OPENAI_KEY]/scripts/host-di[REDACTED_OPENAI_KEY]
bash .claude/skills/host-di[REDACTED_OPENAI_KEY]/scripts/host-di[REDACTED_OPENAI_KEY] --dry-run
Thresholds
| Tier | Free disk | Action |
|---|
| Healthy | >= 50GB | log only, exit 0 |
| Warn | 20-50GB | log ALERT + Slack alert, exit 1, no cleanup |
| Critical | < 20GB | log CRITICAL + Slack alert, run auto-clean, exit 2 |
Override via HOST_DISK_GUARDIAN_WARN_GB / HOST_DISK_GUARDIAN_CRITICAL_GB. Slack alert reads
slack_webhook_url from ~/.config/ezgha/config.toml at runtime (override via
HOST_DISK_GUARDIAN_EZGHA_CONFIG) -- never hardcoded, never git-tracked. Missing config, missing
field, or a failed curl all degrade to a log line; the di[REDACTED_OPENAI_KEY]/auto-clean logic never
depends on the alert channel succeeding.
Auto-clean targets (critical tier only), in order
- Evidence bundles:
/tmp/your-project.com/* older than 2 days.
- Scratchpads:
/private/tmp/claude-501/* older than 3 days.
- Merged-PR worktrees:
/private/tmp/wa-* whose branch has a confirmed
merged PR and zero uncommitted changes. Anything ambiguous (dirty
worktree, unmerged branch, unreadable branch) is skipped and logged, never
force-deleted.