Claude CodeAdvancedClaude Code
Subagents or parallel instances: they report back vs. they hand off
A subagent returns results to the main agent; parallel instances are independent sessions that do not communicate.
Subagent: launched by your session with isolated context (e.g. a security audit while you keep coding). Parallel instances: several Claude Code sessions in separate terminals, for tasks that each can finish in its own PR. A subagent only sees its system prompt, the task and its own results, not your history: build self-contained tasks and write in the main agent's instructions what to do if it fails (retry, flag for manual review or carry on).
Example
--- name: security-auditor description: Scans for SQL injection, XSS, CSRF and OWASP Top 10 in the changed code and returns a structured report. tools: Read, Grep, Bash --- (subagent instructions)