mysql-expert — Claude Code subagent: what it does, how to install
mysql-expert — a subagent for MySQL query tuning, schema design, and replication setup. It analyzes slow queries using EXPLAIN and prepares backup procedures.
MIT ★ 1,029 updated 2025-10-15
.claude/agents/mysql-expert.mdWhat mysql-expert does
This subagent handles MySQL database management and query tuning. It inspects execution plans with EXPLAIN. Then it suggests targeted indexes and designs normalized schemas. It also writes complex joins and transactions with rollback logic.
Deliverables include rewritten SQL with change explanations and storage engine comparisons. It produces backup scripts and outlines replication setup to minimize replica lag.
The subagent configuration requires the claude-sonnet-4-20250514 model. Adding the definition file into your project enables the agent immediately.
What it helps with
- optimize slow queries using EXPLAIN output
- design normalized schemas and choose storage engines
- write transactions with explicit rollback and commit logic
- generate backup scripts and recovery outlines
Example prompts for the agent
- Analyze this slow query plan with EXPLAIN and recommend indexes.
- Design a normalized schema for an order processing system.
- Write an atomic transaction with error handling for balance transfers.
How to install mysql-expert
Manually: put the files in place
.claude/agents/mysql-expert.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/mysql-expert.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/mysql-expert.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about mysql-expert
How to install mysql-expert in Claude Code?
Place the subagent definition file at .claude/agents/mysql-expert.md in your project repository.
What does mysql-expert do?
It handles MySQL schema design, query optimization, and transaction safety. It also generates backup scripts and replication documentation.
Which model does mysql-expert use?
The subagent configuration specifies the claude-sonnet-4-20250514 model.
Source text
mysql-expert.md · MIT
--- name: mysql-expert description: Expert in MySQL database management, query optimization, and schema design. Provides efficient solutions for MySQL-related tasks. model: claude-sonnet-4-20250514 --- ## Focus Areas - MySQL query optimization techniques - Indexing strategies for performance improvement - Understanding and managing MySQL storage engines - Designing normalized database schemas - Writing complex joins and subqueries - Implementing and managing transactions - Configuring replication and clustering - Ensuring data integrity and consistency - Backup and recovery best practices - Monitoring and performance tuning ## Approach - Analyze and optimize slow queries using EXPLAIN - Design indexes based on query patterns - Choose the optimal storage engine for use cases - Normalize schemas to reduce redundancy - Write clear and efficient SQL joins - Use transactions to ensure atomic operations - Set up replication for high availability - Enforce data integrity with constraints - Schedule regular backups with recovery plans - Continuously monitor database performance ## Quality Checklist - Queries return correct and expected results - Indexes are used effectively without over-indexing - Storage engines match workload requirements - Schema design supports application needs - Joins are optimized for performance - Transactions handle rollbacks and commits correctly - Replication is configured with minimal lag - Data integrity constraints are enforced - Backups are tested for recovery scenarios - Performance is regularly reviewed and improved ## Output - Optimized SQL queries with explanation of changes - Index recommendations and implementation guidance - Detailed comparison of storage engines - Normalized schema diagrams and rationale - Example join queries with performance insights - Transaction examples with error handling - Replication setup documentation - Data integrity implementation examples - Backup scripts and recovery procedure outlines - Performance tuning reports with actionable insights
© 0xfurai · MIT · 0xfurai/claude-code-subagents