cloudflare-durable-objects:optimize

cloudflare-durable-objects:optimize is a command for coding agents from secondsky/claude-skills. It costs 32 tokens per session (4,137 once invoked), scanned A, original, MIT.

An interactive assistant that examines existing Cloudflare Durable Objects code and suggests targeted performance changes. It can produce revised code based on the performance issue being investigated.

In plain words
What is it for?
Use it to review a Durable Objects implementation and improve initialization, database queries, memory use, WebSocket responsiveness, or alarm execution.
Why use it?
It helps locate likely bottlenecks instead of guessing at changes. It focuses on problems such as slow startup, slow SQL queries, high memory use, WebSocket delay, or alarm failures.

Command

Part of the cloudflare-durable-objects plugin — 1 skill, 5 commands, 3 agents shipped together

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 commands/secondsky/claude-skills/do-optimize
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Or install cloudflare-durable-objects, the plugin that ships this one along with the rest of its 1 skill, 5 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 cloudflare-durable-objects:optimize

README.md
[![agentmods](https://agentmods.dev/badge/commands/secondsky/claude-skills/do-optimize.svg)](https://agentmods.dev/commands/secondsky/claude-skills/do-optimize)
Your own site
<a href="https://agentmods.dev/commands/secondsky/claude-skills/do-optimize"><img src="https://agentmods.dev/badge/commands/secondsky/claude-skills/do-optimize.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,137 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00032 $0.04137
Opus 5 $0.00016 $0.02069
Sonnet 5 $0.00006 $0.00827
Haiku 4.5 $0.00003 $0.00414

Measured yesterday against content hash fa78830504fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cloudflare-durable-objects: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.

plugins/cloudflare-durable-objects/commands/do-optimize.md · 647 lines

How it starts

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

/do-optimize - Performance Optimization Assistant

Interactive assistant that analyzes your Durable Objects code and provides targeted performance optimizations.

Overview

This command:

  1. Analyzes existing DO implementations
  2. Identifies performance bottlenecks
  3. Provides specific optimization recommendations
  4. Generates optimized code
  5. Measures potential performance improvements

Step 1: Identify Optimization Area

Use AskUserQuestion tool:

Question 1: Performance Issue

header: "Issue Type" question: "What performance issue are you experiencing?" multiSelect: false options:

  • label: "Slow cold starts / initialization" description: "DO takes too long to start up or respond to first request"
  • label: "Slow query performance" description: "SQL queries are taking too long"
  • label: "High memory usage" description: "DO is using too much memory or hitting limits"
  • label: "WebSocket latency" description: "WebSocket messages have high latency or dropped connections"
  • label: "Alarm execution issues" description: "Alarms are slow, failing, or not executing"
  • label: "General optimization" description: "Want to improve overall performance"

Question 2: Current Scale

header: "Scale" question: "What is your current scale?" multiSelect: false options:

  • label: "Development / Testing" description: "Local testing, small dataset"
  • label: "Small production (<1K DOs)" description: "Early production, limited users"
  • label: "Medium production (1K-100K DOs)" description: "Growing user base"
  • label: "Large production (>100K DOs)" description: "High traffic, many active instances"

Question 3: Optimization Priority

header: "Priority" question: "What is most important to optimize?" multiSelect: false options:

  • label: "Latency (response time)" description: "Reduce time to first response"
  • label: "Throughput (requests/second)" description: "Handle more concurrent requests"
  • label: "Cost (compute time)" description: "Reduce CPU time and costs"
  • label: "Memory efficiency" description: "Reduce memory usage"

Read the full file on GitHub · 647 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. yesterday First seen · 647 lines · 32 tokens per session scan A fa78830504fc

Subscribe to this mod's changes

cloudflare-durable-objects:optimize is a command published in the GitHub repository secondsky/claude-skills (214 stars, last pushed yesterday), licensed MIT. It adds 32 tokens to every session and 4,137 once invoked, about $0.0002 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.