Find database bottlenecks, with the evidence to fix them.
A desktop app and CLI for database performance analysis on macOS, Linux and Windows.
Download · Quick start · Features · Providers · Agents & CI · Guide · Website
Culprit brings query statistics, execution plans, waits and schema context into one workflow. It ranks findings by impact and connects each one to evidence, a suggested fix and verification steps. Use it from the desktop app, terminal or a coding agent.
Download the desktop app or standalone CLI. In the app, add a connection or open a SQLite file to see its dashboard.
From the terminal:
culprit conn add shop --env staging --url 'postgres://app@db.example.com:5432/shop'
culprit scan shop
culprit dashboard shopReopening a connection shows its saved report while a fresh scan runs in the background. The desktop app offers signed updates; update the standalone CLI with culprit update.
Try the interface with demo data
With Bun installed:
git clone https://github.com/culpritsql/culprit-sql-studio.git
cd culprit-sql-studio/app
bun install --frozen-lockfile
bun run devThe browser demo uses included snapshots and needs no database connection.
| Provider | Sources and capabilities |
|---|---|
| SQL Server / Azure SQL | Query Store, plan cache, DMVs and retained deadlock events |
| PostgreSQL / Amazon RDS | pg_stat_statements, catalog/statistics views, EXPLAIN and hypothetical indexes through HypoPG |
| TimescaleDB | PostgreSQL sources plus hypertable sizes and managed/compressed chunks |
| YugabyteDB | Native YSQL/DocDB counters, DIST plans, sharding and scoped activity sources |
| MySQL | performance_schema, sys, EXPLAIN and the slow query log |
| MariaDB | Performance schema, slow log, user statistics, MariaDB plans and lock views |
| SQLite | Read-only file inspection, EXPLAIN QUERY PLAN and framework query logs |
Features depend on the engine, enabled sources and your login’s permissions. Missing sources appear with a reason and setup guidance. See Engine parity for the feature comparison and verified versions.
Each finding identifies the affected queries, the measurement window and the evidence behind its severity. Open it for a suggested change, SQL to copy when applicable, verification steps and a brief to share with a teammate or coding agent.
| Area | Examples of what Culprit checks |
|---|---|
| Query performance | Expensive joins, plan regressions, parameter-sensitive plans, index-blocking type conversions, N+1 patterns, failures, timeouts and spills |
| Indexes and schema | Missing, unused, duplicate and overlapping indexes; unindexed foreign keys; partition hazards |
| Maintenance and capacity | Stale statistics, dead tuples, table bloat, large rows, sequence exhaustion and transaction-ID wraparound risk |
| Database health | Hot rows, table-lock escalation, storage latency, page checksum corruption, connection churn, replication lag and settings |
For example, the SQL Server demo includes a plan making 1.5 billion row comparisons. The affected query accounts for 27% of database time over five hours. Culprit identifies its forced loop-join hint, suggests removing it, and gives steps to compare the new plan and verify the result.
Run culprit checks for the complete check list and required capabilities.
Explore plans as a diagram, an indented tree or an operations table. Insights explain expensive lookups, row-estimate errors, inefficient joins, spills, conversions, memory grants and parallelism, with links to the relevant operators.
Inspect estimated and actual rows, operator properties and raw XML or JSON. Measure supported read statements explicitly. On SQL Server, inspect the retained last actual plan without re-running a query, or watch a running query’s operator progress when that evidence is available.
Drag across the database-time chart to compare two periods: queries that got slower, new queries, improvements and statements that stopped running. See plan switches, schema or setting changes, restarts and deploy marks alongside those changes.
Cloud metrics add context such as Amazon RDS CPU credits, I/O limits and Azure tier limits, using your existing aws or az sign-in.
Paste, drop or open a plan from another tool: SQL Server .sqlplan, PostgreSQL EXPLAIN text or JSON, YugabyteDB DIST output, or MySQL/MariaDB plans. Compare two versions with synchronized diagrams and highlighted changes in operators, access paths, row estimates and cost.
Comparisons also explain differences in captured parameters, statistics, parallelism and memory where the plans retain them. Share findings and plans as Markdown, a self-contained HTML page or a native plan file, with literal-value redaction enabled by default.
Follow blocking chains back to the session holding them up. Inspect waits, long-running statements and transactions left open by the application. Recorded deadlocks include the participating statements, the pattern and suggested next steps.
Live activity refreshes automatically and can be paused. On non-production connections, cancel a statement or end a session from the app or CLI.
| Feature | What it includes |
|---|---|
| Index advisor | Workload-based index candidates, duplicate/overlapping/unused indexes, and the write cost of keeping them |
| SQL editor | Persistent tabs, schema-aware completion, saved queries, estimated and measured plans, and inline migration warnings with quick fixes |
| Migration linter | Offline checks against saved snapshots; supported DDL rewrites for concurrent or online operations |
| Where time goes | Wait categories connected to queries, plus a live sample to compare with the recorded workload |
| Health signals | Memory, compiles, connections, row locks, per-file storage latency, replication and cloud limits |
| Schema explorer | Table sizes, indexes and usage; compare columns, indexes, foreign keys, triggers, constraints and partition bounds across environments, with SQL to reconcile differences |
| Connections | Connection strings and imports from Azure Data Studio, VS Code, DBeaver and DataGrip |
| Discovery and SSH | Find Azure and AWS databases with your CLI login; connect through an SSH jump host |
| Offline reports | Saved scans, trends, historical comparisons and shared snapshots you can inspect without a database connection |
| Keyboard navigation | A command palette (⌘K / Ctrl+K), view shortcuts, query tabs and actions |
| Languages | English, German, Spanish and French for the interface and human-readable CLI output |
The MCP server gives Claude Code, Cursor, Codex and other MCP clients access to findings, query plans, schema, migrations, blocking, waits, index advice and verification. Agents use saved connection names; credentials stay in Culprit.
claude mcp add culprit -- culprit mcp
culprit agent init --connection shopThe second command adds repository instructions and MCP configuration. Other clients can register culprit with the argument mcp directly. When query comments contain file:line references, including Marginalia and SqlCommenter annotations, finding briefs can point back to the application code.
Print a finding’s brief or test a proposed PostgreSQL index through HypoPG without creating the real index:
culprit show shop 'filtered-scan:public.orders'
culprit explain shop --sql "SELECT * FROM orders WHERE status = 'open'" \
--with-index "CREATE INDEX ON orders (status ASC)"Access is set per connection: off, statistics and estimated plans (the default), or approved read-only queries. Query approval shows the exact statement; tool calls are recorded in a local audit log.
Agent setup, permissions and audit details →
Check migration files against a saved snapshot’s table sizes, column types, indexes and recorded workload. Findings cover blocking CREATE INDEX and ALTER TABLE operations, missing or mismatched foreign-key indexes, and DROP or RENAME changes that affect recorded queries.
culprit lint-sql prod-snapshot.json --file migrations/ --fail-on high
culprit lint-sql prod-snapshot.json --file migrations/ --format sarif > culprit.sarifUse --fail-on high to fail CI on high-severity findings. --write applies supported rewrites to migration files. JSON supports scripts, SARIF supports code-review tooling, and stable finding IDs let you track the same problem across scans.
After deployment, mark the timeline, verify a finding or generate a redacted summary:
culprit mark shop deploy v2.4.0
culprit verify shop 'filtered-scan:public.orders'
culprit digest shop > digest.json- Scans read statistics and catalog views, with provider-specific timeouts and planning guards.
- Database fixes are suggestions for you to review and apply.
- Production execution requires confirmation for statements Culprit cannot classify as reads; destructive operations require an additional confirmation.
- Agent query access is opt-in, with approval for each read-only statement and a local audit trail.
- Saved passwords use the OS keychain. Entra ID can use your Azure sign-in; shareable exports redact literal values by default.
Use a database login with the permissions your workflow needs. The safety guide and provider documentation explain the collection, planning and execution boundaries.
Culprit is built with Rust, Tauri and React. The app, CLI and MCP server share one analysis engine. Add custom checks or database providers through the Rust API without forking; language catalogs supply the user-facing text.
Build from source
Install Rust stable and Bun. Linux also needs the platform dependencies.
git clone https://github.com/culpritsql/culprit-sql-studio.git
cd culprit-sql-studio
# CLI
cargo build --locked --release -p culprit-cli
# Desktop app
cd app
bun install --frozen-lockfile
bunx tauri build- Guide: every check and command, the agent setup, measured speed, safety details and how to extend Culprit
- Architecture: the analysis pipeline, the evidence rules every check follows and the crate map
- Design: how the product behaves and why
- Coding agents: MCP tools, permissions, approvals and the audit log
- Engine parity: feature comparison, provider guides, setup and verified versions
Culprit is open source under the MIT license.
Made for the people who get paged when the database is slow.