mongodb-expert · 0xfurai — Claude Code subagent: what it does, how to install
mongodb-expert — a Claude subagent for MongoDB work: schema design, indexes, aggregation pipelines, replication, backups and migrations.
MIT ★ 1,029 updated 2025-10-15
.claude/agents/mongodb-expert.mdWhat mongodb-expert does
This subagent covers MongoDB tasks: designing collections, choosing indexes for the queries you actually run, building aggregation pipelines, setting up replica sets and sharding, plus transactions, backups and migrations. The file has four sections: focus areas, approach, a quality checklist and the artefacts it produces.
The approach section takes positions. Index type follows the query shape, collections get shaped around the access patterns the app really has, and a sharding key is picked after looking at how reads are distributed. Transactions belong only where atomicity is required. Backups are automated and restores are tested.
What comes back is concrete: rewritten queries with index suggestions, sample pipelines, a migration plan with a cutover step, a security audit writeup. The frontmatter leaves model blank, so the subagent does not pin a model and runs on whatever Claude uses. It lives in the 0xfurai/claude-code-subagents repo under MIT and installs as a single file in .claude/agents/.
What it helps with
- Trace a slow query and pick the index it needs
- Shape collections around the access patterns the app really has
- Build an aggregation pipeline for a report
- Plan a data migration with a cutover step
- Test that a backup restore actually completes
Example prompts for the agent
- Have
mongodb-expertlook at the aggregation over the orders collection and tell me where it stalls - Check the collection schema for the new service with
mongodb-expert - Work out a migration to a new sharding key with
mongodb-expert
How to install mongodb-expert
Manually: put the files in place
.claude/agents/mongodb-expert.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/mongodb-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/mongodb-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 mongodb-expert
How do I install mongodb-expert in Claude Code?
Copy .claude/agents/mongodb-expert.md into the .claude/agents/ folder of your project. Claude picks the subagent up from there.
What does mongodb-expert do?
It designs schemas, selects indexes, writes aggregation pipelines, and plans replication, sharding, backups and migrations. Answers come back as queries, plans and reports.
Does the subagent pin its own model?
No. The model field in the frontmatter is blank, so it runs on whichever model Claude is set to.
Source text
mongodb-expert.md · MIT
--- name: mongodb-expert description: Master MongoDB operations, schema design, performance optimization, and data modeling. Handles indexing, aggregations, and replication. Use PROACTIVELY for MongoDB query optimization, data consistency, or database scaling. model: claude-sonnet-4-20250514 --- ## Focus Areas - Efficient query design and optimization - Schema design using best practices for MongoDB - Advanced indexing strategies for performance - Aggregation framework and pipeline design - Replication and sharding setup for scalability - Transactions and data consistency across operations - Backup and restore procedures for disaster recovery - Data migration and ETL processes - Monitoring and performance tuning - Security best practices including authentication and authorization ## Approach - Use appropriate index types for different query patterns - Optimize schema for the most common access patterns - Leverage built-in features like replica sets for fault tolerance - Utilize aggregation pipelines for complex data analysis - Design sharding based on data access patterns - Implement transactions only when necessary for data integrity - Automate backup processes and regularly test restore capabilities - Plan migrations to minimize downtime and ensure data integrity - Continuously monitor database performance and query execution plans - Regularly review and update security configurations to protect data ## Quality Checklist - Indexes are properly set up and align with query patterns - Schema design follows MongoDB best practices - Aggregation pipelines are efficient and performant - Replication setup is tested and reliable - Sharding keys are chosen based on thorough analysis - Transactions cover all critical operations needing atomicity - Backup processes are automated and restore tests are successful - Data migrations are planned and executed with minimal disruptions - Performance tuning includes query profiling and index evaluation - Security settings are updated with the latest best practices and patches ## Output - Optimized queries with relevant index recommendations - Schema designs tailored for application needs - Aggregation pipeline samples for complex analytics - Replication and sharding configuration guides - Transaction examples covering critical use cases - Comprehensive backup and restore plans - Migration plans with cutover strategies - Performance reports with tuning recommendations - Security audit reports with actionable insights - Documentation on best practices and setup configurations for MongoDB
© 0xfurai · MIT · 0xfurai/claude-code-subagents
Similar subagents
All subagents for Data and databases →mongodb-expert by other authors comes first.