jimtin/production-ai/docker-disk-cleanup
Claude Code and agent skill by jimtin/production-ai
- community
Checking that the SKILL.md file is still in the repository.
Conservative Docker-native disk cleanup for developer machines and local PR-gate hosts. Use when asked to clean Docker disk usage, reclaim Docker image/build-cache/volume space, run daily Docker cleanup, diagnose Docker disk pressure, or safely prune containers, networks, images, BuildKit cache, and unused volumes while preserving active services and gate work.
Install
npx vskill@latest install jimtin/production-ai/docker-disk-cleanupSKILL.md
The same SKILL.md was published earlier as jimtin/production-ai/docker-disk-cleanup.
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:
Run cleanup:
For a known active PR gate or long validation run:
When volume risk is unclear:
Workflow
- 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.
- Audit first. Run
auditorcleanup --dry-run. Readdocker system dfbefore deciding how
aggressive cleanup should be.
- Check active work. Inspect running containers and the script's
activeGateModedecision.
Use --active-gate-mode when a PR gate, test gate, or build is active.
- Run serialized cleanup. The script plans commands in this order:
docker container prune -fdocker network prune -fdocker image prune -a ... -fdocker builder prune -a ... -f- dangling volume attachment checks
docker volume prune -a -fwhen supported, otherwisedocker volume prune -f- final
docker image prune -a ... -f
- 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.
Daily Automation Contract
A daily cleanup automation should run:
Use a report directory under the local agent home, for example:
Schedule dry runs first when moving the automation to a new machine.
Safety Policy
Read references/safety-policy.md before changing cleanup behavior, adding new destructive operations, or adapting the skill to a non-Docker-Desktop host.
The threat model lives in docker-disk-cleanup-threat-model.md; review it before publishing changes to cleanup behavior, report sinks, or scheduler integration.
Completion Blockers
- Cleanup ran without a prior audit or dry-run-level evidence.
- A second cleanup was launched while one was already running.
- Active gate work was detected but broad image/build-cache pruning ran without an age filter.
- Volumes were deleted manually by name instead of through Docker's unused-volume prune with
attachment checks.
- The report omits skipped steps, blockers, or whether active-gate mode was used.
- Secret material or local auth paths were printed in a report or chat response.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/docker-disk-cleanup/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jimtin/production-ai/docker-disk-cleanup)