Build and troubleshoot Cloudflare K2 or K2 Streams durable logs. Use for stream setup, producing from Workers or HTTP, configuring retention and inputs, and consuming through subscriptions.
Written by Cloudflare and published in cloudflare/skills under the Apache-2.0 license. Treq shows it unchanged except for heading levels and links to files on GitHub.
K2 is a durable log for decoupling event producers and consumers. Start with the K2 overview, then retrieve the relevant current documentation before giving setup instructions, code, limits, availability, permissions, or API details. The docs are the source of truth over this skill. K2 is in public beta on the Workers Paid plan; check the overview for current availability and beta storage limits.
| Task | Docs | Check for |
|---|---|---|
| Create a stream and try K2 | Get started | Prerequisites, setup sequence, current API examples |
| Understand streams and subscriptions | Concepts | Record model and delivery behavior |
| Configure a stream | Configuration | Inputs, authentication, CORS, retention |
| Produce from HTTP or a Worker | Produce records | Request and binding syntax, encoding, errors, retries |
| Consume through subscriptions | Consume records | Leases, acknowledgements, retries, errors |
| Reason about duplicates and redelivery | Delivery guarantees | At-least-once delivery, leases, retention effects |
| Size a stream or consumer | Limits | Current quotas and size limits |
| Estimate cost | Pricing | Billing status, data produced, consumed, and retained |
Retrieve the matching pages above for each task and use their current examples. For capacity or cost questions, check current limits and pricing before quoting values, and state whether billing is enabled yet.
For SQL transformation and delivery to R2 Iceberg tables, use the basin skill. For task processing, consult Queues.
If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md.
Claude Code and Codex keep each installed skill's name and description in context. When a request matches the description, the agent loads the full SKILL.md. You can also run it yourself: type /k2 in Claude Code or $k2 in Codex.
The description says when to use it:
Use for stream setup, producing from Workers or HTTP, configuring retention and inputs, and consuming through subscriptions.
Copy the k2 folder into .claude/skills/ in your project. To use it in every project, copy it into ~/.claude/skills/ instead.
git clone --depth 1 https://github.com/cloudflare/skills.git /tmp/cloudflare-skills
mkdir -p .claude/skills
cp -r /tmp/cloudflare-skills/skills/k2 .claude/skills/
Codex reads skills from .agents/skills/ in your repository, and from ~/.agents/skills/ for every repository. It detects new skills on its own. Restart Codex if k2 does not appear.
git clone --depth 1 https://github.com/cloudflare/skills.git /tmp/cloudflare-skills
mkdir -p .agents/skills
cp -r /tmp/cloudflare-skills/skills/k2 .agents/skills/
Open Settings and select the Skills tab. The tab appears when Skills installation is on under Settings → Feature Preview. Search for k2 and choose Install….
Install for repository writes the skill under .treq/skills/ in the current repository. Install for application makes it available to every repository on this machine. Each new workspace gets a copy in .claude/skills/ and .agents/skills/, so Claude Code and Codex both find it. See Installing Skills from the Library.
k2 ships 2 files, 5.2 KB in total. Select a file to load it from GitHub.