CCARF Practice Question
Correct answer: A
A: Grep searches file contents, so it locates every occurrence of the error string regardless of file name. Read then loads only the matching files to understand the surrounding code and state machine logic. This is the minimal, targeted approach.
B: Glob matches file paths, so it would find files with 'state' in the name, but the error string could appear in files without 'state' in their name. Reading every matched file wastes context tokens on files that may not contain the error.
C: Guessing file locations is unreliable and wastes context tokens. The developer does not know where the error is defined, so a content search (Grep) is needed first.
D: Edit is a modification tool, not a search tool. Using it to locate code is incorrect, and modifying error messages without understanding the bug first could mask the real issue.