k2 — Claude Code skill: Cloudflare logs and install
This skill helps configure Cloudflare K2, produce records from Workers or HTTP, and consume them through subscriptions. Use it when working with durable logs.
npx skills add cloudflare/skills --skill k2 -a claude-codeWhat k2 does
The skill covers Cloudflare K2 and K2 Streams. It guides stream creation, input configuration, authentication, CORS, retention, record production from a Worker or HTTP, and consumption through subscriptions. It also covers leases, acknowledgements, retries, errors, and stream limits.
Before giving setup, code, permission, API, availability, or limit details, the skill directs the agent to retrieve the relevant current Cloudflare documentation and treat it as the source of truth. That matters in practice: examples and constraints need to be checked against the current docs. Use the basin skill for SQL transformation and delivery to R2 Iceberg tables; consult Cloudflare Queues for task processing.
What it helps with
- create and test a Cloudflare K2 stream
- configure inputs, authentication, CORS, and retention
- produce records from a Worker or over HTTP
- consume records through subscriptions
- handle leases, acknowledgements, retries, and errors
Example prompts for the agent
- Set up a Cloudflare K2 stream for records produced by a Worker and use the current documentation for each step.
- Show how to produce records to K2 over HTTP, including request syntax, encoding, errors, and retries.
- Explain how to consume K2 records through subscriptions and handle leases and acknowledgements.
How to install k2
1Skills CLI (Vercel)
npx skills add cloudflare/skills --skill k2 -a claude-code2Manually: put the files in place
~/.claude/skills/k2/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/k2/
1Skills CLI (Vercel)
npx skills add cloudflare/skills --skill k2 -a codex2Manually: put the files in place
.agents/skills/k2/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add cloudflare/skills --skill k2 -a cursor2Manually: put the files in place
.cursor/skills/k2/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install cloudflare/skills k22Manually: put the files in place
.github/skills/k2/SKILL.md1Skills CLI (Vercel)
npx skills add cloudflare/skills --skill k2 -a gemini-cli2Platform CLI
gemini skills install https://github.com/cloudflare/skills --path skills/k2Manually: put the files in place
.devin/skills/k2/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add cloudflare/skills --skill k2 -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set18
The whole set →Similar
Questions about k2
How do I install k2 in Claude Code?
Run npx skills add cloudflare/skills --skill k2 -a claude-code, then run npx skills add cloudflare/skills --skill k2 -a claude-code again. The skill file is at ~/.claude/skills/k2/SKILL.md.
What does the k2 skill do?
It helps configure Cloudflare K2 and K2 Streams, produce records from Workers or HTTP, and consume them through subscriptions. It also covers retention, inputs, authentication, CORS, retries, and limits.
When should I use the basin skill instead of k2?
Use basin for SQL transformation and delivery to R2 Iceberg tables. For task processing, consult Cloudflare Queues.
Source text
SKILL.md · Apache-2.0
--- name: k2 description: 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. --- # Cloudflare K2 K2 is a durable log for decoupling event producers and consumers. Start with the [K2 overview](https://developers.cloudflare.com/k2/index.md), 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. While [cloudflare-docs PR #33858](https://github.com/cloudflare/cloudflare-docs/pull/33858) remains open, use its proposed pages if the public URLs have not been published. ## Documentation | Task | Docs | Check for | |------|------|-----------| | Create a stream and try K2 | [Get started](https://developers.cloudflare.com/k2/get-started/index.md) | Prerequisites, setup sequence, current API examples | | Understand streams and subscriptions | [Concepts](https://developers.cloudflare.com/k2/concepts/index.md) | Record model and delivery behavior | | Configure a stream | [Configuration](https://developers.cloudflare.com/k2/configuration/index.md) | Inputs, authentication, CORS, retention | | Produce from HTTP or a Worker | [Produce records](https://developers.cloudflare.com/k2/features/produce/index.md) | Request and binding syntax, encoding, errors, retries | | Consume through subscriptions | [Consume records](https://developers.cloudflare.com/k2/features/consume/index.md) | Leases, acknowledgements, retries, errors | | Size a stream or consumer | [Limits](https://developers.cloudflare.com/k2/platform/limits/index.md) | Current quotas and size limits | Retrieve the matching pages above for each task and use their current examples. For capacity or cost questions, check current limits and any published pricing before quoting values. State when a requested pricing or availability detail is not yet published. For SQL transformation and delivery to R2 Iceberg tables, use the `basin` skill. For task processing, consult [Queues](https://developers.cloudflare.com/queues/index.md).
© cloudflare · Apache-2.0 · cloudflare/skills