How we built ten custom subagents to tame a 500K-line Clojure codebase
Blog post from Metabase
Metabase's backend, comprising 500,000 lines of Clojure code, spans various subsystems like a query processor, permissions system, database drivers, and more, each with its complexities. To manage this vast codebase, Claude Code is used, which facilitates backend work but can quickly become overloaded due to the extensive exploration it performs. To alleviate this, specialized subagents were created, each dedicated to a specific domain within the codebase, such as the query processor or permissions system. These subagents, defined as markdown files, encapsulate domain knowledge, codebase locations, investigation patterns, and testing strategies, allowing for efficient navigation without context overload. For instance, the "mbql-expert" subagent is tailored for the query processor, understanding the intricacies of MBQL query language and SQL compilation. This system enables seamless delegation of tasks to the appropriate subagent, enhancing productivity by ensuring that each agent operates within its specialized context. The approach demonstrates how large codebases can benefit from creating structured, domain-specific agents to handle complex subsystems efficiently.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Real-time | 2 | 6,296 | 1,346 | 246 | -2% |
| LLM | 1 | 5,932 | 1,046 | 223 | -2% |
| Vector Search | 1 | 1,739 | 413 | 146 | -27% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.