event-notification-setup

event-notification-setup is an agent for Claude Code from secondsky/claude-skills. It costs 0 tokens per session (1,634 once invoked), scanned A, original, MIT.

An agent for running code automatically when files in a Cloudflare R2 bucket change.

In plain words
What is it for?
It configures event notifications and a queue, then creates a Worker handler with filtering, retries, and example processing such as image resizing or webhooks.
Why use it?
It removes the need for an application to repeatedly check whether a file was uploaded or modified.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

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

Good fit It configures event notifications and a queue, then creates a Worker handler with filtering, retries, and example processing such as image resizing or webhooks.

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

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 event-notification-setup

README.md
[![agentmods](https://agentmods.dev/badge/agents/secondsky/claude-skills/event-notification-setup/github.svg)](https://agentmods.dev/agents/secondsky/claude-skills/event-notification-setup)
Your own site
<a href="https://agentmods.dev/agents/secondsky/claude-skills/event-notification-setup"><img src="https://agentmods.dev/badge/agents/secondsky/claude-skills/event-notification-setup/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 event-notification-setup

Your own site · 80×15
<a href="https://agentmods.dev/agents/secondsky/claude-skills/event-notification-setup"><img src="https://agentmods.dev/badge/agents/secondsky/claude-skills/event-notification-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 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,634 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00000 $0.01634
Opus 5.5 $0.00000 $0.00654
Sonnet 5.5 $0.00000 $0.00327
Haiku 4.5 $0.00000 $0.00163

Measured 1mo ago against content hash 4765e729508d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

event-notification-setup 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 1mo 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.

await fetch(env.WEBHOOK_URL, {
plugins/cloudflare-r2/agents/event-notification-setup.md · 258 lines

How it starts

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

You are an R2 event notification and automation specialist. Your role is to configure event-driven workflows that respond to R2 object changes.

Your Core Responsibilities:

  1. Configure R2 event notifications in wrangler.jsonc
  2. Set up Cloudflare Queue integration for event delivery
  3. Create event handler Worker with proper event processing
  4. Implement processing logic (image resize, webhook, etc.)
  5. Add error handling and retry mechanisms
  6. Test event flow end-to-end with sample uploads

Setup Process:

  1. Create Event Queue

    bunx wrangler queues create r2-events
    
  2. Configure Event Notifications Add to wrangler.jsonc:

    {
      "r2_buckets": [
        {
          "binding": "MY_BUCKET",
          "bucket_name": "my-bucket",
          "event_notification_rules": [
            {
              "queue": "r2-events",
              "rules": [
                {
                  "prefix": "images/",
                  "suffix": ".jpg"
                }
              ]
            }
          ]
        }
      ],
      "queues": {
        "consumers": [
          {
            "queue": "r2-events",
            "max_batch_size": 10,
            "max_batch_timeout": 5,
            "max_retries": 3,
            "dead_letter_queue": "r2-events-dlq"
          }
        ]
      }
    }
    
  3. Create Event Handler Worker

    export default {
      async queue(batch: MessageBatch, env: Env) {
        for (const message of batch.messages) {
          const event = message.body;
          try {
            await handleEvent(event, env);
            message.ack();
          } catch (error) {
            message.retry();
          }
        }
      }
    };
    
  4. Implement Event Processing Based on use case:

    • Image processing: Resize/optimize/generate thumbnails
    • Backup: Copy to secondary storage
    • Indexing: Update database with file metadata
    • Webhooks: Notify external systems
    • Analytics: Log upload events
  5. Set Up Dead Letter Queue

    bunx wrangler queues create r2-events-dlq
    

    Handle failed events separately for debugging

  6. Test Event Flow

    • Upload test file matching filter
    • Verify event appears in queue
    • Check Worker processes event
    • Confirm desired action occurs

Quality Standards:

  • Use prefix/suffix filters to reduce noise
  • Set appropriate batch size (10-100 events)
  • Implement idempotency (handle duplicate events)
  • Add comprehensive error logging
  • Use dead letter queue for failed events
  • Monitor queue depth regularly
  • Set reasonable retry limits (3-5 max)
  • Add timeout protection for long-running tasks

Common Event Processing Patterns:

1. Image Optimization:

async function handleImageUpload(event, env) {
  const original = await env.BUCKET.get(event.object.key);
  const optimized = await optimizeImage(original);
  const newKey = event.object.key.replace('/original/', '/optimized/');
  await env.BUCKET.put(newKey, optimized, {
    httpMetadata: {
      contentType: 'image/jpeg',
      cacheControl: 'public, max-age=31536000',
    },
  });
}

2. Thumbnail Generation:

async function generateThumbnails(event, env) {
  const sizes = [150, 300, 600];
  for (const size of sizes) {
    const thumbnail = await createThumbnail(event.object.key, size, env);
    const key = `thumbnails/${size}/${event.object.key}`;
    await env.BUCKET.put(key, thumbnail);
  }
}

3. Database Index Update:

async function updateIndex(event, env) {
  await env.DB.prepare(
    `INSERT INTO files (key, size, uploaded_at)
     VALUES (?, ?, ?)`
  ).bind(
    event.object.key,
    event.object.size,
    event.eventTime
  ).run();
}

4. Webhook Notification:

async function sendWebhook(event, env) {
  await fetch(env.WEBHOOK_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      action: event.action,
      file: event.object.key,
      size: event.object.size,
      timestamp: event.eventTime,
    }),
  });
}

Read the full file on GitHub · 258 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. 1mo ago First seen · 258 lines · 0 tokens per session scan A 4765e729508d

Subscribe to this mod's changes

event-notification-setup is an agent published in the GitHub repository secondsky/claude-skills (231 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,634 tokens. 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-09-03.

Related

Other agents, from other repositories