docker-prune

docker-prune is a skill for Claude Code from lexfrei/ccc. It costs 116 tokens per session (1,425 once invoked), scanned B, original, BSD-3-Clause.

A Docker cleanup tool that finds unused images, containers, networks, build data, and optionally volumes. It can also trim space inside VM-based Docker setups such as Colima or Lima.

In plain words
What is it for?
Use it to inspect and reclaim Docker disk space, including build caches and unused resources. On Colima or Lima, use it to help shrink the host-side virtual disk file.
Why use it?
Docker can leave old files behind and gradually fill the disk. It shows the space that can be recovered first, asks for approval, then reports what it removed.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the cleanup plugin — 6 skills shipped together

Good fit Use it to inspect and reclaim Docker disk space, including build caches and unused resources. On Colima or Lima, use it to help shrink the host-side virtual disk file.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lexfrei/ccc/docker-prune
View source ↗ lexfrei/ccc
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 lexfrei/ccc --skill docker-prune
Clone the repo
git clone --depth 1 https://github.com/lexfrei/ccc

Made for: Claude Code.

Or install cleanup, the plugin that ships this one along with the rest of its 6 skills.

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-prune

README.md
[![agentmods](https://agentmods.dev/badge/skills/lexfrei/ccc/docker-prune/github.svg)](https://agentmods.dev/skills/lexfrei/ccc/docker-prune)
Your own site
<a href="https://agentmods.dev/skills/lexfrei/ccc/docker-prune"><img src="https://agentmods.dev/badge/skills/lexfrei/ccc/docker-prune/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 docker-prune

Your own site · 80×15
<a href="https://agentmods.dev/skills/lexfrei/ccc/docker-prune"><img src="https://agentmods.dev/badge/skills/lexfrei/ccc/docker-prune.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,425 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00116 $0.01425
Opus 5.5 $0.00046 $0.00570
Sonnet 5.5 $0.00023 $0.00285
Haiku 4.5 $0.00012 $0.00143

Measured 3mo ago against content hash 561ce8db10ea, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

docker-prune scanned grade B with 1 finding 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 3mo 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

colima ssh -- sudo fstrim -a -v
skills/cleanup/skills/docker-prune/SKILL.md · 68 lines

How it starts

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

Reclaim Docker disk space, then report what was freed.

Operates in report → confirm → execute order. The scope is chosen through an interactive question, not flags. After approval, run the prune autonomously.

Step 1: Check the daemon

docker info >/dev/null 2>&1

If it fails, the Docker daemon is not reachable. On a Colima/Lima or other VM-backed setup, tell the user how to start it (e.g. colima start) and stop — do not guess.

With the daemon up, record the engine version: docker version --format '{{.Server.Version}}'. It determines volume-prune behavior (see Step 3).

Also note whether the daemon is VM-backed (Colima/Lima, or any setup where the daemon runs inside a VM whose disk is a file on the host — colima status succeeding is the common signal). This enables the trim scope (Steps 2–4).

Step 2: Report reclaimable size

docker system df
docker buildx ls

Show the docker system df breakdown (images, containers, local volumes, build cache) with the reclaimable column.

On a VM-backed daemon, also account for the host-side disk image. Everything docker system df shows lives inside a VM disk that is a sparse file on the host (Colima: ~/.colima/_lima/_disks/<profile>/datadisk). Blocks freed by pruning inside the guest are NOT returned to the host until the guest filesystem issues discards — so the host file's allocated size keeps the high-water mark of every past build. Measure both sides: apparent size (ls -lh <disk>) vs actually allocated (du -sh <disk>), and compare the allocated size with what the guest really uses (colima ssh -- df -h /var/lib/docker). A large gap means the trim scope alone can return that space to the host, even with nothing left to prune. Record the allocated size as the baseline for Step 5.

Critically, account for non-default buildx builders. docker system prune only prunes the build cache of the default builder. A docker-container-driver builder (common with multi-arch / Colima setups) keeps its cache inside an in-use state volume named after the builder's node — buildx_buildkit_<node>_state (e.g. builder multi with node multi0 → buildx_buildkit_multi0_state; a multi-node builder has one such volume per node). That volume shows as active in docker system df, so neither docker system prune nor docker volume prune reclaims it — only docker buildx prune does. This is frequently the single largest reclaimable item. For each non-default builder from docker buildx ls, note its cache (the size of its buildx_buildkit_*_state volume(s) in docker system df -v is a good proxy).

Read the full file on GitHub · 68 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. 3mo ago First seen · 68 lines · 116 tokens per session scan B 561ce8db10ea

Subscribe to this mod's changes

docker-prune is a skill published in the GitHub repository lexfrei/ccc (12 stars, last pushed today), licensed BSD-3-Clause. It adds 116 tokens to every session and 1,425 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

docker-prune compared with skills from other repositories

docker-prune next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
docker-prunelexfrei/cccSkill12todayBSD-3-ClauseB116Claude Code
deploy-docker-composeomnigent-ai/omnigentSkill12ktodayApache-2.0A84Claude Code, Codex
bdd-container-updateNVIDIA-AI-Blueprints/video-search-and-summarizationSkill2.0ktodayApache-2.0A117Cursor
securing-kubernetes-on-cloudxalgorix/xalgorixSkill1.6ktodayApache-2.0A80Claude Code, Codex
detecting-privilege-escalation-in-kubernetes-podsxalgorix/xalgorixSkill1.6ktodayApache-2.0A40Claude Code, Codex
docker-socket-mountPurpleAILAB/DecepticonSkill6.9k14d agoApache-2.0B67Claude Code
managing-astro-local-envastronomer/agentsSkill466yesterdayApache-2.0A63Claude Code