Skip to main content
subagent CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/mysql-expert.md
Open on GitHub

What 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.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

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

Similar subagents

All subagents for Data and databases →

From the same set137

The whole set →
vector-db-expert vector-db-expert handles vector database work: indexing, similarity search, embeddings, dimension reduction. Useful when vector queries get slow or the dataset outgrows the setup. CX Codex ★ 1,029repo stars pandas-expert pandas-expert — a subagent for data manipulation and analysis with Python pandas, focusing on vectorized operations and memory-efficient data types. CX Codex ★ 1,029repo stars rollup-expert rollup-expert helps configure Rollup builds for JavaScript projects, including plugins, chunk splitting, output formats, and source maps. CX Codex ★ 1,029repo stars celery-expert celery-expert — a Celery-focused subagent: task queues, retries, worker tuning, RabbitMQ and Redis brokers. Useful when jobs pile up or fire twice. CX Codex ★ 1,029repo stars mqtt-expert The mqtt-expert subagent helps design MQTT topics, choose QoS levels, and troubleshoot client-broker messaging. Use it for IoT communication and MQTT reviews. CX Codex ★ 1,029repo stars express-expert express-expert is a Claude Code subagent for building Express.js web apps with routes, middleware, and error handling. It activates for API, security, and configuration work. CX Codex ★ 1,029repo stars dart-expert dart-expert writes idiomatic Dart code optimized for the Dart VM and Flutter cross-platform projects. Helps with null safety, async logic, and testing. CX Codex ★ 1,029repo stars go-expert go-expert — a Go-focused subagent for reviewing code, concurrency, tests, and performance. Use it when building or maintaining a Go project. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open