🗂️Subagents

Multi-repo search

Searches across multiple local repos in parallel, nominates a canonical example per repo.

Surfaces
skill · subagent
Complexity
intermediate
Trigger
natural
Est. tokens
7,000

What It Does

Loads a list of repo paths, launches one subagent per repo, grep-searches each for a given pattern, and merges the results ranked by frequency and recency. Each subagent works in its own repo's cwd, so Explore and Grep behave correctly.

When It Triggers

  • "Find all usages of createUser across our repos"
  • "How does team Y do auth in their services?"
  • "Search the monorepos for legacy API calls"

Config

Put one absolute repo path per line in ~/.claude/repos.txt. The skill reads that file and iterates.

SKILL.md

markdown
---
name: multi-repo-search
description: Searches across multiple local repos for a pattern, pattern evolution, or usage examples. Spawns one subagent per repo. Use when user says "find all usages of X across repos", "search our monorepos", or "how does team Y do Z".
---

# Multi-Repo Search

## Steps
1. Read repo list from `~/.claude/repos.txt` (one path per line)
2. For each repo, launch a subagent with:
   - Working directory = that repo
   - Task: grep for the pattern, return matches + 3 lines of context
3. Collect subagent outputs
4. Rank by frequency and recency (git blame date)
5. Output: one table per repo + a "canonical example" nomination

Gotchas

  • Repos on a slow network drive make subagents time out — keep repos on local SSD.
  • Ranking by git blame date needs a recent clone; shallow clones break this.
  • Subagents have no shared memory — results are merged only after all complete.

Before you continue

We use analytics cookies to understand how the documentation is used and improve the experience. Privacy Policy.