cloudflare-r2

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

A guide for Cloudflare R2, an object-storage service for files such as images, uploads, and backups. It uses an S3-compatible interface, so many tools built for Amazon S3 can work with it.

In plain words
What is it for?
Use it to create R2 buckets, connect them to Cloudflare Workers, upload and download files, configure CORS, and generate presigned URLs.
Why use it?
It helps prevent configuration mistakes involving buckets, bindings, cross-origin requests, and multipart uploads. It also clarifies how application code accesses stored objects.

Skill for Claude Code

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

Part of the cloudflare-r2 plugin — 1 skill, 4 commands, 5 agents shipped together

Good fit Use it to create R2 buckets, connect them to Cloudflare Workers, upload and download files, configure CORS, and generate presigned URLs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/secondsky/claude-skills/cloudflare-r2
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-r2
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-r2/github.svg)](https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-r2)
Your own site
<a href="https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-r2"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-r2/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cloudflare-r2

Your own site · 80×15
<a href="https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-r2"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-r2.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,535 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00041 $0.03535
Opus 5 $0.00020 $0.01767
Sonnet 5 $0.00008 $0.00707
Haiku 4.5 $0.00004 $0.00353

Measured 5d ago against content hash 6b3a989d73de, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

cloudflare-r2 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 5d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (templates/r2-multipart-upload.ts, templates/r2-presigned-urls.ts, templates/r2-simple-upload.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-r2/skills/cloudflare-r2/SKILL.md · 421 lines

How it starts

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

Cloudflare R2 Object Storage

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

Contents: Quick StartNew FeaturesCore R2 APICritical RulesAgents & CommandsReferences


Quick Start (5 Minutes)

1. Create R2 Bucket

bunx wrangler r2 bucket create my-bucket

Bucket naming: 3-63 chars, lowercase, numbers, hyphens only

2. Configure Binding

Add to wrangler.jsonc:

{
  "name": "my-worker",
  "main": "src/index.ts",
  "compatibility_date": "2025-10-11",
  "r2_buckets": [
    {
      "binding": "MY_BUCKET",          // env.MY_BUCKET
      "bucket_name": "my-bucket",      // Actual bucket
      "preview_bucket_name": "my-bucket-preview"  // Optional: dev bucket
    }
  ]
}

CRITICAL: binding = code access name, bucket_name = actual R2 bucket

3. Basic Upload/Download

import { Hono } from 'hono';

type Bindings = {
  MY_BUCKET: R2Bucket;
};

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

// Upload
app.put('/upload/:filename', async (c) => {
  const filename = c.req.param('filename');
  const body = await c.req.arrayBuffer();

  const object = await c.env.MY_BUCKET.put(filename, body, {
    httpMetadata: {
      contentType: c.req.header('content-type') || 'application/octet-stream',
    },
  });

  return c.json({
    success: true,
    key: object.key,
    size: object.size,
  });
});

// Download
app.get('/download/:filename', async (c) => {
  const object = await c.env.MY_BUCKET.get(c.req.param('filename'));

  if (!object) {
    return c.json({ error: 'Not found' }, 404);
  }

  return new Response(object.body, {
    headers: {
      'Content-Type': object.httpMetadata?.contentType || 'application/octet-stream',
      'ETag': object.httpEtag,
    },
  });
});

export default app;

Read the full file on GitHub · 421 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. 5d ago First seen · 421 lines · 41 tokens per session scan A 6b3a989d73de

Subscribe to this mod's changes

cloudflare-r2 is a skill published in the GitHub repository secondsky/claude-skills (216 stars, last pushed yesterday), licensed MIT. It adds 41 tokens to every session and 3,535 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.