Agent skill · writing content · jeremylongshore
anth-webhooks-events
Implement event-driven patterns with Claude API: streaming SSE events,
Why this skill is useful
Provides specific implementation patterns and code examples for integrating with the Claude API's event-driven architecture that the AI wouldn't reliably generate on its own.
What it needs
Requires redis, rq installed locally. Requires anthropic account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Anthropic Events & Async Processing Overview The Claude API does not use traditional webhooks. Instead it provides two event-driven patterns: Server-Sent Events (SSE) for real-time streaming and the Message Batches API for async bulk processing. This skill covers both. SSE Streaming Events SSE Event Reference Event When Key Data ------- ------ ---------- messagestart Stream begins message.id, message.model, message.usage.inputtokens contentblockstart New block begins contentblock.type (text or tooluse), index contentblockdelta Incremental content delta.text or delta.partialjson contentblockstop Block finishes index messagedelta Message-level update delta.stopreason, usage.outputtokens messagestop Stream complete (empty) ping Keepalive (empty) Async Batch Processing Event-Driven Architecture Pattern Error Handling Issue Cause Fix ------- ------- ----- Stream disconnects Network timeout Reconnect and re-request (responses are not resumable) Batch expired Not processed in 24h Resubmit the batch errored results Individual request was invalid Check result.error.message per request Prerequisites Choose an approved sandbox workspace, synthetic documents, bounded batch size, queue with durable retry/dead-letter behavior, and an authenticated internal callback destination. Treat SSE as a provider stream and callbacks as application-owned events: Anthropic does not use traditional webhooks for the patterns described here. Define an event retention period and redaction policy. Do not log prompts, completions, document content, tool arguments, API keys, or callback secrets. Instructions 1. Validate the stream or batch request against an allowlist of model, source, destination, and maximum size before sending it. Use synthetic fixtures and assert sideeffects=0. 2. For SSE, process known event types, preserve ordering by message/block index, and mark a response incomplete until messagestop. Never assume a disconnected stream is resumable. 3. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/anth-webhooks-events--6e0efb