A built-in subagent needs one narrow question

Delegate a concrete investigation: find entry points, trace a call, or compare tests with behavior. The main session receives a concise report without spending its entire context on intermediate findings.

Delegation does not transfer responsibility for truth. Check important findings in files, tests, configuration, or an actual run.

Request partExample
QuestionWhere is the response for /users formed?
BoundaryInspect src/api, related services, and tests; do not edit
EvidenceReturn file:line, function names, and commands run
UncertaintyMark assumptions as [hypothesis]
ResultShort conclusion, limits, open questions, and next step

Delegation template

Narrow research request
Role: read-only runtime-flow researcher.
Question: trace the path from the CLI entry point to result storage.
Area: src/cli, src/services, tests; do not edit.
Check: calls, error handling, and relevant test commands.
Return:
- conclusion;
- file:line and functions;
- checks actually run;
- [hypothesis] for unverified claims;
- open questions;
- next step.

Break work into contracts

  1. Delegate discovery or inventory first.
  2. Ask separately for a hypothesis check through tests or configuration.
  3. Formulate the change plan in the main session.
  4. Run implementation, testing, and review as separate controlled steps.
  5. Compare the subagent report with primary files before deciding.

Report format matters more than confident tone

  • Files and lines show where evidence was found.
  • Functions and relationships explain the conclusion.
  • Checks name commands or tests actually run.
  • Limits state what was not checked.
  • Hypotheses remain distinct from facts.
  • Next step gives the owner the smallest useful action.

Canonical lesson source · JavaRush

Open JavaRush material