dockerfile-optimizer

dockerfile-optimizer is an agent for Claude Code from Sagargupta16/claude-skills. It costs 103 tokens per session (363 once invoked), scanned A, original, MIT.

An agent that reviews Dockerfiles and Docker Compose files, which define container images and multi-container setups, for ways to reduce image size, build time, and security risks.

In plain words
What is it for?
Use it to inspect base images, build stages, layer caching, copied files, dependency handling, root users, version pinning, and possible secrets before producing an improved Dockerfile when needed.
Why use it?
It finds common causes of bloated images, slow rebuilds, and unsafe containers, then explains what to change.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the docker-deploy plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to inspect base images, build stages, layer caching, copied files…

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/sagargupta16/claude-skills/dockerfile-optimizer
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.

Clone the repo
git clone --depth 1 https://github.com/Sagargupta16/claude-skills

Made for: Claude Code.

Or install docker-deploy, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

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 dockerfile-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/sagargupta16/claude-skills/dockerfile-optimizer.svg)](https://agentmods.dev/agents/sagargupta16/claude-skills/dockerfile-optimizer)
Your own site
<a href="https://agentmods.dev/agents/sagargupta16/claude-skills/dockerfile-optimizer"><img src="https://agentmods.dev/badge/agents/sagargupta16/claude-skills/dockerfile-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 103 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 363 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.00103 $0.00363
Opus 5 $0.00051 $0.00181
Sonnet 5 $0.00021 $0.00073
Haiku 4.5 $0.00010 $0.00036

Measured 6d ago against content hash 445a5a638dd4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

dockerfile-optimizer 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 6d 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.

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.

plugins/docker-deploy/agents/dockerfile-optimizer.md · 36 lines

What it actually says

You are a Docker optimization specialist. Analyze Dockerfiles for size, speed, and security.

Steps

  1. Read Dockerfile(s) and any docker-compose files in the project
  2. Check image size factors:
    • Base image choice (alpine vs debian vs distroless)
    • Multi-stage build usage
    • Layer count and ordering
    • Unnecessary files copied into image
    • Dev dependencies in production image
  3. Check build speed:
    • Layer caching order (dependencies before source code)
    • .dockerignore coverage
    • Unnecessary cache busting
  4. Check security:
    • Running as root (should use non-root user)
    • Pinned base image versions (not latest)
    • No secrets in build args or layers
    • Minimal attack surface (no dev tools in prod)
  5. Propose optimizations with before/after size estimates

Output Format

Issue Impact Fix
Description Size/Speed/Security What to change

Provide the optimized Dockerfile if changes are significant.

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. 6d ago First seen · 36 lines · 103 tokens per session scan A 445a5a638dd4

Subscribe to this mod's changes

dockerfile-optimizer is an agent published in the GitHub repository Sagargupta16/claude-skills (5 stars, last pushed today), licensed MIT. It adds 103 tokens to every session and 363 once invoked, about $0.0005 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.

Related

Other agents, from other repositories

workflow-orchestrator

Coordinates development workflows and orchestrates base plugin operations including git workflows, quality checks, and productivity automation.

shrwnsan/vibekit-claude-plugins · 24 tokens

search-plus

Enhanced web search and content extraction with intelligent multi-service fallback strategy for reliable access to blocked or problematic domains.

shrwnsan/vibekit-claude-plugins · 23 tokens

devops_engineer

DevOps specialist for CI/CD pipelines, containerization, deployment automation, and infrastructure configuration. Use when the task involves build pipeline setup, Docker/Kubernetes configuration, deployment scripting, or monitoring setup. For example: writing a GitHub Actions workflow, creating a Dockerfile, or…

josstei/maestro-orchestrate · 63 tokens

test-generator

Test generator for Shopware 6 tests. Execution environment for test generation skills — do not invoke directly. Skills fork into this agent via context: fork. Does not review tests — use the appropriate reviewer agent for that.

shopwareLabs/ai-coding-tools · 47 tokens

infra-reviewer

Reviews a diff through the INFRA lens only (deploy/rollback safety, CI/CD config, container/IaC least-privilege, secret handling, idempotent provisioning, blast radius). Read-only. Dispatched by /kit:review-team as the infra domain lens when the diff touches deploy or infrastructure.

dwarvesf/dwarves-kit · 67 tokens

code-researcher

Researches a codebase's architecture, data flows, and component relationships and returns synthesized findings with file:line citations. Use proactively for architectural questions, multi-file dependency tracing, impact analysis before a refactoring, and onboarding to unfamiliar code — any wide investigation that…

shopwareLabs/ai-coding-tools · 86 tokens