I just put something in my global CLAUDE.md (under ~/.Claude) asking it to use the LSP instead of grep and have never had this issue since.

can you share that prompt?

My q would have been this. Lsp solved this no?