sql-server-tuner

sql-server-tuner is a skill for Claude Code, Codex from khalilbenaz/claude-skills-collection. It costs 60 tokens per session (2,432 once invoked), scanned A, original, MIT.

A guide to diagnosing and administering Microsoft SQL Server, including query plans, indexes, memory, tempdb, and high-availability replication.

In plain words
What is it for?
Use it to collect a baseline, inspect wait statistics, analyze execution plans, tune T-SQL queries, and review Always On or tempdb issues.
Why use it?
It helps locate the server resources or database operations responsible for slow performance before changing configuration.

Skill for Claude CodeCodex

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

Good fit Use it to collect a baseline, inspect wait statistics, analyze execution plans, tune T-SQL queries, and review Always On or tempdb issues.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khalilbenaz/claude-skills-collection/sql-server-tuner
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 khalilbenaz/claude-skills-collection --skill sql-server-tuner
Clone the repo
git clone --depth 1 https://github.com/khalilbenaz/claude-skills-collection

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 sql-server-tuner

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/sql-server-tuner"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/sql-server-tuner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,432 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00060 $0.02432
Opus 5 $0.00030 $0.01216
Sonnet 5 $0.00012 $0.00486
Haiku 4.5 $0.00006 $0.00243

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

Security

Grade A, and why

sql-server-tuner 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.

database-skills/sql-server-tuner/SKILL.md · 203 lines

How it starts

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

SQL Server Tuner

Workflow en étapes

1. Baseline — Collecter les informations système

Avant tout diagnostic, fixer le contexte :

-- Version, édition, mémoire configurée
SELECT @@VERSION;
SELECT name, value_in_use FROM sys.configurations
WHERE name IN ('max server memory (MB)', 'cost threshold for parallelism',
               'max degree of parallelism', 'optimize for ad hoc workloads');

-- Taille et état de chaque base
SELECT name, state_desc, log_reuse_wait_desc,
       CAST(size * 8.0 / 1024 AS INT) AS size_MB
FROM sys.databases ORDER BY size DESC;

2. Identifier les goulets — Wait Stats

Point d'entrée systématique : les wait stats expliquent 80 % des lenteurs.

-- Top 10 waits (hors idle)
SELECT TOP 10 wait_type,
       waiting_tasks_count,
       CAST(wait_time_ms / 1000.0 AS DECIMAL(10,2)) AS wait_sec,
       CAST(signal_wait_time_ms * 100.0 / wait_time_ms AS DECIMAL(5,2)) AS pct_signal
FROM sys.dm_os_wait_stats
WHERE wait_type NOT IN (
    'SLEEP_TASK','BROKER_TO_FLUSH','BROKER_EVENTHANDLER','WAITFOR',
    'SLEEP_DBSTARTUP','DISPATCHER_QUEUE_SEMAPHORE','XE_TIMER_EVENT',
    'SQLTRACE_BUFFER_FLUSH','CLR_QUANTUM_TASK','HADR_WORK_QUEUE',
    'LOGMGR_QUEUE','REQUEST_FOR_DEADLOCK_SEARCH','SNI_HTTP_ACCEPT',
    'ONDEMAND_TASK_MANAGER','SERVER_IDLE_CHECK','SLEEP_MASTERDBREADY',
    'FT_IFTS_SCHEDULER_IDLE_WAIT','XE_DISPATCHER_WAIT','ASYNC_NETWORK_IO',
    'SLEEP_TEMPDBSTARTUP','DBMIRROR_EVENTS_QUEUE')
ORDER BY wait_time_ms DESC;

Critères de décision rapide :

Wait type Cause probable Action
PAGEIOLATCH_SH/EX I/O disque, manque de mémoire Augmenter max server memory, vérifier PLE
LCK_M_* Contention de verrous Analyser requêtes bloquantes, envisager RCSI
CXPACKET / CXCONSUMER Parallelisme excessif Ajuster MAXDOP, cost threshold
RESOURCE_SEMAPHORE Pression mémoire sur grants Requêtes avec sort/hash coûteux, revoir index
WRITELOG I/O log lent Déplacer LDF sur SSD dédié

Read the full file on GitHub · 203 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 · 203 lines · 60 tokens per session scan A d2af3caae7e7

Subscribe to this mod's changes

sql-server-tuner is a skill published in the GitHub repository khalilbenaz/claude-skills-collection (22 stars, last pushed 19d ago), licensed MIT. It adds 60 tokens to every session and 2,432 once invoked, about $0.0003 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-09-03.

Related

Other skills, from other repositories

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

migration-patterns

Zero-downtime DB migrations: expand-contract, double-write, backfill, blue-green. Triggers: migration, schema change, backfill, ALTER TABLE, online DDL.

softspark/ai-toolkit · 41 tokens

migrate

Run/create DB migrations (Alembic, Prisma, Laravel, Django, Flyway, Drizzle); checks backup. Triggers: apply migration, rollback, generate migration.

softspark/ai-toolkit · 38 tokens

mongo-migration

MongoDB schema migration safety reviewer and migration script generator. ALWAYS use when writing, reviewing, or planning MongoDB schema changes — field additions/removals, index builds, schema validator changes, document type migrations, shard key modifications, or any bulk update touching production collections.…

johnqtcg/awesome-skills · 140 tokens

mysql-migration

MySQL schema migration safety reviewer and DDL generator. ALWAYS use when writing, reviewing, or planning MySQL schema changes — ALTER TABLE, CREATE/DROP INDEX, column type changes, charset conversions, data backfills, or any DDL touching production tables. Covers online DDL algorithm selection (INSTANT/INPLACE/COPY)…

johnqtcg/awesome-skills · 132 tokens

oracle-migration

Oracle Database schema migration safety reviewer and DDL generator. ALWAYS use when writing, reviewing, or planning Oracle schema changes — ALTER TABLE, CREATE/DROP INDEX, column type changes, constraint additions, partition DDL, or any DDL touching production tables. Covers DDL auto-commit implications…

johnqtcg/awesome-skills · 141 tokens