A subagent compresses research

When you need to review many modules, tests, configurations, or logs, a subagent can move the search into a separate context and return only a concise, verifiable result to the main session.

A subagent is a research tool, not a replacement for the final decision. The main session is responsible for checking the conclusions and making changes in the repository.

Good candidates for delegationDo not delegate
Find all integrations with the payment serviceRead one short file
Trace the complete refund flowInvestigate one trace line
Collect related testsMake a small edit
Summarize a large diff or logsHold a long interactive conversation

A mini-task spec for a subagent

Goal, boundaries, format, and constraints
Investigate the refund operation path.
Check controllers, services, payment client, config, and tests.
Return a concise conclusion, file:line evidence,
assumptions, open questions, and next steps.
Do not change files; do not copy large code fragments.

Expected result

  • **Conclusion** — a few sentences about the flow you found;
  • **Evidence** — specific references to files and lines;
  • **Assumptions** — what follows from indirect signals;
  • **Open questions** — what remains unverified;
  • **Next actions** — what the main session should check.

After the conclusion is returned

  1. Manually check two or three key locations.
  2. Compare the conclusion with a test or command.
  3. Separate confirmed information from assumptions.
  4. Update the inventory, API map, or investigation note through a normal diff.
  5. Do not transfer an unverified summary into documentation as fact.

Delegation boundaries

Do not use a subagent for every small task or build a complex multi-agent system during a simple investigation. Delegation should reduce noise while preserving human control over the evidence and the final result.

Canonical lesson source · JavaRush

Open JavaRush material