Just this week I wanted Claude Code to plan changes in a sub directory of a very large repo. I told it to ignore outside directories and focus on this dir.
It then asked for permission to run tree on the parent dir. Me: No. Ignore the parent dir. Just use this dir.
So it then launches parallel discovery tasks which need individual permission approval to run - not too unusual, as I am approving each I notice it sneak in grep and ls for the parent dir amongst others. I keep denying it with "No" and it gets more creative with what tool/pathing it's trying to read from the parent dir.
I end up having to cancel the plan task and try again with even more firm instructions about not trying to read from the parent. That mostly worked the subsequent plan it only tried the once.
Did you ask it why it insisted on reading from the parent directory? Maybe there is some resource or relative path referenced.
I'm not saying you should approve it or the request was justified (you did tell it to concentrate on a single directory). But sometimes understanding the motivation is helpful.
Just this week I wanted Claude Code to plan changes in a sub directory of a very large repo. I told it to ignore outside directories and focus on this dir.
It then asked for permission to run tree on the parent dir. Me: No. Ignore the parent dir. Just use this dir.
So it then launches parallel discovery tasks which need individual permission approval to run - not too unusual, as I am approving each I notice it sneak in grep and ls for the parent dir amongst others. I keep denying it with "No" and it gets more creative with what tool/pathing it's trying to read from the parent dir.
I end up having to cancel the plan task and try again with even more firm instructions about not trying to read from the parent. That mostly worked the subsequent plan it only tried the once.