That's exactly my experience as well. AI will read only the first 100 lines of a file, decide that's good enough, and spit out a garbage result. But ask it to write a bash one-liner and it will work perfectly.