Evidence connects code with actual behavior

Code and configuration show the intent, but they do not guarantee the result of a run. For an investigation, it is useful to combine the selected fragment in the IDE, the reproduction command, a short test output, a stack trace, relevant logs, and, when needed, a UI screenshot.

Claude Code works more precisely when it receives concrete, verified signals: the expected value, the actual value, the test name, and the failure coordinates.

SourceRole in the investigation
Code and configsShow the implementation and configuration locations
Test and terminal outputShow that the issue can be reproduced
Stack trace and logsShow the error location and conditions
ScreenshotShows what the user saw

A bug evidence packet

A concise investigation packet
Goal: what needs to be explained or fixed
Context: file, method, and selected fragment
Command: how to reproduce the problem
Result: expected and actual
Trace/logs: relevant lines only
UI evidence: screenshot name and description
Expectation: a minimal change and test verification

Work from the symptom to the root cause

  1. State the expected and actual values.
  2. Narrow the context in the IDE to the method or a small range.
  3. Add the reproduction command.
  4. Find the exception type and the first line of your own code in the trace.
  5. Match the trace to the data flow in the code.
  6. Add only the necessary log lines or brief UI evidence.
  7. Ask for a minimal fix without unnecessary refactoring.
./gradlew test --tests OrderControllerTest
A result that is easy to verify
expected: 400, actual: 500
OrderControllerTest.java:73
OrderService.java:51

Filter logs and protect secrets

  • do not send the entire log without a reason;
  • keep the lines related to reproduction;
  • remove tokens, passwords, internal URLs, and other secrets;
  • a screenshot complements the trace and log, but does not replace them;
  • separate the backend problem from how it is displayed in the frontend.

After the analysis

Save the conclusion in a troubleshooting note or evidence artifact: symptom, command, evidence, cause, minimal change, and the result of the repeat check. This makes the investigation repeatable.

Canonical lesson source · JavaRush

Open JavaRush material