I built ten custom subagents to tame a 500K-line Clojure codebase

· ai databases · Source ↗

TLDR

  • Metabase engineer built ten domain-expert Claude Code subagents to eliminate context-window tax when navigating a 500K-line Clojure backend.

Key Takeaways

  • Each subagent is a 150-line markdown file with YAML frontmatter (name, description, model, memory) plus domain knowledge, codebase locations, investigation patterns, and caveats.
  • The description field is the routing rule: vague descriptions like “use for query processor work” cause missed delegation; specific trigger words like “MBQL, HoneySQL, middleware pipeline” are required.
  • memory: user gives each agent a persistent directory at ~/.claude/agent-memory/<agent-name>/ for cross-session learning without polluting the main context.
  • Launching multiple agents in parallel (e.g. mbql-expert and permissions-expert simultaneously) lets each investigate in its own context window without cross-contamination.
  • Investigation patterns and caveats are more durable than file paths: directories get renamed, but architectural facts like “some middleware runs twice because later stages introduce structure earlier stages must re-process” stay true.

Hacker News Comment Review

  • No substantive HN discussion yet.

Original | Discuss on HN