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.
| Source | Role in the investigation |
|---|---|
| Code and configs | Show the implementation and configuration locations |
| Test and terminal output | Show that the issue can be reproduced |
| Stack trace and logs | Show the error location and conditions |
| Screenshot | Shows what the user saw |
A bug evidence 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 verificationWork from the symptom to the root cause
- State the expected and actual values.
- Narrow the context in the IDE to the method or a small range.
- Add the reproduction command.
- Find the exception type and the first line of your own code in the trace.
- Match the trace to the data flow in the code.
- Add only the necessary log lines or brief UI evidence.
- Ask for a minimal fix without unnecessary refactoring.
./gradlew test --tests OrderControllerTestexpected: 400, actual: 500
OrderControllerTest.java:73
OrderService.java:51Filter 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