cloudflare-workers-local-dev

cloudflare-workers-local-dev is a skill for Claude Code, Codex from humanerd-drew/opencode-drewgent. It costs 37 tokens per session (8,612 once invoked), scanned D, original, MIT.

A practical guide to developing Cloudflare Workers locally, including D1 databases, static assets, and integrations with multiple data sources. Cloudflare Workers is a platform for running server-side JavaScript or TypeScript at Cloudflare.

In plain words
What is it for?
Use it to inspect and refactor Workers projects, troubleshoot local D1 and Wrangler issues, test endpoints, and compare working copies with older versions.
Why use it?
It helps avoid common local-development mistakes, such as incomplete dependency checks, incorrect API assumptions, and database lock problems.

Skill for Claude CodeCodex

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 skills/humanerd-drew/opencode-drewgent/cloudflare-workers-local-dev
Any agent
npx skills add humanerd-drew/opencode-drewgent --skill cloudflare-workers-local-dev
Clone the repo
git clone --depth 1 https://github.com/humanerd-drew/opencode-drewgent

Made for: Claude Code, Codex.

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-workers-local-dev

README.md
[![agentmods](https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/cloudflare-workers-local-dev.svg)](https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/cloudflare-workers-local-dev)
Your own site
<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/cloudflare-workers-local-dev"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/cloudflare-workers-local-dev.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,612 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 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.00037 $0.08612
Opus 5 $0.00018 $0.04306
Sonnet 5 $0.00007 $0.01722
Haiku 4.5 $0.00004 $0.00861

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

Security

Grade D, and why

cloudflare-workers-local-dev scanned grade D with 3 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 3d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/import-db.cjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

3. **Verify** with `curl -X POST http://localhost:8788/api/my-path/test -H "Content-Type: application/json" -d '{}'`. A 401 (Unauthorized) means the route is live — the auth check inside the handler is working. A 404 mea

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf .wrangler/state/v3/

Makes network callslowCapability

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

- Check the ACTUAL running system (curl the endpoints, read the files) before asserting connections
skills/cloudflare-workers-local-dev/SKILL.md · 593 lines

How it starts

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

Cloudflare Workers Local Development

Patterns and pitfalls for local Cloudflare Workers development with D1, static assets, and multi-source integrations.

Core Principles

Understand the system before touching code

  • Map the complete dependency graph first: which files import what, what data flows where, what's dead code
  • Check the ACTUAL running system (curl the endpoints, read the files) before asserting connections
  • Look for pre-existing architecture documents (ARCHITECTURE.md, README.md) before refactoring
  • Compare original/NAS versions with working copies to find divergence points

Never reimplement what the external API already provides

  • When an external API returns computed data, use it — don't recalculate
  • Only compute what the external API doesn't provide
  • Check the ACTUAL API response structure before coding against assumptions

D1 Local Development

SQLITE_BUSY error

Cause: Another wrangler dev instance holds a lock, or a stale .sqlite-lock file from a previous crash. Lock files exist in multiple locations (D1 metadata, Cache metadata), not just the D1 data directory.

Critical pitfall — pkill -f 'wrangler' does NOT kill the child workerd: wrangler dev spawns a child workerd process that holds the SQLite file handle. pkill -f 'wrangler' only matches the parent wrangler.js node process, so the child workerd keeps running and keeps the DB locked. A dev:clean script that only pkill's wrangler is structurally broken — it WILL hit SQLITE_BUSY on the next start. Always match workerd too, and force-kill (-9) so the lock releases immediately:

pkill -9 -f 'wrangler' 2>/dev/null
pkill -9 -f 'workerd'  2>/dev/null
# also clear the port in case a stale process is bound:
lsof -ti:8787 2>/dev/null | xargs -r kill -9 2>/dev/null

### SQLITE_BUSY error
Cause: Another `wrangler dev` instance holds a lock, or a stale `.sqlite-lock` file from a previous crash. Lock files exist in multiple locations (D1 metadata, Cache metadata), not just the D1 data directory.

**Diagnose before fixing** — orphan `workerd` processes are the most common root cause and easy to miss:
```bash

Read the full file on GitHub · 593 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 593 lines · 37 tokens per session scan D af72018ae99e

Subscribe to this mod's changes

cloudflare-workers-local-dev is a skill published in the GitHub repository humanerd-drew/opencode-drewgent (2 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 8,612 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it D with 3 findings (sends data to an external url, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

cloudflare

Use when working on Cloudflare's edge platform — wrangler.jsonc bindings, choosing between D1/KV/R2/Durable Objects/Queues, deploying a Worker or SPA via Static Assets, or designing around a Workers runtime limit. NOT generic CI/release (that is deployment), NOT Next.js framework wiring (that is nextjs), NOT DNS…

ericrisco/rsc-harness · 86 tokens

Cloudflare Workers & Edge AI Development

Build ultra-low-latency edge computing applications with Cloudflare Workers, Workers AI for LLM inference, V8 isolates, Durable Objects, and serverless patterns deployed across 330+ data centers worldwide.

bobmatnyc/mcp-skillset · 48 tokens

cloudflare-workers-debugging

Use when wrangler deploys silently fail or produce wrong artifacts, secrets upload as empty strings, custom domain DNS is not resolving, route assignment broke after rename, observability/tail logs are needed, D1/KV/R2 bindings are missing, OAuth scope errors block a command, cookies on a redirect are not attaching…

curiositech/windags-skills · 162 tokens

wrangler

Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over…

cloudflare/skills · 75 tokens

cloudflare-one-migrations

Plans migrations from Zscaler ZIA/ZPA, Palo Alto, legacy VPN, SWG, or SASE stacks to Cloudflare One. Use for migration assessments, policy mapping, rollout plans, and parity/gap analysis.

cloudflare/skills · 52 tokens

agents-sdk

Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, chat applications, voice agents, or browser automation. Covers Agent class, state management, callable RPC, Workflows, durable execution, queues…

cloudflare/skills · 87 tokens