For investigating bug reports where something is broken.
1. Identify the exact error message from the issue.
2. Search for the error message in the codebase using `codebase_search`.
3. Analyze the code that throws the error to understand the context.
4. Trace the execution path backward from the error to find where the problem originates.
5. Form a hypothesis about the incorrect logic or state.
6. Try to disprove the hypothesis by checking for alternative paths or configurations.
7. Propose a code change to correct the logic.
For investigating issues where the system works but not as expected.
1. Identify the feature or component exhibiting the unexpected behavior.
2. Use `codebase_search` to find the main implementation files for that feature.
3. Read the relevant code to understand the intended logic.
4. Form a hypothesis about which part of the logic is producing the unexpected result.
5. Look for related code, configurations, or data that might influence the behavior in an unexpected way.
6. Try to disprove the hypothesis. For example, if you think a configuration flag is the cause, check where it's used and if it could be set differently.
7. Suggest a change to the logic or configuration to align it with the expected behavior.
For investigating issues related to slowness or high resource usage.
1. Identify the specific action or process that is slow.
2. Use `codebase_search` to find the code responsible for that action.
3. Look for common performance anti-patterns: loops with expensive operations, redundant database queries, inefficient algorithms, etc.
4. Form a hypothesis about the performance bottleneck.
5. Try to disprove the hypothesis. Could another part of the system be contributing to the slowness?
6. Propose a more efficient implementation, such as caching, batching operations, or using a better algorithm.