Skip to content

Repo instruction files symlinked to targets outside the repo are not loaded #5425

Open

Description

@toms-g2

Bug: Repo-level instruction files are not loaded when they are symlinks to targets outside the repository. Regular files with the same content are loaded.

Affected: These files and directories, when symlinked to outside targets: AGENTS.md, CLAUDE.md, GEMINI.md, .claude/CLAUDE.md, .github/copilot-instructions.md, .github/instructions/, and .claude/rules/.

Not affected: Regular files, symlinks to targets inside the repo, and ~/.copilot/copilot-instructions.md when symlinked to an outside target.

Repro:

mkdir -p ~/symlink-instructions-repro/targets ~/symlink-instructions-repro/repo
echo "test instructions" > ~/symlink-instructions-repro/targets/AGENTS.md
cd ~/symlink-instructions-repro/repo && git init

# Symlink to a file outside the repo
ln -s ../targets/AGENTS.md AGENTS.md
copilot instruction list      # no "Repository instructions" section

# Same content as a regular file
rm AGENTS.md && cp ../targets/AGENTS.md AGENTS.md
copilot instruction list      # lists AGENTS.md under "Repository instructions"

Expected: Symlinked instruction files are loaded the same way as regular files.

Version: CLI 1.0.109, Linux.

Related: #4822 (symlink resolution in AGENTS.md discovery; opposite direction), #3264 (symlink docs under ~/.copilot).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions