Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add cloudflare/skills --skill k2 -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/k2/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/k2/

From the same set18

The whole set →
cloudflare cloudflare Helps coding agents pick the right Cloudflare products for applications, storage, and AI, while routing between cf CLI and Wrangler. Claude Code CX Codex Cursor +1 136,500installs wrangler cloudflare Runs and troubleshoots Wrangler CLI commands for Cloudflare Workers projects that use wrangler configuration files. Claude Code CX Codex Cursor +1 128,500installs workers-best-practices cloudflare Guides coding agents on production Cloudflare Workers standards, Wrangler typing, observability setup, and runtime anti-pattern checks. Claude Code CX Codex Cursor +1 124,900installs durable-objects cloudflare This skill helps build, debug, and review Cloudflare Durable Objects for state, coordination, and persistent connections. Claude Code CX Codex Cursor +1 109,700installs web-perf cloudflare Audit Core Web Vitals, diagnose rendering bottlenecks, and inspect network dependencies directly through your agent. Claude Code CX Codex Cursor +1 109,300installs agents-sdk cloudflare Helps build, debug, and review Cloudflare Agents SDK applications using the agents package and official documentation. Claude Code CX Codex Cursor +1 105,700installs cloudflare-email-service cloudflare A skill for Cloudflare Email Sending and Email Routing: it walks the agent through sending and receiving mail in Workers. Claude Code CX Codex Cursor +1 101,400installs cloudflare-one cloudflare Walks your agent through designing, configuring and troubleshooting Cloudflare One Zero Trust and SASE deployments. Useful when you need Access, Gateway or tunnel work done without digging through docs yourself. Claude Code CX Codex Cursor +1 92,200installs

Similar

setup-zoom-mcp official anthropics Helps decide whether Zoom MCP or a hybrid REST API fits your workflow, evaluates auth constraints, and drafts a PoC plan. Claude Code CX Codex Cursor +1 2,000installs debug-zoom-integration official anthropics Traces broken Zoom integrations across auth, webhooks, SDK joins, MCP transport, and media sessions. Use it when an existing implementation fails. Claude Code CX Codex Cursor +1 2,000installs prisma-expert sickn33 This skill helps inspect Prisma schemas, migrations, and queries. Use it to investigate an error or review database changes before deployment. Claude Code CX Codex Cursor +1 4,200installs neon neondatabase This skill helps choose and configure a Neon backend with Postgres, auth, storage, functions, the AI Gateway, and Realtime. Use it when building an app. Claude Code CX Codex Cursor +1 231,200installs dpop-adoption official google This skill guides DPoP setup for Google OAuth refresh tokens, including P-256 keys and proof JWTs. Use it when exchanging an authorization code or refreshing a token. Claude Code Gemini CLI CX Codex 2,600installs telegram-bot-builder sickn33 This skill guides Telegram bot architecture, from command handlers and inline keyboards to payments and webhooks. Use it when starting a bot project or preparing one for deployment. Claude Code CX Codex Cursor +1 3,700installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs lark-im larksuite This skill lets an agent work with Lark IM messages, chats, files, and interactive cards. Use it when coding tasks need access to team conversations. Claude Code CX Codex Cursor +1 472,300installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor