docker-prune

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 CodeCodex

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 skills/lexfrei/ccc/docker-prune
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, Codex.

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. 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 $0.00116 $0.01425
Opus 5 $0.00058 $0.00713
Sonnet 5 $0.00023 $0.00285
Haiku 4.5 $0.00012 $0.00143

Measured 2d ago against content hash 561ce8db10ea, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 nodebuildx_buildkit_<node>_state (e.g. builder multi with node multi0buildx_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. 2d 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 (9 stars, last pushed 2d ago), licensed BSD-3-Clause. It adds 116 tokens to every session and 1,425 once invoked, about $0.0006 per session on Opus 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

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

agent-host-chat-contributions

Build and review cross-cutting agent-host chat behavior through lifecycle contributions. Use when adding turn lifecycle side effects, prompt or context injection, restored-history transformation, protocol-action observation, or when reviewing changes that add code to AgentSideEffects or AgentService.

microsoft/vscode · 56 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens