docker-disk-cleanup

docker-disk-cleanup is a skill for Codex from jimtin/production-ai. It costs 74 tokens per session (1,027 once invoked), scanned A, original, MIT.

A cautious tool for reclaiming disk space used by Docker, which runs containers and stores images, build caches, networks, and volumes.

In plain words
What is it for?
Use it to audit or safely clean Docker disk usage, including unused containers, networks, images, build cache, and dangling volumes.
Why use it?
It identifies unused Docker data while protecting active services and project data from unsafe cleanup.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions Codex.

Good fit Use it to audit or safely clean Docker disk usage, including unused containers, networks, images, build cache, and dangling volumes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jimtin/production-ai/docker-disk-cleanup
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 jimtin/production-ai --skill docker-disk-cleanup
Clone the repo
git clone --depth 1 https://github.com/jimtin/production-ai

Made for: 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 docker-disk-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/jimtin/production-ai/docker-disk-cleanup.svg)](https://agentmods.dev/skills/jimtin/production-ai/docker-disk-cleanup)
Your own site
<a href="https://agentmods.dev/skills/jimtin/production-ai/docker-disk-cleanup"><img src="https://agentmods.dev/badge/skills/jimtin/production-ai/docker-disk-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,027 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.
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.00074 $0.01027
Opus 5 $0.00037 $0.00513
Sonnet 5 $0.00015 $0.00205
Haiku 4.5 $0.00007 $0.00103

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

Security

Grade A, and why

docker-disk-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 7d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/docker-disk-cleanup-core.mjs, scripts/docker-disk-cleanup-core.test.mjs, scripts/docker-disk-cleanup.mjs), 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/docker-disk-cleanup/SKILL.md · 109 lines

How it starts

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

Docker Disk Cleanup

Purpose

Use this skill to reclaim Docker disk space without damaging active local services, test databases, or PR-gate runs. Prefer the bundled script over ad hoc prune commands.

Operating Rules

  • Start with an audit: filesystem free space, docker info, docker system df, containers, and volumes.
  • Use scripts/docker-disk-cleanup.mjs; do not hand-roll prune order unless the script is missing or cannot run.
  • Do not use sudo.
  • Do not delete named project volumes manually. Let Docker remove only volumes it reports as dangling, after attachment checks.
  • Do not run overlapping cleanup jobs. The script uses a lock in the report directory.
  • Preserve active services. If gate-like containers are running, or the user says a gate is active, run active-gate mode so image and builder pruning use an age filter.
  • Treat Docker race errors such as containers disappearing between list and prune as recheck-and- continue signals unless the script reports a hard failure.
  • Keep reports sanitized: do not print env values, tokens, auth files, or secret-looking strings.

Quick Start

Run a dry run first:

node ~/.codex/skills/docker-disk-cleanup/scripts/docker-disk-cleanup.mjs audit
node ~/.codex/skills/docker-disk-cleanup/scripts/docker-disk-cleanup.mjs cleanup --dry-run

Run cleanup:

node ~/.codex/skills/docker-disk-cleanup/scripts/docker-disk-cleanup.mjs cleanup

For a known active PR gate or long validation run:

node ~/.codex/skills/docker-disk-cleanup/scripts/docker-disk-cleanup.mjs cleanup --active-gate-mode

When volume risk is unclear:

node ~/.codex/skills/docker-disk-cleanup/scripts/docker-disk-cleanup.mjs cleanup --skip-volumes

Workflow

  1. Confirm the target path. Probe the filesystem that actually holds Docker data or the active workspace. Pass it with --workspace <path> or set DOCKER_DISK_CLEANUP_WORKSPACE. If unsure, use the current working directory and say so.
  2. Audit first. Run audit or cleanup --dry-run. Read docker system df before deciding how aggressive cleanup should be.
  3. Check active work. Inspect running containers and the script's activeGateMode decision. Use --active-gate-mode when a PR gate, test gate, or build is active.
  4. Run serialized cleanup. The script plans commands in this order:
    • docker container prune -f
    • docker network prune -f
    • docker image prune -a ... -f
    • docker builder prune -a ... -f
    • dangling volume attachment checks
    • docker volume prune -a -f when supported, otherwise docker volume prune -f
    • final docker image prune -a ... -f
  5. Report the outcome. Include initial/final disk usage, Docker usage, mode, commands run, report path, removed-space summary when Docker provides one, skipped steps, and blockers.

Read the full file on GitHub · 109 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 109 lines · 74 tokens per session scan A fa4630edff5d

Subscribe to this mod's changes

docker-disk-cleanup is a skill published in the GitHub repository jimtin/production-ai (1 stars, last pushed 2mo ago), licensed MIT. It adds 74 tokens to every session and 1,027 once invoked, about $0.0004 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.