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.
npx agentmods add instructions/nikolays/pgque/claude-mdgit clone --depth 1 https://github.com/NikolayS/PgQueWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02477 | $0.02477 |
| Opus 5 | $0.01239 | $0.01239 |
| Sonnet 5 | $0.00495 | $0.00495 |
| Haiku 4.5 | $0.00248 | $0.00248 |
Grade A, and why
PgQue CLAUDE.md 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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 209 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md -- PgQue
Project
PgQue (pgque) -- PgQ Universal Edition. Zero-bloat PostgreSQL queue repackaged from PgQ for managed database environments. Repo: NikolayS/pgque.
Naming Convention
pgque-- lowercase for schema, package names, CLI, repo, function prefixesPgQue-- capitalized form for prose, headings, README titles- Mirrors PostgreSQL ecosystem convention (pgmq, pg_cron, psycopg)
Architecture
Two-layer design:
- pgque-core: Productization of PgQ (rename, PG14+ modernization, pg_cron, security hardening, single-file install). Mechanical transformation of ~4,028 lines of proven PL/pgSQL.
- pgque-api: Modern convenience layer (send/receive/ack/nack, DLQ, delayed delivery). New code (~1,500 lines) that must reduce cleanly to PgQ primitives.
See blueprints/SPECx.md for the full specification.
See blueprints/SPEC.md for PgQ internals reference (rotation mechanics,
snapshot isolation, batch_event_sql algorithm, dual-filter optimization).
Stack
- Pure SQL + PL/pgSQL (no extensions, no
.controlfile) - Anti-extension design:
\i pgque.sqlto install - Works on RDS, Aurora, Cloud SQL, AlloyDB, Supabase, Neon, Crunchy Bridge
- Optional pg_cron for automated ticker and maintenance
- PostgreSQL 14+ required (uses
pg_snapshot,xid8)
Style Rules
These rules are the source of truth for agentic engineering in this repo. Agents and AI coding tools must read this file before making changes.
SQL Style
- Follow the Postgres.AI SQL style guide: https://gitlab.com/postgres-ai/rules/-/blob/main/rules/development__db-sql-style-guide.mdc The rules below restate its core plus pgque-specific additions; on any conflict, this file wins.
- Prefer C-style
/* ... */block comments for anything spanning 2+ lines; use--only for single-line comments. - Comments state what the code cannot: a constraint, a non-obvious
invariant, a concurrency hazard. Per-function headers and inline
comments say that in 1-3 lines; do NOT write per-function essays or
step-by-step narration alongside the code. One consolidated
design-notes block per file (or per section) is encouraged for the
bigger picture -- keep it C-style, and it may cite the spec
(
SPEC section 15). - Do NOT cite user-story or requirement IDs (
US-13.4,I2,G2) or other spec-process artifacts in code, and do not restate the spec at length. Longer rationale lives inblueprints/and the specs; a short pointer (SPEC section 15,see blueprints/...) is fine. - These style rules govern pgque-authored code only. The inherited PgQ engine (batch/tick/rotation and other repackaged PgQ internals) keeps its original comment style and is never restyled.
- Collapse single-argument keyword clauses onto one line (
select 1,from t,where x = y,into v); expand only multi-argument clauses, one argument per line. - Lowercase SQL keywords:
select,create function, notSELECT,CREATE FUNCTION snake_casefor all identifiers- Schema-qualify all internal references:
pgque.queue, not justqueue - Root SQL keywords must be left-aligned within the statement. Do not use
decorative vertical indentation like
select/from/whereshifted by different amounts. This is non-negotiable for generated and source SQL. - Put
and/orat the start of continuation lines, aligned under the statement'swhereclause indentation. - All
SECURITY DEFINERfunctions MUST includeSET search_path = pgque, pg_catalog - Use
xid8for transaction ID columns,pg_snapshotfor snapshot columns - Use modern PG14+ function names:
pg_current_xact_id()nottxid_current()
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.
- 3d ago First seen · 209 lines · 2,477 tokens per session scan A 61f1a6370018
PgQue CLAUDE.md is an instructions file published in the GitHub repository NikolayS/PgQue (1,813 stars, last pushed 8d ago), licensed Apache-2.0. It adds 2,477 tokens to every session, about $0.0124 per session on Opus 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-08-30.
Other instructions, from other repositories
MCP-PostgreSQL-Ops copilot-instructions.md
Instructions for call518/MCP-PostgreSQL-Ops, covering architecture overview, core components, key patterns, in functions.py and development workflows.
expense-budget-tracker AGENTS.md
Instructions for kirill-markin/expense-budget-tracker, covering expense-budget-tracker, rules, components, supported clients and key paths.
pgmnemo AGENTS.md
Instructions for pgmnemo/pgmnemo, covering pgmnemo — agent integration guide, 1. what pgmnemo is — and the problem it solves, the problem, architectural consequences and 2. when to adopt / when not to.
ai-dba-workbench CLAUDE.md
Claude Code instructions for pgEdge/ai-dba-workbench, covering claude standing instructions, primary agent role, trivial-edit carve-out, project structure and key files.
bun-pg-mcp AGENTS.md
AGENTS.md instructions for igoraguiar/bun-pg-mcp, covering agents.md, project context, tech stack, directory map and commands.
neon-mcp-server CLAUDE.md
Claude Code instructions for voyagi/neon-mcp-server, covering neon mcp server — upwork portfolio project, purpose, what to build, demo scenario: "techstart crm" and value proposition.