introspect

introspect is a skill for Claude Code from Hainrixz/claude-db. It costs 104 tokens per session (804 once invoked), scanned A, original, MIT.

A read-only database inspection skill that checks database catalogs and, when available, live database details. Database catalogs describe structures such as tables, indexes, permissions, and extensions.

In plain words
What is it for?
Use it to inspect index use, foreign-key indexes, table and row sizes, row-level security, extensions, database version, and maintenance state; if access is unavailable, it reports that it needs an API.
Why use it?
It distinguishes facts visible in files from facts that can only be confirmed in a running database, without changing data or structure.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the claude-db plugin — 36 skills, 6 agents, 1 hook shipped together

Good fit Use it to inspect index use, foreign-key indexes, table and row sizes, row-level security, extensions, database version, and maintenance state; if access is unavailable, it reports that it needs an API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hainrixz/claude-db/introspect
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 Hainrixz/claude-db --skill introspect
Clone the repo
git clone --depth 1 https://github.com/Hainrixz/claude-db

Made for: Claude Code.

Or install claude-db, the plugin that ships this one along with the rest of its 36 skills, 6 agents, 1 hook.

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 introspect

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/hainrixz/claude-db/introspect"><img src="https://agentmods.dev/badge/skills/hainrixz/claude-db/introspect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 804 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.00104 $0.00804
Opus 5 $0.00052 $0.00402
Sonnet 5 $0.00021 $0.00161
Haiku 4.5 $0.00010 $0.00080

Measured 9d ago against content hash 8822de3dc08a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

introspect 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 9d 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/introspect/SKILL.md · 32 lines

How it starts

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

introspect (Tier-1 — live read-only)

Tier 0 reads files. Many checks need runtime truth a file cannot give: real index usage, FK-without-index joins, table/row sizes, RLS state, extensions, engine version, autovacuum/wraparound state. introspect is the only path to that, and it is read-only by contract. See references/data-tiers.md.

Connection path (prefer MCP)

  1. DB MCP server (preferred) — cleaner permission boundary. Use only read-class tools whose names match *query* / *read* / *list* / *describe* / *schema*. A generic write-capable query tool is routed through the same read-only validator below; a PreToolUse hook on mcp__.* backs this up. List available tools first; never call a tool that mutates.
  2. Else a least-privilege read-only connection string read from $DATABASE_URL in the environment — never echoed, never written into a finding. redactSecrets() scrubs any credential that reaches a finding, report, or log.
  3. Neither available → emit status: needs_api on every dependent check with the reason and the minimal grant needed. Never silently pass and never fabricate row counts, sizes, or plans.

Read-only contract (enforced before any query)

  • SET default_transaction_read_only = on;
  • a bounded statement_timeout (e.g. SET statement_timeout = '15s';).
  • only SELECT / EXPLAIN (no ANALYZE write side effects beyond plan) / catalog reads. Reject anything else.

Catalogs read (no row data)

  • Postgres: version(), information_schema, pg_catalog, pg_class, pg_index, pg_indexes, pg_constraint, pg_policies, pg_extension. Tier-2 adds pg_stat_user_indexes / pg_stat_user_tables, pg_stat_statements, age(datfrozenxid).
  • MySQL/MariaDB: information_schema (TABLES, STATISTICS, KEY_COLUMN_USAGE), SHOW ENGINE INNODB STATUS (read).
  • Mongo: db.stats(), $indexStats, $collStats (Tier-2).
  • Cassandra: system_schema, nodetool tablehistograms (Tier-2).

Effect on findings

A check answered with live evidence is upgraded to confidence: established and may therefore cap a score (e.g. confirmed int4/serial PK near exhaustion, TXID wraparound imminent, RLS off on a relied-on table). Without live access those same checks stay directional or become needs_api — they never cap on static signal alone. Every finding still conforms to schema/finding.schema.json; verification.reproduce references $DATABASE_URL, never a literal credential.

Read the full file on GitHub · 32 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. 9d ago First seen · 32 lines · 104 tokens per session scan A 8822de3dc08a

Subscribe to this mod's changes

introspect is a skill published in the GitHub repository Hainrixz/claude-db (19 stars, last pushed 2mo ago), licensed MIT. It adds 104 tokens to every session and 804 once invoked, about $0.0005 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.

Related

Other skills, from other repositories

dynamodb

Use when modeling or operating a DynamoDB table: deriving partition/sort keys from access patterns, single-table vs table-per-entity, adding a GSI/LSI, on-demand vs provisioned capacity, or diagnosing hot-partition throttling. NOT relational schema/SQL/EXPLAIN (that is postgresdb), NOT aggregation-pipeline document…

ericrisco/rsc-harness · 82 tokens

malloy-lookml-review

Analyze LookML files as prior art for Malloy modeling. Used during Step 1 (DISCOVER) when .lkml files are present. Coordinates reference files that extract business logic, relationships, and curation decisions. Works with or without a database connection.

malloydata/publisher · 58 tokens

convex-migrations

Schema migration strategies for evolving applications including adding new fields, backfilling data, removing deprecated fields, index migrations, and zero-downtime migration patterns.

waynesutton/convexskills · 35 tokens

database-design-patterns

Database schema design patterns and optimization strategies for relational and NoSQL databases. Use when designing database schemas, optimizing query performance, or implementing data persistence layers at scale.

NickCrew/Claude-Cortex · 37 tokens

database-sql

Design database schemas, write efficient SQL queries, create migrations, and optimize database performance. Use when working with databases, writing queries, or designing data models.

asgarovf/locusai · 35 tokens

data-design

Data modeling, schema design, and data architecture.

miles990/claude-software-skills · 12 tokens