hyperdrive

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

A Cloudflare service that pools database connections and caches results for existing PostgreSQL or MySQL databases.

In plain words
What is it for?
It is for connecting edge Workers to existing PostgreSQL or MySQL databases, including applications using Drizzle or Prisma and migrations from traditional database hosting.
Why use it?
It reduces the overhead of opening database connections for Workers and can lower latency for read-heavy applications by caching queries at the edge.

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/hyperdrive
Any agent
npx skills add null-shot/cloudflare-skills --skill hyperdrive
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 hyperdrive

README.md
[![agentmods](https://agentmods.dev/badge/skills/null-shot/cloudflare-skills/hyperdrive.svg)](https://agentmods.dev/skills/null-shot/cloudflare-skills/hyperdrive)
Your own site
<a href="https://agentmods.dev/skills/null-shot/cloudflare-skills/hyperdrive"><img src="https://agentmods.dev/badge/skills/null-shot/cloudflare-skills/hyperdrive.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,812 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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 $0.00049 $0.01812
Opus 5 $0.00024 $0.00906
Sonnet 5 $0.00010 $0.00362
Haiku 4.5 $0.00005 $0.00181

Measured 2d ago against content hash 1e26cad3c8f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

hyperdrive 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 2d 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.

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): Promise<Response> {
hyperdrive/SKILL.md · 251 lines

How it starts

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

Hyperdrive

Accelerate access to existing PostgreSQL and MySQL databases with connection pooling and caching.

FIRST: Create Hyperdrive Configuration

# Create a Hyperdrive configuration for your database
npx wrangler hyperdrive create <YOUR_CONFIG_NAME> --connection-string="postgres://user:password@HOSTNAME_OR_IP_ADDRESS:PORT/database_name"

# Copy the ID from the output for your wrangler.jsonc

Add the binding to wrangler.jsonc:

{
  "hyperdrive": [
    {
      "binding": "HYPERDRIVE",
      "id": "<YOUR_DATABASE_ID>"
    }
  ]
}

When to Use

Use Hyperdrive when:

  • Connecting to existing databases - PostgreSQL or MySQL hosted anywhere
  • Reducing connection latency - Connection pooling eliminates per-request connection overhead
  • Geographic distribution - Cache query results at the edge for read-heavy workloads
  • Database migration - Connect Workers to traditional databases without rewriting apps
  • Connection limits - Share connections across many Workers efficiently

Quick Reference

Operation API
Get connection string env.HYPERDRIVE.connectionString
Connect with Postgres.js postgres(env.HYPERDRIVE.connectionString)
Query with Postgres.js await sql`SELECT * FROM users`
No cleanup needed Hyperdrive handles connection pooling—don't call sql.end()
List configs npx wrangler hyperdrive list
Get config details npx wrangler hyperdrive get <ID>
Update config npx wrangler hyperdrive update <ID> --origin-password=<NEW_PASSWORD>
Delete config npx wrangler hyperdrive delete <ID>

Connect with Postgres.js

Install dependencies first:

npm install postgres

Code:

import postgres from "postgres";

export interface Env {
  // If you set another name in the Wrangler config file as the value for 'binding',
  // replace "HYPERDRIVE" with the variable name you defined.
  HYPERDRIVE: Hyperdrive;
}

export default {
  async fetch(request, env, ctx): Promise<Response> {
    // Create a database client that connects to your database via Hyperdrive.
    //
    // Hyperdrive generates a unique connection string you can pass to
    // supported drivers, including node-postgres, Postgres.js, and the many
    // ORMs and query builders that use these drivers.
    const sql = postgres(env.HYPERDRIVE.connectionString);

    try {
      // Test query
      const results = await sql`SELECT * FROM pg_tables`;

      // Return result rows as JSON
      return Response.json(results);
    } catch (e) {
      console.error(e);
      return Response.json(
        { error: e instanceof Error ? e.message : e },
        { status: 500 },
      );
    }
  },
} satisfies ExportedHandler<Env>;

Read the full file on GitHub · 251 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. 2d ago First seen · 251 lines · 49 tokens per session scan A 1e26cad3c8f0

Subscribe to this mod's changes

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

Related

Other skills, from other repositories

bigquery-ai-ml

Leverages BigQuery's built-in machine learning and GenAI capabilities for advanced data analytics. Use when you need to write SQL queries that perform time-series forecasting, predict values, detect outliers or anomalies, find key drivers, perform semantic search or vector search, classify text, calculate similarity…

google/skills · 104 tokens

moderator-page-migration

Port a moderator page from the main Next.js app (src/pages/moderator/) into apps/moderator. Use when asked to migrate, move or cut over a /moderator/ page to the spoke, or to port its tRPC procedures and Prisma services to SvelteKit loads/actions and Kysely.

civitai/civitai · 71 tokens

prisma-upgrade-v7

Complete migration guide from Prisma ORM v6 to v7 covering all breaking changes. Use when upgrading Prisma versions, encountering v7 errors, or migrating existing projects. Triggers on "upgrade to prisma 7", "prisma 7 migration", "prisma-client generator", "driver adapter required".

nitrocloudofficial/nitrostack · 67 tokens

ddia-systems

Design data systems by understanding storage engines, replication, partitioning, transactions, and consistency models. Use when the user mentions "database choice", "which database should I use", "SQL or NoSQL", "replication lag", "partitioning strategy", "consistency vs availability", "stream processing", "ACID…

wondelai/skills · 138 tokens

sqlitecpp-update-sqlite

How to update the bundled SQLite3 amalgamation (sqlite3/sqlite3.c and sqlite3.h), the Meson wrap, README.md, and CHANGELOG.md. Use when upgrading SQLite, refreshing the vendored amalgamation, or bumping the sqlite3 wrap.

SRombauts/SQLiteCpp · 61 tokens

dsql

Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, FK…

awslabs/agent-plugins · 227 tokens