As a side note, one thing that seemed to really help was having the agent recursively summarize all the files into a repo map with the same folder/file structure as the repo.
And forcing to always orient itself with that repo map first seemed to really help it from tunnel visioning.