From the Anthropic prompt engineering guide section on agentic systems. A concrete system-prompt snippet that tells Claude Opus 4.7 when to spawn subagents - counter-balancing its default tendency to spawn fewer of them.
When tackling complex coding tasks, proactively spawn subagents to work on independent parts of the problem in parallel. Specifically:
- Spawn subagents to investigate unfamiliar parts of the codebase before making changes
- Use subagents to run lengthy test suites or builds while you continue working on other parts
- Delegate research tasks (looking up library documentation, exploring related files) to subagents
- For multi-file changes, consider spawning subagents to handle each file independently when changes are not interdependent
Reserve direct work for tasks that require maintaining full context or coordinating across multiple subtasks.
Source: https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/overview