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.

Kishan Savaliya
Kishan Savaliya
Adobe Certified Magento Commerce Developer
Ahmedabad [IN]working hours, replies within four hours
When do you need it

Read personally. Never shared. Or email the brief.

More on claude, glossary

Need it fixed, not just explained?

Send the brief with your store URL; the written quote comes back within 24 hours.