postgres

postgres is a skill for Claude Code, Codex from w95/awesome-claude-corporate-skills. It costs 79 tokens per session (918 once invoked), scanned B, a copy of mssql, MIT.

A read-only tool for running SQL queries against configured PostgreSQL databases. PostgreSQL is a database system used to store and retrieve application data.

In plain words
What is it for?
Use it to explore database schemas and tables, run SELECT queries, and check data across multiple PostgreSQL connections.
Why use it?
It lets you inspect and analyze database contents while preventing queries from changing the stored data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/query.py --list.

Good fit Use it to explore database schemas and tables, run SELECT queries, and check data across multiple PostgreSQL connections.

Compare 6 skills from other repositories ↓
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/w95/awesome-claude-corporate-skills
agentmods
npx agentmods add skills/w95/awesome-claude-corporate-skills/postgres

Made for: Claude Code, Codex.

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 postgres

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/w95/awesome-claude-corporate-skills/postgres"><img src="https://agentmods.dev/badge/skills/w95/awesome-claude-corporate-skills/postgres.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 918 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod 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.00079 $0.00918
Opus 5 $0.00039 $0.00459
Sonnet 5 $0.00016 $0.00184
Haiku 4.5 $0.00008 $0.00092

Measured 8d ago against content hash 64daa7590591, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade B, and why

postgres scanned grade B 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 8d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

chmod 600 connections.json
Origin

This is a copy

89% identical to mssql — 40 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

10-data-analytics/postgres/SKILL.md · 130 lines

How it starts

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

PostgreSQL Read-Only Query Skill

Execute safe, read-only queries against configured PostgreSQL databases.

Requirements

  • Python 3.8+
  • psycopg2-binary: pip install -r requirements.txt

Setup

Create connections.json in the skill directory or ~/.config/claude/postgres-connections.json.

Security: Set file permissions to 600 since it contains credentials:

chmod 600 connections.json
{
  "databases": [
    {
      "name": "production",
      "description": "Main app database - users, orders, transactions",
      "host": "db.example.com",
      "port": 5432,
      "database": "app_prod",
      "user": "readonly_user",
      "password": "your-password",
      "sslmode": "require"
    }
  ]
}

Config Fields

Field Required Description
name Yes Identifier for the database (case-insensitive)
description Yes What data this database contains (used for auto-selection)
host Yes Database hostname
port No Port number (default: 5432)
database Yes Database name
user Yes Username
password Yes Password
sslmode No SSL mode: disable, allow, prefer (default), require, verify-ca, verify-full

Usage

List configured databases

python3 scripts/query.py --list

Query a database

python3 scripts/query.py --db production --query "SELECT * FROM users LIMIT 10"

List tables

python3 scripts/query.py --db production --tables

Show schema

python3 scripts/query.py --db production --schema

Limit results

python3 scripts/query.py --db production --query "SELECT * FROM orders" --limit 100

Database Selection

Match user intent to database description:

User asks about Look for description containing
users, accounts users, accounts, customers
orders, sales orders, transactions, sales
analytics, metrics analytics, metrics, reports
logs, events logs, events, audit

Read the full file on GitHub · 130 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. 8d ago First seen · 130 lines · 79 tokens per session scan B 64daa7590591

Subscribe to this mod's changes

postgres is a skill published in the GitHub repository w95/awesome-claude-corporate-skills (198 stars, last pushed 6mo ago), licensed MIT. It adds 79 tokens to every session and 918 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). It is 89% identical to mssql, differing in 40 lines, and is treated as a copy.

Related

Other skills, from other repositories

azure-postgres-ts

Connect to Azure Database for PostgreSQL Flexible Server from Node.js/TypeScript using the pg (node-postgres) package.

tmolavi/mcp-agent-skills-hub · 30 tokens

database-patterns

DB schema design and query tuning: normalization, indexing, N+1, transactions, EXPLAIN. Triggers: schema, index, slow query, N+1, PostgreSQL, MySQL, EXPLAIN, deadlock, query plan.

softspark/ai-toolkit · 55 tokens

pg-migration

PostgreSQL schema migration safety reviewer and DDL generator. ALWAYS use when writing, reviewing, or planning PostgreSQL schema changes — ALTER TABLE, CREATE/DROP INDEX, column type changes, constraint additions, RLS policy changes, or any DDL touching production tables. Covers lock-level analysis, CREATE INDEX…

johnqtcg/awesome-skills · 135 tokens

postgres-expert

Administration et optimisation PostgreSQL — diagnostic de performance, indexation, partitioning, tuning mémoire, VACUUM, backup/restore, JSONB, réplication. Se déclenche avec "PostgreSQL", "Postgres", "pgstat", "JSONB", "partitioning", "VACUUM", "pgdump. Also triggers on "PostgreSQL performance", "Postgres index"…

khalilbenaz/claude-skills-collection · 98 tokens

azure-resource-manager-mysql-dotnet

Azure MySQL Flexible Server SDK for .NET. Database management for MySQL Flexible Server deployments.

tmolavi/mcp-agent-skills-hub · 27 tokens

claimable-postgres

Provision instant temporary Postgres databases via Claimable Postgres by Neon (pg.new). No login or credit card required. Use for quick Postgres environments and throwaway DATABASEURL for prototyping.

tmolavi/mcp-agent-skills-hub · 44 tokens