neon-realtime

neon-realtime is a skill for Claude Code from neondatabase/agent-skills. It costs 134 tokens per session (3,938 once invoked), scanned A, original, Apache-2.0.

A database feature for making SQL query results update as the underlying PostgreSQL data changes. It uses live connections so apps and agents can receive current rows without repeatedly asking for the same data.

In plain words
What is it for?
Use it for live dashboards, feeds, collaboration screens, multi-user or multi-device synchronisation, optimistic updates, and reactive agent state.
Why use it?
It removes much of the code needed to keep screens and agent state in sync with database changes. This is useful when several users or devices may change the same information.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import type { Message } from "../backend/schema".

Part of the neon plugin — 7 skills, 1 MCP server shipped together

Good fit Use it for live dashboards, feeds, collaboration screens, multi-user or multi-device synchronisation, optimistic updates, and reactive agent state.

Compare 6 skills from other repositories ↓
About the project

Neon Agent Skills is a collection of agent instructions, scripts, and resources for working with Neon’s cloud backend services built around Lakebase Postgres. Developers, startups, and agent platforms use it to guide work with databases, branches, authentication, storage, functions, and AI Gateway services.

neondatabase/agent-skills · 121 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/neondatabase/agent-skills
agentmods
npx agentmods add skills/neondatabase/agent-skills/neon-realtime

Made for: Claude Code.

Or install neon, the plugin that ships this one along with the rest of its 7 skills, 1 MCP server.

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 neon-realtime

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/neondatabase/agent-skills/neon-realtime"><img src="https://agentmods.dev/badge/skills/neondatabase/agent-skills/neon-realtime.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,938 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 7 Nov 2026
  • Snyk warn 18 Nov 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.00134 $0.03938
Opus 5.5 $0.00054 $0.01575
Sonnet 5.5 $0.00027 $0.00788
Haiku 4.5 $0.00013 $0.00394

Measured 13d ago against content hash 09ca758fb8b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

neon-realtime 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 13d 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.

plugins/neon-postgres/skills/neon-realtime/SKILL.md · 208 lines

How it starts

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

FIRST: Use the parent neon skill for a Neon overview, getting started with Neon, Neon development best practices, and more.

If the neon skill is not installed, fetch it from https://neon.com/docs/ai/skills/neon/SKILL.md or install it with:

neon skills -s neon -y

Neon Realtime

Neon's Realtime makes any SQL query live. Subscribe in realtime to your Lakebase Postgres database. Develop apps and agents with end-to-end reactivity using type-safe live queries and optimistic mutations.

Realtime is new and in beta, so its APIs aren't in your training data. Start from the core pattern below, and read each section's reference file before writing that code.

How It Works

Realtime's layers compose: a live query engine inside Postgres, the Live SQL API (a WebSocket API), lower-level client SDKs (seal(), subscribe()), and reactivity primitives such as useLiveQuery.

  1. In trusted backend code, define a live query (any read-only SQL, including joins, aggregates, ordering and limits), seal it with NEON_REALTIME_SECRET and expose it from an authenticated endpoint or server function. The client can't read or change a sealed query's SQL or parameters.
  2. The client subscribes with the sealed query. It receives the full initial result, then each committed transaction's changes as one batch. Results stay consistent, but delivery of every change event isn't guaranteed.
  3. Writes go through your own API, which returns each write's txid for awaitTxId().

Core Pattern

The guides' chat app, with messages authorized through channel_members. The backend seals the query and returns each write's txid:

import { createRealtime, rawSql } from "@neon/realtime/server"
import { drizzleAdapter } from "@neon/realtime-drizzle"
import { and, desc, eq, getTableColumns, sql } from "drizzle-orm"
import { Hono } from "hono"
import { HTTPException } from "hono/http-exception"
import { requireUser } from "./auth"
import { db } from "./db"
import { channelMembers, messages, type Message } from "./schema"

export const realtime = createRealtime({ secret: process.env.NEON_REALTIME_SECRET!, db: "neondb", adapter: drizzleAdapter() })

// Each selected key must match its column name
export function messagesQuery(userId: string, channelId: number) {
  return db
    .select(getTableColumns(messages)).from(messages)
    .innerJoin(channelMembers, eq(channelMembers.channel_id, messages.channel_id))
    .where(and(eq(channelMembers.user_id, userId), eq(messages.channel_id, channelId)))
    .orderBy(desc(messages.created_at))
    .limit(50)
}

// Or raw SQL
const rawMessagesQuery = (userId: string, channelId: number) => rawSql<Message>(
    `SELECT messages.author_id, messages.body, messages.channel_id, messages.created_at, messages.id FROM messages
     INNER JOIN channel_members ON channel_members.channel_id = messages.channel_id WHERE channel_members.user_id = $1 AND messages.channel_id = $2 ORDER BY messages.created_at DESC LIMIT 50`,
    [userId, channelId]
  )

// The id of the transaction that made the change, read in the write's own RETURNING
const txid = sql<string>`pg_current_xact_id()::text`

const app = new Hono()
  .post("/api/v1/messages/live", async (c) => {
    const user = await requireUser(c)
    const { channelId } = await c.req.json<{ channelId: number }>() // validate input
    return c.json(await realtime.seal({ query: messagesQuery(user.id, channelId) }))
  })
  .post("/api/v1/messages", async (c) => {
    const user = await requireUser(c)
    const { id, channelId, body } = await c.req.json<{ id: string; channelId: number; body: string }>() // validate input
    // One statement. The membership row supplies channel_id and author_id, so only a member's message is inserted.
    // List every column in table order, alias each sql field, and cast untyped params (they resolve to text)
    const [sent] = await db.insert(messages).select(
      db.select({
          id: sql`${id}::uuid`.as("id"), channel_id: channelMembers.channel_id, author_id: channelMembers.user_id,
          body: sql`${body}`.as("body"), created_at: sql`now()`.as("created_at"),
        })
        .from(channelMembers)
        .where(and(eq(channelMembers.channel_id, channelId), eq(channelMembers.user_id, user.id)))
    ).returning({ txid })
    if (!sent) throw new HTTPException(403, { message: "Not a member of this channel" })
    return c.json({ kind: "committed", txid: sent.txid })
  })

Read the full file on GitHub · 208 lines

Files

What ships with it

5 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. 13d ago Changed · +1 lines 09ca758fb8b8
  2. 24d ago Changed 693efc15ec06
  3. 1mo ago First seen · 207 lines · 134 tokens per session scan A fb23ec04c630

Subscribe to this mod's changes

neon-realtime is a skill published in the GitHub repository neondatabase/agent-skills (121 stars, last pushed today), licensed Apache-2.0. It adds 134 tokens to every session and 3,938 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-15.

Related

neon-realtime compared with skills from other repositories

neon-realtime next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
neon-realtimeneondatabase/agent-skillsSkill121todayApache-2.0A134Claude Code
alloydb-basicsgoogle/skillsSkill25ktodayApache-2.0A72Claude Code, Codex
postgresql-table-designwshobson/agentsSkill43k2d agoMITA37Claude Code
db-repairgarrytan/gbrainSkill34ktodayMITA96Claude Code
dsqlawslabs/agent-pluginsSkill956yesterdayApache-2.0A247Claude Code
volcengine-rds-postgresqlbytedance/agentkit-samplesSkill496yesterdayApache-2.0A63Claude Code, Codex
postgresdbericrisco/rsc-harnessSkill695todayMITA91Claude Code, Codex