kv

kv is a skill for Claude Code, Codex from null-shot/cloudflare-skills. It costs 42 tokens per session (2,199 once invoked), scanned A, original, from a forked repository, Apache-2.0.

A globally distributed key-value store on Cloudflare's edge network. It is eventually consistent, meaning a recent write may take time to appear everywhere.

In plain words
What is it for?
It is for sessions, authentication tokens, cached responses, feature flags, A/B test assignments, rate-limit counters, and user preferences.
Why use it?
It provides fast reads and writes close to users, while making clear that it is not suited to transactions or data requiring immediate consistency.

Skill for Claude CodeCodex

Part of the cloudflare plugin — 19 skills, 2 commands shipped together

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.

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

Made for: Claude Code, Codex.

Or install cloudflare, the plugin that ships this one along with the rest of its 19 skills, 2 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 kv

README.md
[![agentmods](https://agentmods.dev/badge/skills/null-shot/cloudflare-skills/kv.svg)](https://agentmods.dev/skills/null-shot/cloudflare-skills/kv)
Your own site
<a href="https://agentmods.dev/skills/null-shot/cloudflare-skills/kv"><img src="https://agentmods.dev/badge/skills/null-shot/cloudflare-skills/kv.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,199 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin fork From a forked repository.
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.00042 $0.02199
Opus 5 $0.00021 $0.01099
Sonnet 5 $0.00008 $0.00440
Haiku 4.5 $0.00004 $0.00220

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

Security

Grade A, and why

kv scanned grade A with 0 findings 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.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

kv/SKILL.md · 341 lines

How it starts

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

Workers KV

Fast, eventually-consistent key-value storage distributed globally across Cloudflare's edge network.

FIRST: Create KV Namespace

# Create namespace
wrangler kv namespace create MY_KV

# Create preview namespace for dev
wrangler kv namespace create MY_KV --preview

# Add to wrangler.jsonc (use IDs from commands above)

When to Use

Use Case Why KV
Session storage Fast token/session lookups at the edge
Caching Cache API responses, rendered HTML, or computed results
Configuration data Feature flags, app settings, rate limit counters
User profiles Store user preferences, settings, metadata
A/B testing Store experiment assignments and feature toggles
Rate limiting Track request counts per user/IP with TTL

Don't use KV for:

  • Strongly consistent data (use Durable Objects)
  • Relational queries (use D1)
  • Large files >25MB (use R2)
  • Transactional operations

Quick Reference

Operation API Example
Read value get(key) await env.KV.get("user:123")
Read with metadata getWithMetadata(key) await env.KV.getWithMetadata("key", "json")
Write value put(key, value, options) await env.KV.put("key", "value", { expirationTtl: 3600 })
Delete value delete(key) await env.KV.delete("key")
List keys list(options) await env.KV.list({ prefix: "user:" })

Value Types

// String (default)
await env.KV.get("key")

// JSON (auto-parse)
await env.KV.get("user:123", "json")

// Binary
await env.KV.get("image", "arrayBuffer")

// Stream
await env.KV.get("large-file", "stream")

wrangler.jsonc Configuration

{
  "name": "my-worker",
  "main": "src/index.ts",
  "compatibility_date": "2026-01-01",
  
  "kv_namespaces": [
    {
      "binding": "AUTH_TOKENS",
      "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "preview_id": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
    },
    {
      "binding": "CACHE",
      "id": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
    }
  ]
}

Read the full file on GitHub · 341 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 341 lines · 42 tokens per session scan A 5afb63c32129

Subscribe to this mod's changes

kv is a skill published in the GitHub repository null-shot/cloudflare-skills (0 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 42 tokens to every session and 2,199 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It comes from a forked repository.

Related

Other skills, from other repositories

pinecone

Managed vector DB for production RAG and search.

NousResearch/hermes-agent · 13 tokens

redis-inspect

Inspect Redis cache keys, values, and TTLs for debugging. Supports both main cache and system cache. Use for debugging cache issues, checking cached values, and monitoring cache state. Read-only by default.

civitai/civitai · 45 tokens

redis-js

Work with the Upstash Redis JavaScript/TypeScript SDK for serverless Redis operations. Use for caching, session storage, rate limiting, leaderboards, full-text search (querying, filtering, aggregating with @upstash/redis search extension), and all Redis data structures. Supports automatic serialization/deserialization…

upstash/redis-js · 93 tokens

using-redis-token-buckets

Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…

PostHog/posthog-foss · 148 tokens

byted-milvus

Manages Milvus on Volcano Engine (Volcengine): provision/inspect/scale/delete clusters and run collection + CRUD/search operations via bundled CLIs. Use when the user mentions Milvus + Volcengine/Volcano Engine or asks to operate Milvus there.

bytedance/agentkit-samples · 60 tokens

vector-db

Vector database expert for embeddings, similarity search, RAG patterns, and indexing strategies.

RightNow-AI/openfang · 19 tokens