safeselect-sql

safeselect-sql is a skill for Claude Code, Codex from antonillos/safeselect. It costs 46 tokens per session (291 once invoked), scanned A, original, MIT.

Instructions for safely investigating SQL databases, including PostgreSQL. They cover discovering tables and columns, running limited read queries, explaining query plans, and checking PostgreSQL maintenance diagnostics.

In plain words
What is it for?
Use them to inspect schemas, run targeted SELECT queries, review EXPLAIN plans, diagnose type or column errors, and view recommendations for PostgreSQL maintenance.
Why use it?
They prevent guessed column names, unbounded reads, accidental query execution during analysis, and unauthorized database maintenance.

Skill for Claude CodeCodex

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

Good fit Use them to inspect schemas, run targeted SELECT queries, review EXPLAIN plans, diagnose type or column errors, and view recommendations for PostgreSQL maintenance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/antonillos/safeselect/safeselect-sql
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.

Any agent
npx skills add antonillos/safeselect --skill safeselect-sql
Clone the repo
git clone --depth 1 https://github.com/antonillos/safeselect

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 safeselect-sql

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/antonillos/safeselect/safeselect-sql"><img src="https://agentmods.dev/badge/skills/antonillos/safeselect/safeselect-sql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 291 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.
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.00046 $0.00291
Opus 5.5 $0.00018 $0.00116
Sonnet 5.5 $0.00009 $0.00058
Haiku 4.5 $0.00005 $0.00029

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

Security

Grade A, and why

safeselect-sql 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.

skills/safeselect-sql/SKILL.md · 24 lines

What it actually says

SafeSelect SQL investigation

  1. Call database_info if the backend is unknown.
  2. Call list_tables. If the user only wants available tables, report and stop.
  3. Choose one returned table_schema / table_name pair and call describe_table with those exact literal values. Never guess columns or pass wildcards.
  4. Use only discovered names and types for a small targeted select. Narrow input in WHERE and add a small LIMIT for row retrieval.
  5. For plans use explain, normally format: "json", analyze: false. Do not send EXPLAIN through select. ANALYZE executes the query: use it only within an explicitly requested performance investigation and a bounded scope.
  6. For PostgreSQL questions about tables needing ANALYZE or VACUUM, call get_maintenance_diagnostics. Report recommendations; never run maintenance.

Read query recipes and recovery for errors, JSON types and performance. Follow server suggestions within read-only policy; never disable validation or increase limits automatically.

Files

What ships with it

1 file 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 · 24 lines · 46 tokens per session scan A 9f73c83a6d23

Subscribe to this mod's changes

safeselect-sql is a skill published in the GitHub repository antonillos/safeselect (0 stars, last pushed 2d ago), licensed MIT. It adds 46 tokens to every session and 291 once invoked, about $0.0002 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-24.

Related

Other skills, from other repositories

diesel-guard

Lints Diesel and SQLx Postgres migrations for unsafe schema changes that lock tables or cause downtime, and authors custom Rhai checks. Use when reviewing, writing, or fixing SQL migrations, when diesel-guard reports a violation, when configuring diesel-guard.toml, or when the user mentions migration safety, table…

ayarotsky/diesel-guard · 77 tokens

database

Query and manage SQLite, PostgreSQL, and MySQL databases from the command line. Use when the user asks to run SQL queries, inspect database schemas, create or alter tables, import or export data, manage indexes, analyze query performance with EXPLAIN, back up or restore databases, or perform CRUD operations via…

bug-ops/zeph · 76 tokens

cli-forge-data

Design and implement safe PostgreSQL database changes for Rust/SQLx applications. Use for new schemas, migrations, constraints, indexes, repositories, transaction boundaries, state machines, idempotency, concurrency control, queues, multi-tenancy, soft deletion, ledgers, outbox/inbox, repair jobs, or corrections…

Destynova2/cli-code-skills · 76 tokens

postgresql

A guide for administering PostgreSQL, a database system that stores application data and supports SQL queries. It covers connections, users and permissions, database objects, backups, extensions, and query optimisation.

chaterm/terminal-skills · 9 tokens

explorer

Build and modify Studio Explorer surfaces, including notebooks, chats, SQL snippets, query cells, and their shared toolbar patterns.

supabase/supabase · 27 tokens

postgresdb

Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…

ericrisco/rsc-harness · 91 tokens