Slide 36 / 55
Slide 36

Transcript

Now it's time for a hands-on exercise. Let's create a supervisor hierarchy for your codebase.

Start by opening a new Claude Code session and ask it to analyze your codebase structure. Tell Claude: "Analyze this codebase and identify the major functional domains. For each domain, draft a subagent instruction file for that area."

Claude might identify domains like: the backend API layer, the database and data access logic, the frontend user interface, the authentication and authorization system, and any integration modules with external services.

Then ask Claude to create a coordinator CLAUDE.md that knows how to delegate to these specialists. The coordinator should understand the boundaries between domains and know which agent to route different types of requests to.

Once you have these instruction files drafted, try using them. Create separate directories, subagents, or git worktrees for each specialized agent. Copy the appropriate instructions into each location. Then test the system by giving your coordinator a complex task that spans multiple domains - like "improve the performance of data submission from the UI through to database storage and back."

Watch how the coordinator breaks this down into UI optimization tasks, API endpoint improvements, and database query performance analysis. Each subagent can then work on its piece independently with deep focus on its domain.

This exercise shows you how powerful agent hierarchies can be for managing complexity in large brownfield codebases.