All Days
Day 19

Founder OS — Custom Subagents & Model Routing

Day 19 of 30 · Claude Code Series

Claude Code — Hidden Feature #004

Build your own agent team.

Custom subagents are isolated workers with their own model, tools, and memory. Route cheap tasks to Haiku. Route complex ones to Sonnet. Main context stays clean.

10xcheaper (Haiku vs Sonnet)
isolatedcontext per agent
parallelspawn multiple at once

How subagents work

Architecture

Isolated workers that keep your main context clean

💡Subagents run with context: fork — they see your project but changes stay isolated. Main context only receives the final summary.

Creating a custom agent

Setup

One file in .claude/agents/ — that's all it takes

1Create the directory: mkdir -p .claude/agents
2Add a markdown file with YAML frontmatter (name, model, tools, instructions)
3Claude auto-discovers it. Reference by name: /agent security-reviewer
.claude/agents/security-reviewer.md
--- name: security-reviewer description: Reviews code changes for OWASP top 10 vulnerabilities. Use when reviewing PRs, analyzing new endpoints, or checking auth logic. model: claude-haiku-4-5 tools: ["Read", "Grep"] skills: ["security-guide"] memory: user context: fork --- You are a security-focused code reviewer. Your job: 1. Check every file for SQL injection, XSS, command injection 2. Flag hardcoded secrets or API keys 3. Review auth logic for privilege escalation risks 4. Check input validation at API boundaries 5. Rate each issue: critical / high / medium / low Be brief. List issues only. No compliments.

Model routing — pick the right tool

Cost

Match the model to the task. Never use Opus for what Haiku can handle.

ModelCostBest for
claude-haiku-4-5cheap~$0.25/MSearch, summarize, classify, extract, route. Read-only agents, research tasks.
claude-sonnet-4-6default~$3/MComplex reasoning, multi-step tasks, writing code, general work.
claude-opus-4-6premium~$15/MArchitecture decisions, complex debugging, high-stakes output. Use sparingly.
Rule of thumb: default to Haiku for subagents unless the task requires reasoning or code generation. You can always bump up. Starting high wastes money.

Built-in agents (already available)

Built-in

These ship with Claude Code. No setup needed.

🔭
Explore

Fast codebase search. Haiku model. Read-only. Searches files fast.

claude-haiku-4-5 · read-only
📋
Plan

Read-only planning. Used before plan mode executes.

claude-haiku-4-5 · read-only
🤖
General-purpose

Full tools, complex tasks. Full access.

claude-sonnet-4-6 · full access
Bash

Terminal in isolation. Runs terminal commands separately.

claude-haiku-4-5 · bash only

Real agent examples

Copy-paste

Four production-ready agents. Drop them into .claude/agents/ and use immediately.

don't miss what's next.

playbooks, templates, and tools that actually save you hours. straight to your inbox. no spam. unsubscribe anytime.