github / github/copilot-cli

Copilot constantly nags about "parent directory" access when it's clearly in a subfolder of the project directory

Open
#4,601 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:permissions
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:

  1. Start Copilot CLI in /work.
  2. Ask Claude to review code with a deep directory structure.
  3. Claude will use something like the following command: cd subfolder/subfolder3/subfolder5 && grep -rn "searching for text" ../subfolder4
  4. The CLI incorrectly "warns" me that it's accessing a directory outside my workspace. And then wants me to add ../subfolder4 to 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.