diff --git a/CLAUDE.md b/CLAUDE.md index 247facf..55c8137 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,9 +4,26 @@ This file is read automatically by Claude Code at the start of every session. It teaches Claude to work efficiently on large codebases and avoid running out of usage mid-task. -## Finding Errors in Large Codebases +## When the User Pastes an Error Message -When asked to find or fix errors, bugs, or issues across the codebase: +The user often arrives with a specific error they hit — a build failure, a +runtime crash, a stack trace, a "failed to execute X" message. When this happens: + +1. **Read the error carefully.** The file names, line numbers, and error type + are already in the message. Don't go searching the whole codebase. +2. **Go directly to the file(s) mentioned in the error.** Read only those files, + and only the relevant sections (the function or area around the line number). +3. **Trace the cause.** If the error references an import, a missing variable, + or a function call, grep for that specific symbol — don't read surrounding + files "for context." +4. **Fix it, verify, commit.** After fixing, run the project's build/test + command (see Project-Specific Commands below) to confirm the fix works. + +The key rule: **the error message IS your roadmap. Follow it, don't explore.** + +## Finding Errors Across the Codebase + +When asked to find or fix errors broadly (not a specific error message): 1. **Run the scanner first.** Execute: `python scan.py` This runs the project's linters, tests, and type checkers in seconds.