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.
npx agentmods add commands/secondsky/claude-skills/workers-optimizegit clone --depth 1 https://github.com/secondsky/claude-skillsWrote 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.
[](https://agentmods.dev/commands/secondsky/claude-skills/workers-optimize)<a href="https://agentmods.dev/commands/secondsky/claude-skills/workers-optimize"><img src="https://agentmods.dev/badge/commands/secondsky/claude-skills/workers-optimize.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00029 | $0.02793 |
| Opus 5 | $0.00015 | $0.01396 |
| Sonnet 5 | $0.00006 | $0.00559 |
| Haiku 4.5 | $0.00003 | $0.00279 |
Grade A, and why
cloudflare-workers:optimize 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 455 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Workers Optimize Command
Comprehensive performance analysis and optimization for Cloudflare Workers.
Execution Workflow
Phase 1: Analysis Scope Determination
If --target argument provided:
- Focus analysis on specified area (bundle, memory, or cache)
- Skip other analyses for faster results
If no --target argument:
- Run complete performance audit
- Analyze all optimization areas
Phase 2: Bundle Size Analysis
Analyze Worker bundle size and identify bloat:
- Build Worker and check output size:
bunx wrangler deploy --dry-run --outdir=.wrangler-output
du -h .wrangler-output/
-
Parse bundle size:
- Extract total bundle size in KB
- Compare against limits:
- Free tier: 1MB limit
- Paid tier: 10MB limit
- Flag if >50% of limit used
-
Identify large dependencies:
# Analyze package.json dependencies
grep -A 100 '"dependencies"' package.json
Common bloat sources:
moment.js(large, usedate-fnsinstead)lodash(uselodash-esfor tree-shaking)axios(use nativefetch)- Large UI libraries in backend code
- Check for unnecessary imports:
- Grep for wildcard imports:
import * as - Check for unused imports in main worker file
- Look for dev dependencies in production bundle
- Grep for wildcard imports:
Findings:
### Bundle Size Analysis
**Current Size**: X KB / Y MB limit (Z% used)
**Large Dependencies**:
1. [package-name]: X KB
2. [package-name]: X KB
**Recommendations**:
- Remove [package] (unused in production)
- Replace [package] with [lighter alternative]
- Use dynamic imports for [feature]
Phase 3: Caching Analysis
Analyze Cache API usage and opportunities:
- Check for Cache API usage:
grep -r "caches.open" src/
grep -r "cache.match" src/
grep -r "cache.put" src/
-
Identify cacheable endpoints:
- Look for GET routes
- Check for static responses
- Find repeated external API calls
-
Check cache headers:
grep -r "Cache-Control" src/
grep -r "max-age" src/
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.
- yesterday First seen · 455 lines · 29 tokens per session scan A c317b3cba1f5
cloudflare-workers:optimize is a command published in the GitHub repository secondsky/claude-skills (214 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 2,793 once invoked, about $0.0001 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-09-03.
Other commands, from other repositories
correlate
Find related failures through pattern matching.
diff
Compare two command outputs with intelligent diff.
open
Open/retrieve an offloaded output by ID or shortcut.
search
Search through offloaded outputs with hard caps.
stats
Show FewWord session statistics with rich output and token savings.
timeline
Visual timeline of command outputs in current session.