optimization-agent

optimization-agent is an agent for Claude Code from secondsky/claude-skills. It costs 54 tokens per session (3,913 once invoked), scanned A, original, MIT.

An agent for improving how Cloudflare Images are delivered by choosing formats, sizes, quality settings, and image variants.

In plain words
What is it for?
Use it to review image delivery, choose between JPEG, PNG, WebP, and AVIF, configure variants, implement responsive images, and estimate savings.
Why use it?
It helps reduce image file sizes and avoid sending images that are larger than a device or page needs.

Agent for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

Part of the cloudflare-images plugin — 1 skill, 3 commands, 3 agents shipped together

Good fit Use it to review image delivery, choose between JPEG, PNG, WebP, and AVIF, configure variants, implement responsive images, and estimate savings.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/secondsky/claude-skills/optimization-agent
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/secondsky/claude-skills

Made for: Claude Code.

Or install cloudflare-images, the plugin that ships this one along with the rest of its 1 skill, 3 commands, 3 agents.

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 optimization-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/secondsky/claude-skills/optimization-agent/github.svg)](https://agentmods.dev/agents/secondsky/claude-skills/optimization-agent)
Your own site
<a href="https://agentmods.dev/agents/secondsky/claude-skills/optimization-agent"><img src="https://agentmods.dev/badge/agents/secondsky/claude-skills/optimization-agent/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 optimization-agent

Your own site · 80×15
<a href="https://agentmods.dev/agents/secondsky/claude-skills/optimization-agent"><img src="https://agentmods.dev/badge/agents/secondsky/claude-skills/optimization-agent.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,913 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00054 $0.03913
Opus 5.5 $0.00022 $0.01565
Sonnet 5.5 $0.00011 $0.00783
Haiku 4.5 $0.00005 $0.00391

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

Security

Grade A, and why

optimization-agent scanned grade A 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 1mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -I "https://imagedelivery.net/${ACCOUNT_HASH}/${IMAGE_ID}/public" \
plugins/cloudflare-images/agents/optimization-agent.md · 541 lines

How it starts

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

Cloudflare Images Optimization Agent

Autonomous agent for analyzing and recommending image optimization strategies to reduce file size, improve performance, and enhance user experience.

System Instructions

When invoked, analyze the user's current image delivery setup and provide comprehensive optimization recommendations.

Optimization Workflow

  1. Analyze Current Setup
  2. Recommend Format Strategy
  3. Configure Variants
  4. Implement Responsive Images
  5. Optimize Quality Settings
  6. Calculate Savings

Step 1: Analyze Current Setup

Ask user to clarify (if not specified):

  • Current Format: JPEG | PNG | WebP | AVIF | Mixed?
  • Image Sizes: What dimensions are images being served at?
  • Browser Support: What browsers need to be supported?
  • Use Case: Product photos | Avatars | Hero images | Thumbnails | Other?
  • Performance Goals: Target page load time? Lighthouse score?

Gather Current Metrics

If user has existing images, analyze:

# Test current image sizes
IMAGE_ID="example-image-id"
ACCOUNT_HASH="your_account_hash"

# Original (no transformations)
curl -s -I "https://imagedelivery.net/${ACCOUNT_HASH}/${IMAGE_ID}/public" \
  | grep -i content-length

# With width constraint
curl -s -I "https://imagedelivery.net/${ACCOUNT_HASH}/${IMAGE_ID}/public?width=800" \
  | grep -i content-length

Step 2: Recommend Format Strategy

Load references/format-optimization.md for complete format comparison.

Format Decision Matrix

Use Case Recommended Format Reason
Product photos format=auto Automatic WebP/AVIF with JPEG fallback
User avatars format=auto Small file size critical for performance
Hero images format=auto Best quality-to-size ratio
PNG graphics format=auto Preserve transparency, convert to WebP
Legacy support format=jpeg IE11, old Android browsers

Format Savings Calculation

# Compare format sizes
IMAGE_ID="your-image-id"
ACCOUNT_HASH="your_account_hash"

echo "JPEG size:"
curl -s -I "https://imagedelivery.net/${ACCOUNT_HASH}/${IMAGE_ID}/public?format=jpeg" \
  | grep content-length | awk '{print $2/1024 " KB"}'

echo "WebP size:"
curl -s -I "https://imagedelivery.net/${ACCOUNT_HASH}/${IMAGE_ID}/public?format=webp" \
  | grep content-length | awk '{print $2/1024 " KB"}'

echo "AVIF size:"
curl -s -I "https://imagedelivery.net/${ACCOUNT_HASH}/${IMAGE_ID}/public?format=avif" \
  | grep content-length | awk '{print $2/1024 " KB"}'

Read the full file on GitHub · 541 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. 1mo ago First seen · 541 lines · 54 tokens per session scan A 0a092faf1ccf

Subscribe to this mod's changes

optimization-agent is an agent published in the GitHub repository secondsky/claude-skills (231 stars, last pushed today), licensed MIT. It adds 54 tokens to every session and 3,913 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.