Daniel Rosehill Hey, It Works!
Claude Agent Picker Pattern: smart subagent crew assembly for Claude Code
· Daniel Rosehill

Claude Agent Picker Pattern: smart subagent crew assembly for Claude Code

A pattern for intelligently assembling multi-agent crews in Claude Code while staying within context window limits.

Here's a problem I keep running into with Claude Code: subagents are incredibly useful, but you can't just load twenty of them into a project without consequences. Each agent definition consumes context, and at some point you hit diminishing returns where Claude is spending more effort parsing agent descriptions than doing actual work. I've been calling this "context flooding," and I built the Agent Picker Pattern as a workaround.

danielrosehill/Claude-Agent-Picker-Pattern View on GitHub

The context flooding problem

The more agents you add, the more descriptions the orchestration layer has to parse to figure out which subagent should handle a task. The same applies to MCP tool definitions. If AI tooling progresses faster than context windows grow, this problem will only get more acute. Anthropic's own docs acknowledge the value of subagents — each one operates in its own context, preventing pollution of the main conversation — but the challenge is managing the overhead of having many available.

The agent picker idea

The concept is straightforward: instead of loading all your agents into every project, you maintain a centralized "agent farm" — a library of reusable subagent configurations. When you start a new project, a picker agent (I've affectionately named it the "Harsh Team Picker Guy") evaluates your project spec and assembles an optimized crew.

The picker works in stages. First, it shortlists candidate agents based on the project requirements, optimizing for synergy and minimal task overlap. Then it calculates the cumulative context consumption and truncates the crew if needed — either by removing the least essential agents or shortening their system prompts. Finally, it copies the adapted configurations into your project's agent directory.

Why this matters for agentic workflows

For creating performant agentic systems, using tooling judiciously has become almost as important as knowing what tooling to use. Too many cooks in the kitchen really does flatten inference quality. The agent picker pattern lets you maintain a large library of specialized agents without paying the context cost of loading all of them into every workspace.

The repo includes a /agent-picker slash command that automates the whole workflow. You can keep your agent farm either inside the repo or in an external directory like ~/subagents for cross-project reuse. It's a concept-stage project and admittedly a hacky workaround, but it's been useful enough in practice that I figured it was worth sharing.

Explore the pattern on GitHub — contributions and ideas for improvement are welcome.

danielrosehill/Claude-Agent-Picker-Pattern View on GitHub