Copilot constantly nags about "parent directory" access when it's clearly in a subfolder of the project directory
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 11.2k
- Forks
- 1.9k
- Avg merge
- 14h 16m
- Merged PRs (30d)
- 6
Description
Describe the bug
When using Claude Opus, it will occasionally cd into a lower directory and then access a sibling directory using the relative parent directory shortcut (..). This will inevitably be flagged by Copilot CLI as going outside of the project directory, which is clearly incorrect. Rather than assuming .. is going out of the project directory, Copilot CLI should be getting the absolute directory and checking that.
Affected version
Copilot v1.0.80
Steps to reproduce the behavior
Example issue:
- Start Copilot CLI in
/work. - Ask Claude to review code with a deep directory structure.
- Claude will use something like the following command:
cd subfolder/subfolder3/subfolder5 && grep -rn "searching for text" ../subfolder4 - The CLI incorrectly "warns" me that it's accessing a directory outside my workspace. And then wants me to add
../subfolder4to my "allowed" directories, which is not secure. If it was added to the "allowed" directories, it actually could do it at the top level.
Expected behavior
The CLI should be converting relative addressing to absolute addressing and checking the full path.
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported command from a Copilot CLI session rooted at /work, especially the relative path ../subfolder4 after changing directories. Trace the CLI's workspace-access check and verify that it resolves the command's path before comparison. Done means an in-workspace sibling is accepted without an allow-list prompt while a genuinely external path is still rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 66/100