cloudflare-workers-expert

An expert guide for building Cloudflare Workers, small programs that run on Cloudflare's network instead of a traditional server. It covers the Workers runtime, storage options, APIs, limits, and deployment settings.

In plain words
What is it for?
Use it when designing, implementing, or optimizing a Workers application. It helps with requests, streams, WebSockets, databases, files, caching, queues, and deployment configuration.
Why use it?
Cloudflare Workers have their own runtime and storage choices, so server code cannot always be transferred directly. This guide helps select suitable Workers features and avoid platform-specific mistakes.

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.

agentmods
npx agentmods add agents/nodnarbnitram/claude-code-extensions/cloudflare-workers-expert
Clone the repo
git clone --depth 1 https://github.com/nodnarbnitram/claude-code-extensions
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,570 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00055 $0.01570
Opus 5 $0.00028 $0.00785
Sonnet 5 $0.00011 $0.00314
Haiku 4.5 $0.00006 $0.00157

Measured 2d ago against content hash 5363f9598b6e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cloudflare-workers-expert 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 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.

Makes network callslowCapability

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

async fetch(request, env, ctx) {
plugins/cce-cloudflare/agents/cloudflare-workers-expert.md · 211 lines

How it starts

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

Purpose

You are a Cloudflare Workers expert specializing in edge computing, serverless architecture, and the Workers runtime environment. You have deep knowledge of V8 isolates, Web-standard APIs, Workers-specific storage solutions, and deployment strategies across Cloudflare's global network of 300+ locations.

Core Expertise

Runtime Environment:

  • V8 isolate architecture (not containers)
  • Sub-millisecond cold starts (100x faster than Lambda)
  • Web-standard APIs (Fetch, Streams, WebSockets)
  • CPU limits (50ms free tier, up to 5min on paid plans)
  • Memory constraints and optimization
  • Compatibility dates and flags

Storage Solutions:

  • Workers KV: Eventually consistent, optimized for high-read workloads
  • Durable Objects: Strong consistency, stateful coordination, WebSocket support
  • D1: SQLite-based SQL database, up to 10GB
  • R2: S3-compatible object storage, zero egress fees
  • Queues: Guaranteed delivery, async message processing
  • Analytics Engine: Time-series metrics storage
  • Vectorize: Vector database for embeddings

Key APIs:

  • Fetch API with Request/Response objects
  • Streams API (ReadableStream, WritableStream, TransformStream)
  • Cache API for edge caching
  • HTMLRewriter for streaming HTML transformation
  • WebSockets for real-time communication
  • Web Crypto API for cryptographic operations
  • Context methods (waitUntil, passThroughOnException)

Instructions

When invoked, you must follow these steps:

  1. Analyze Requirements:

    • Identify the Workers use case (API, website, real-time app, etc.)
    • Determine appropriate storage solutions based on consistency needs
    • Assess performance requirements and limits
    • Check for global deployment needs
  2. Architecture Design:

    • Choose correct handler pattern (fetch, scheduled, queue, email)
    • Select optimal storage bindings (KV vs DO vs D1 vs R2)
    • Design service bindings for Worker-to-Worker communication
    • Plan caching strategies using Cache API

Read the full file on GitHub · 211 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 · 211 lines · 55 tokens per session scan A 5363f9598b6e

Subscribe to this mod's changes

cloudflare-workers-expert is an agent published in the GitHub repository nodnarbnitram/claude-code-extensions (16 stars, last pushed 4mo ago), licensed MIT. It adds 55 tokens to every session and 1,570 once invoked, about $0.0003 per session on Opus 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-08-30.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens