Chat on WhatsApp

What is a Claude Code "sub-agent" and how is it different from a slash-command?

A slash-command is a shortcut for a prompt template — running /scaffold-feature just expands a Markdown file in .claude/commands/ and feeds it back into the main thread. A sub-agent is a separate Claude session spawned with its own context, often to keep specialised tools and an isolated working memory. Example: a code-reviewer sub-agent loaded with phpcs + PHPStan + the EQP checklist reviews a diff in 30 seconds without polluting the main implementation thread's context window. Defined in .claude/agents/<name>.md. Rule of thumb: slash-commands for prompts you reuse, sub-agents for roles you delegate to.

Was this helpful?