Skip to main content
subagent CX Codex

sqlite-expert — Claude Code subagent: what it does, how to install

sqlite-expert reads query plans, picks indexes and reworks the schema when a SQLite database starts to drag on big tables.

MIT ★ 1,029 updated 2025-10-15

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

What sqlite-expert does

The agent looks at how tables are built and how queries hit them, then names the slow spot: a missing index, a join that scans everything, a write stuck behind a lock. PRAGMA settings and VACUUM belong to its everyday kit.

It ships as one markdown file, .claude/agents/sqlite-expert.md, split into focus areas, approach, a quality checklist and an output format. Typical results are a revised schema, before-and-after query plans, maintenance scripts for vacuuming and tests covering the queries it touched. Triggers get a short leash here: the agent keeps them rare on purpose, since they make a schema harder to follow.

Every statement it writes is parameterised, which is how injection stays out of the picture. Encryption options and access rules sit on the same checklist. Backups of the database file come up as a separate item, before anyone runs compaction or rebuilds an index.

What it helps with

  • read a query plan and find why a SELECT crawls
  • drop indexes nothing uses and add the ones that matter
  • fit a schema around SQLite's limits
  • shrink a bloated database file with VACUUM
  • swap string-built SQL for parameterised statements

Example prompts for the agent

  • Check the query plan for orders.db and tell me why the date filter does a full scan.
  • Which indexes on events are unused, and what should replace them?
  • Write a maintenance script that vacuums the database and copies the file every week.

How to install sqlite-expert

Manually: put the files in place

.claude/agents/sqlite-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 sqlite-expert

How do I install sqlite-expert in Claude Code?

Copy sqlite-expert.md into .claude/agents/ at the root of your project. Claude loads subagents from that folder.

What does sqlite-expert do?

It hunts for slow spots in a SQLite database: reads execution plans, checks indexes and schema design, and suggests changes to transactions and storage.

What comes back from a run?

A schema with indexes and views, execution plans, maintenance scripts such as vacuum, a test suite and a report on database health.

Source text

sqlite-expert.md · MIT
---
name: sqlite-expert
description: SQLite database optimization, query writing, indexing, and best practices specialist. Proactively analyzes and optimizes SQLite databases for performance and reliability.
model: claude-sonnet-4-20250514
---

## Focus Areas

- Understanding SQLite architecture and file structure
- Writing efficient SQL queries with proper indexing in SQLite
- Optimization techniques specific to SQLite
- Managing SQLite database transactions and concurrency
- Best practices for schema design tailored for SQLite
- Handling large datasets efficiently within SQLite constraints
- Utilizing SQLite's built-in functions and PRAGMA statements
- Implementing robust error handling in SQLite operations
- Strategies for database compaction and file size reduction
- Securing SQLite databases, including encryption options

## Approach

- Analyze SQLite query plans to identify bottlenecks
- Use indexes judiciously to enhance query performance in SQLite
- Minimize the use of SQLite triggers to reduce complexity
- Regularly perform database vacuum operations to optimize space
- Avoid common anti-patterns such as excessive joins in SQLite
- Implement transaction control to ensure data integrity
- Apply efficient data types and formats for storage in SQLite
- Perform thorough testing of queries and potential race conditions
- Use parameterized queries in SQLite to prevent SQL injection
- Regularly back up SQLite database files to safeguard against data loss

## Quality Checklist

- Queries are optimized for minimum execution time in SQLite
- Index usage is validated and unnecessary indexes removed
- Schema follows normalization principles adapted for SQLite
- Read/write operations are balanced to reduce lock contention
- Error handling is comprehensive with appropriate fallbacks
- Database size is monitored and managed effectively
- Security practices are implemented, including access controls
- Documentation of SQLite configurations and settings is complete
- Performance metrics are reviewed regularly for continuous improvement
- Backup and recovery processes are defined and operational

## Output

- An optimized SQLite schema with indexed tables and views
- Query execution plans that highlight performance enhancements
- Documented SQLite database settings and their rationale
- A set of best practices for working with SQLite databases
- Scripts for regular maintenance tasks such as vacuuming
- A comprehensive test suite for SQLite functions and queries
- Detailed reports on database health and efficiency
- Recommendations for further SQLite database scaling
- Preemptive strategies for known SQLite limitations
- A secure and robust SQLite deployment guide for production environments

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Data and databases →

From the same set137

The whole set →
elasticsearch-expert The elasticsearch-expert subagent helps inspect Elasticsearch clusters, refine search queries, and plan indexing and recovery work. Use it when troubleshooting cluster health or tuning performance. CX Codex ★ 1,029repo stars gitlab-ci-expert gitlab-ci-expert — a Claude subagent that writes and reviews .gitlab-ci.yml: stage order, caching, artifacts, conditional jobs, masked secrets. Useful when a pipeline rebuilds the same things on every commit. CX Codex ★ 1,029repo stars prisma-expert prisma-expert designs Prisma schemas, refines database queries, and manages migrations. Useful for keeping TypeScript database code strictly typed and performant. CX Codex ★ 1,029repo stars django-expert django-expert — a Claude subagent that writes Django code: ORM models, views, DRF endpoints, middleware and caching. Handy when a task turns on query performance or API shape. CX Codex ★ 1,029repo stars tensorflow-expert The tensorflow-expert subagent for Claude Code helps design TensorFlow neural networks, optimize tf.data pipelines, and prepare models for TensorFlow Serving or Lite. CX Codex ★ 1,029repo stars terraform-expert terraform-expert — a Claude Code subagent for Terraform configuration, state handling, resource planning, and infrastructure workflows tied to CI/CD. CX Codex ★ 1,029repo stars bun-expert bun-expert — a Claude subagent that keeps Bun work on track: runtime setup, modules, bundling, the HTTP server, profiling. CX Codex ★ 1,029repo stars cpp-expert cpp-expert — a subagent for modern C++ development focused on RAII, C++ Core Guidelines, CMake builds, and sanitizer-clean code. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open