Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
Claude Skills Maintainers avatar

Cloudflare R2

  • 196 repo stars
  • Updated July 25, 2026
  • secondsky/claude-skills

Store and manage files at scale with S3-compatible APIs, event notifications, and cost-effective object storage without managing their own infrastructure.

About

Cloudflare R2 is an S3-compatible object storage service that handles buckets, file uploads, CORS configuration, presigned URLs, and large file management. developers use it when they need reliable file storage, want to migrate from S3, or need to troubleshoot CORS failures and multipart upload issues. It matters because R2 provides cost-effective, scalable storage with built-in analytics and automation capabilities without the vendor lock-in of proprietary solutions.

  • S3-compatible API with easy migration from AWS
  • SQL and Iceberg support for analytics on stored objects
  • Event notifications and automation for file workflows

Cloudflare R2 by the numbers

  • Data as of Jul 28, 2026 (Skillselion catalog sync)
/plugin marketplace add secondsky/claude-skills
/plugin install cloudflare-r2@claude-skills

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
repo stars196
Last updatedJuly 25, 2026
Repositorysecondsky/claude-skills

What it does

Store and manage files at scale with S3-compatible APIs, event notifications, and cost-effective object storage without managing their own infrastructure.

README.md

Cloudflare R2 Object Storage

Complete knowledge domain for Cloudflare R2 - S3-compatible object storage on Cloudflare's global network.


Auto-Trigger Keywords

Primary Keywords

  • r2 storage
  • cloudflare r2
  • r2 upload
  • r2 download
  • r2 bucket
  • r2 binding
  • object storage
  • r2 api
  • r2 workers

Secondary Keywords

  • s3 compatible
  • r2 cors
  • presigned urls
  • multipart upload
  • r2 get
  • r2 put
  • r2 delete
  • r2 list
  • file upload
  • asset storage
  • image storage
  • r2 metadata
  • custom metadata
  • http metadata
  • r2 wrangler

Error-Based Keywords

  • R2_ERROR
  • CORS error r2
  • presigned url failed
  • multipart upload failed
  • r2 quota exceeded
  • content-type missing
  • r2 bucket not found
  • r2 access denied
  • bulk delete failed

Framework Integration Keywords

  • r2 hono
  • r2 workers api
  • r2 cloudflare workers
  • wrangler r2
  • r2 bindings

What This Skill Does

This skill provides complete R2 knowledge including:

  • R2 Workers API - put(), get(), head(), delete(), list()
  • Multipart Uploads - For files >100MB with resumable uploads
  • Presigned URLs - Client-side direct uploads/downloads
  • CORS Configuration - Browser access to R2 buckets
  • HTTP Metadata - Content-Type, Cache-Control, Content-Disposition
  • Custom Metadata - User-defined key-value pairs
  • Bucket Configuration - wrangler.jsonc setup and bindings
  • Error Handling - Retry strategies and common errors
  • Performance Optimization - Batch operations, range requests, caching

Known Issues Prevented

Issue Description Prevention
CORS errors Browser uploads fail Configure CORS before browser access
Binary downloads Files download as binary blob Always set contentType on upload
Presigned URL security URLs never expire Set X-Amz-Expires parameter
Multipart limits Upload fails with large files Use 5MB-100MB parts, max 10,000 parts
Bulk delete limits Deleting >1000 keys fails Chunk into batches of 1000
Metadata overflow Custom metadata exceeds 2KB Keep total metadata under 2KB

When to Use This Skill

✅ Use this skill when:

  • Storing user uploads (images, documents, videos)
  • Serving static assets (CSS, JS, images)
  • Building file management systems
  • Implementing direct client uploads
  • Setting up CORS for browser access
  • Generating presigned URLs
  • Uploading large files (multipart)
  • Migrating from S3 to R2

❌ When NOT to use:

  • You need a relational database (use cloudflare-d1)
  • You need key-value storage (use cloudflare-kv)
  • Files are <1KB (KV might be better)
  • You need vector search (use cloudflare-vectorize)

Quick Example

import { Hono } from 'hono';

type Bindings = {
  MY_BUCKET: R2Bucket;
};

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

// Upload file
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 file
app.get('/download/:filename', async (c) => {
  const filename = c.req.param('filename');
  const object = await c.env.MY_BUCKET.get(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;

Files Included

  • SKILL.md - Complete R2 knowledge domain
  • templates/wrangler-r2-config.jsonc - R2 binding configuration
  • templates/r2-simple-upload.ts - Basic upload/download Worker
  • templates/r2-multipart-upload.ts - Multipart upload Worker
  • templates/r2-presigned-urls.ts - Presigned URL generator
  • templates/r2-cors-config.json - CORS policy examples
  • reference/workers-api.md - Complete Workers API reference
  • reference/s3-compatibility.md - S3 API compatibility notes
  • reference/common-patterns.md - Common R2 patterns

Dependencies

  • cloudflare-worker-base - For Hono + Vite + Worker setup
  • wrangler - For R2 bucket management
  • aws4fetch (optional) - For presigned URL generation

Production Status

Production Ready

This skill is based on:

  • Official Cloudflare R2 documentation
  • Cloudflare Workers SDK examples
  • Production-tested patterns
  • Latest package versions (verified 2025-10-21)

Related Skills

  • cloudflare-worker-base - Base Worker setup with Hono
  • cloudflare-d1 - Serverless SQLite database
  • cloudflare-kv - Key-value storage
  • cloudflare-workers-ai - AI inference on Workers

Last Updated: 2025-10-21 Status: Production Ready ✅ Maintainer: Claude Skills Maintainers | maintainers@example.com

Related skills

Cloud & Infrastructurebackenddevopsintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.