cloudflare-kv

cloudflare-kv is a skill for Claude Code from secondsky/claude-skills. It costs 35 tokens per session (2,483 once invoked), scanned A, original, MIT.

A guide and toolkit for using Cloudflare Workers KV, a globally distributed key-value store for saving and retrieving data by key. It supports expiration times and metadata.

In plain words
What is it for?
Use it to create KV namespaces, configure Worker bindings, read and write values, delete values, and set automatic expiration.
Why use it?
It gives you the setup and code patterns needed to connect a Worker to KV without figuring out namespaces and bindings from scratch.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cloudflare-kv plugin — 1 skill, 3 commands shipped together

Good fit Use it to create KV namespaces, configure Worker bindings, read and write values, delete values, and set automatic expiration.

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

Any agent
npx skills add secondsky/claude-skills --skill cloudflare-kv
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

Or install cloudflare-kv, the plugin that ships this one along with the rest of its 1 skill, 3 commands.

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 cloudflare-kv

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-kv"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-kv.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,483 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00035 $0.02483
Opus 5 $0.00017 $0.01241
Sonnet 5 $0.00007 $0.00497
Haiku 4.5 $0.00003 $0.00248

Measured 5d ago against content hash cb9515dbe508, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

cloudflare-kv 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 5d ago.

The scan reads SKILL.md. This mod also ships 13 executable files (examples/api-caching/index.ts, examples/config-management/index.ts, examples/rate-limiting/index.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

async fetch(request, env, ctx) {
plugins/cloudflare-kv/skills/cloudflare-kv/SKILL.md · 393 lines

How it starts

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

Cloudflare Workers KV

Status: Production Ready ✅ | Last Verified: 2025-12-27


What Is Workers KV?

Global key-value storage on Cloudflare edge:

  • Eventually consistent
  • Low latency worldwide
  • 1GB+ values supported
  • TTL expiration
  • Metadata support

Quick Start (5 Minutes)

1. Create KV Namespace

bunx wrangler kv namespace create MY_NAMESPACE
bunx wrangler kv namespace create MY_NAMESPACE --preview

2. Configure Binding

{
  "name": "my-worker",
  "main": "src/index.ts",
  "compatibility_date": "2025-10-11",
  "kv_namespaces": [
    {
      "binding": "MY_NAMESPACE",
      "id": "<PRODUCTION_ID>",
      "preview_id": "<PREVIEW_ID>"
    }
  ]
}

3. Basic Operations

export default {
  async fetch(request, env, ctx) {
    // Write
    await env.MY_NAMESPACE.put('key', 'value');

    // Read
    const value = await env.MY_NAMESPACE.get('key');

    // Delete
    await env.MY_NAMESPACE.delete('key');

    return new Response(value);
  }
};

Load references/setup-guide.md for complete setup.


KV API Methods

put() - Write

// Basic
await env.MY_NAMESPACE.put('key', 'value');

// With TTL (1 hour)
await env.MY_NAMESPACE.put('key', 'value', {
  expirationTtl: 3600
});

// With expiration timestamp
await env.MY_NAMESPACE.put('key', 'value', {
  expiration: Math.floor(Date.now() / 1000) + 3600
});

// With metadata
await env.MY_NAMESPACE.put('key', 'value', {
  metadata: { role: 'admin', created: Date.now() }
});

get() - Read

// Simple get
const value = await env.MY_NAMESPACE.get('key');

// With type
const text = await env.MY_NAMESPACE.get('key', 'text');
const json = await env.MY_NAMESPACE.get('key', 'json');
const buffer = await env.MY_NAMESPACE.get('key', 'arrayBuffer');
const stream = await env.MY_NAMESPACE.get('key', 'stream');

// With metadata
const { value, metadata } = await env.MY_NAMESPACE.getWithMetadata('key');

delete() - Remove

Read the full file on GitHub · 393 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. 5d ago First seen · 393 lines · 35 tokens per session scan A cb9515dbe508

Subscribe to this mod's changes

cloudflare-kv is a skill published in the GitHub repository secondsky/claude-skills (216 stars, last pushed yesterday), licensed MIT. It adds 35 tokens to every session and 2,483 once invoked, about $0.0002 per session on Opus 5. 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.