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 skills/stefan-jansen/claude-code-toolkit/sql-optimizationnpx skills add stefan-jansen/claude-code-toolkit --skill sql-optimizationgit clone --depth 1 https://github.com/stefan-jansen/claude-code-toolkitWhat 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.00078 | $0.04573 |
| Opus 5 | $0.00039 | $0.02286 |
| Sonnet 5 | $0.00016 | $0.00915 |
| Haiku 4.5 | $0.00008 | $0.00457 |
Grade A, and why
sql-optimization 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 yesterday.
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 — 736 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SQL Query Optimization Patterns
Comprehensive guide to optimizing SQL queries for performance, including EXPLAIN plan analysis, index design strategies, query rewriting patterns, and N+1 query detection. Works across PostgreSQL, MySQL, and SQLite.
Quick Reference
When to use this skill:
- Slow database queries (>100ms for simple queries, >1s for complex)
- High database CPU usage
- Analyzing EXPLAIN plans
- Designing database indexes
- Debugging N+1 query problems
- Optimizing JOIN operations
- Reducing table scans
Common triggers:
- "This query is too slow"
- "How do I optimize this SQL"
- "What indexes should I add"
- "Explain this EXPLAIN plan"
- "Fix N+1 queries"
- "Database CPU at 100%"
Typical improvements:
- 3 seconds → 50ms (60x faster)
- Full table scan → Index scan
- 1000 queries → 2 queries (N+1 elimination)
Part 1: Understanding EXPLAIN Plans
Reading PostgreSQL EXPLAIN
EXPLAIN ANALYZE
SELECT u.name, p.title
FROM users u
JOIN posts p ON u.id = p.user_id
WHERE u.created_at > '2024-01-01'
ORDER BY p.created_at DESC
LIMIT 10;
Key Metrics to Watch:
- Seq Scan (bad): Full table scan, reads every row
- Index Scan (good): Uses index, reads only needed rows
- Cost: Estimated computational cost (lower is better)
- Actual time: Real execution time in milliseconds
- Rows: Number of rows processed at each step
Bad EXPLAIN Example
Seq Scan on users u (cost=0.00..1234.00 rows=1000 width=50)
(actual time=0.123..45.678 rows=950 loops=1)
Filter: (created_at > '2024-01-01'::date)
Rows Removed by Filter: 50000
Planning Time: 0.234 ms
Execution Time: 3456.789 ms
Problems:
- Seq Scan: Reading entire table (50,950 rows)
- Rows Removed by Filter: Filtering after reading (wasteful)
- Execution Time: 3.5 seconds (way too slow)
Good EXPLAIN Example (After Index)
Index Scan using users_created_at_idx on users u
(cost=0.29..123.45 rows=950 width=50)
(actual time=0.012..3.456 rows=950 loops=1)
Index Cond: (created_at > '2024-01-01'::date)
Planning Time: 0.123 ms
Execution Time: 4.567 ms
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.
- yesterday First seen · 736 lines · 0 tokens per session scan A 23861c016b6c
sql-optimization is a skill published in the GitHub repository stefan-jansen/claude-code-toolkit (85 stars, last pushed 1mo ago), licensed MIT. It adds 78 tokens to every session and 4,573 once invoked, about $0.0004 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 skills, from other repositories
playwright
Use when the task requires capturing or automating a real browser from the terminal.
implementation-final-review
Perform the repository's risk-tiered independent final review before implementation completion. Use only when explicitly invoked or when repository instructions require it after behavior-impacting implementation work; audit the complete task diff, supported contracts, lifecycle and security boundaries, complexity, and…
code-change-verification
Run the mandatory verification stack when changes affect runtime code, tests, or build/test behavior in the OpenAI Agents Python repository.
prior-auth-packet-builder
Build a concise prior authorization packet from local case files and payer policy docs.
pdf-processing
Process and extract information from PDF documents. Use this skill when the user asks to read, analyze, or extract data from PDF files.
document-service
This skill should be used when the user asks to "analyze this codebase", "document this service", "generate technical docs", "I inherited this code", "help me understand this system", "create docs for this project", "what does this system look like", "onboard me to this codebase", "this codebase has no docs"…