From claude-initial-setup
Patterns for when and how to use Claude Code subagents via the Agent tool. Use when the user needs to delegate research, run parallel investigations, protect the main context window, or asks about subagent types like Explore or Plan.
npx claudepluginhub versoxbt/claude-initial-setup --plugin claude-initial-setupThis skill uses the workspace's default tool permissions.
Subagents are independent Claude instances launched via the Agent tool. They run in isolation, protecting the main context window from excessive results while enabling parallel work.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Subagents are independent Claude instances launched via the Agent tool. They run in isolation, protecting the main context window from excessive results while enabling parallel work.
Use subagents when:
Use direct tools (Glob, Grep, Read) when:
Explore — For broad codebase exploration and deep research:
Agent tool call:
subagent_type: "Explore"
prompt: "Find all authentication middleware in this project.
Identify where JWT tokens are validated, what claims
are checked, and how unauthorized requests are handled.
Report file paths and key function signatures."
Use Explore when you need to understand how a system works before modifying it.
Plan — For generating structured implementation plans:
Agent tool call:
subagent_type: "Plan"
prompt: "Create a plan for adding rate limiting to all API endpoints.
Consider existing middleware, database requirements,
and configuration needs. Output a step-by-step plan
with file paths and code changes needed."
General-purpose (default) — For executing focused subtasks:
Agent tool call:
prompt: "Read the file src/utils/validation.ts and extract
all exported function signatures with their parameter
types and return types. Format as a markdown table."
Subagents return their findings as text. Structure your prompts to get actionable output:
Agent tool call:
prompt: "Analyze src/api/routes/ for error handling patterns.
For each route file, report:
1. File path
2. Whether it uses try/catch
3. Whether errors are logged
4. Whether error responses include status codes
Format as a checklist with pass/fail for each item."
The main agent receives a summary and acts on it — the subagent's full exploration context is discarded, keeping the main window clean.
Launch multiple Agent calls in a single response for independent tasks:
# Call 1 - Agent tool:
prompt: "Find all database query functions in src/db/ and check
if they use parameterized queries for SQL injection prevention."
# Call 2 - Agent tool:
prompt: "List all API endpoints in src/routes/ and check which ones
have authentication middleware applied."
# Call 3 - Agent tool:
prompt: "Find all environment variable usages across the codebase
and verify each has a fallback or validation check."
All three run in parallel. Results arrive independently and can be synthesized by the main agent.
Give subagents clear boundaries to prevent unbounded exploration:
# GOOD: Scoped prompt
Agent tool call:
prompt: "In the directory src/components/forms/, find all form
components that handle file uploads. Report the component
name, accepted file types, and max size limits."
# BAD: Unbounded prompt
Agent tool call:
prompt: "Look at all the components and tell me about them."
Use subagents as a firewall when reading large codebases:
# Instead of reading 20 files directly:
Agent tool call:
subagent_type: "Explore"
prompt: "Read all files in src/services/ (there are ~20 files).
Summarize each service: name, purpose, dependencies,
and exported functions. Return a concise summary table."
The subagent reads all 20 files in its own context. The main agent receives only the summary.
| Scenario | Approach |
|---|---|
| Know the exact file | Read directly |
| Single grep/glob | Grep/Glob directly |
| Multi-file exploration | Subagent (Explore) |
| Implementation planning | Subagent (Plan) |
| Parallel investigations | Multiple Agent calls |
| Large result expected | Subagent (context protection) |
Prompt structure: State the scope, what to find, and desired output format. Parallelism: Independent Agent calls in the same response run concurrently. Context protection: Subagent results are summarized; raw exploration stays isolated.