cloudflare-queues

cloudflare-queues is a skill for Claude Code from secondsky/claude-skills. It costs 78 tokens per session (3,863 once invoked), scanned A, original, MIT.

A setup guide for Cloudflare Queues, which hold messages so background work can be processed separately from a request.

In plain words
What is it for?
It helps create queues, configure message producers and consumers, add retry handling and dead-letter queues, and write example Worker code.
Why use it?
It removes the guesswork from creating queues and connecting the code that sends and processes messages.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit It helps create queues, configure message producers and consumers, add retry handling…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/secondsky/claude-skills/cloudflare-queues
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.

Any agent
npx skills add secondsky/claude-skills --skill cloudflare-queues
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

Or install cloudflare-queues, the plugin that ships this one along with the rest of its 1 skill, 3 commands, 2 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-queues

README.md
[![agentmods](https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-queues.svg)](https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-queues)
Your own site
<a href="https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-queues"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-queues.svg" alt="Measured on agentmods" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,863 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00078 $0.03863
Opus 5 $0.00039 $0.01931
Sonnet 5 $0.00016 $0.00773
Haiku 4.5 $0.00008 $0.00386

Measured 3d ago against content hash 7e70fb23b3fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

cloudflare-queues 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 3d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (templates/queues-consumer-basic.ts, templates/queues-consumer-explicit-ack.ts, templates/queues-dlq-pattern.ts, …), 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.

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-queues/skills/cloudflare-queues/SKILL.md · 519 lines

How it starts

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

Cloudflare Queues

Status: Production Ready ✅ | Last Verified: 2025-12-27

Dependencies: cloudflare-worker-base (for Worker setup)

Contents: Quick StartCritical RulesTop ErrorsUse CasesWhen to Load ReferencesLimits


Quick Start (10 Minutes)

1. Create Queue

bunx wrangler queues create my-queue
bunx wrangler queues list

2. Producer (Send Messages)

wrangler.jsonc:

{
  "name": "my-producer",
  "main": "src/index.ts",
  "queues": {
    "producers": [
      {
        "binding": "MY_QUEUE",
        "queue": "my-queue"
      }
    ]
  }
}

src/index.ts:

import { Hono } from 'hono';

type Bindings = {
  MY_QUEUE: Queue;
};

const app = new Hono<{ Bindings: Bindings }>();

app.post('/send', async (c) => {
  await c.env.MY_QUEUE.send({
    userId: '123',
    action: 'process-order',
    timestamp: Date.now(),
  });

  return c.json({ status: 'queued' });
});

export default app;

3. Consumer (Process Messages)

wrangler.jsonc:

{
  "name": "my-consumer",
  "main": "src/consumer.ts",
  "queues": {
    "consumers": [
      {
        "queue": "my-queue",
        "max_batch_size": 10,
        "max_retries": 3,
        "dead_letter_queue": "my-dlq"
      }
    ]
  }
}

src/consumer.ts:

import type { MessageBatch } from '@cloudflare/workers-types';

export default {
  async queue(batch: MessageBatch): Promise<void> {
    for (const message of batch.messages) {
      console.log('Processing:', message.body);
      // Your logic here
    }
    // Implicit ack: returning successfully acknowledges all messages
  },
};

Deploy:

bunx wrangler deploy

Load: references/setup-guide.md for complete 6-step setup with DLQ configuration


Critical Rules

Always Do ✅

  1. Configure Dead Letter Queue for production queues
  2. Use explicit ack() for non-idempotent operations (DB writes, API calls)
  3. Validate message size before sending (<128 KB)
  4. Use sendBatch() for multiple messages (more efficient)
  5. Implement exponential backoff for retries
  6. Set appropriate batch settings based on workload
  7. Monitor queue backlog and consumer errors
  8. Use ctx.waitUntil() for async cleanup in consumers
  9. Handle errors gracefully - log, alert, retry
  10. Let concurrency auto-scale (don't set max_concurrency unless needed)

Read the full file on GitHub · 519 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. 3d ago First seen · 519 lines · 78 tokens per session scan A 7e70fb23b3fd

Subscribe to this mod's changes

cloudflare-queues is a skill published in the GitHub repository secondsky/claude-skills (214 stars, last pushed 4d ago), licensed MIT. It adds 78 tokens to every session and 3,863 once invoked, about $0.0004 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.