Skip to content

Not reading path-specific instruction files #311

Closed as not planned
Closed as not planned

Description

@rasmusfiskerbang

Describe the bug

Between 0.0.337 and 0.0.338 a regression happened where Gihub Copilot CLI no longer uses Path specific instructions files.

Affected version

0.0.338 Commit: 877e86a

Steps to reproduce the behavior

Create the following file structure
.github/
├── instructions/
│ └── ALL.instructions.md
└── copilot-instructions.md
README.md

With the following contents

copilot-instructions.md

Always end every answer with the tag [INSTR-OK].

ALL.instructions.md

---
applyTo: "**"
---
Always include [PATH-OK] in your answer.

Run
copilot -p "Open README.md and append a line. Include your tags." --allow-all-tools

Expected behavior

The response from copilot should include both [INSTR-OK] and [PATH-OK]

Additional context

No response

Activity

  1. self-assigned this
    on Oct 15, 2025
  2. andyfeller commented on Oct 15, 2025

    @andyfeller
    Contributor

    Thank you for raising up this issue, @rasmusfiskerbang! 🙇 I am going to look into custom instruction cache performance optimizations included in 0.0.338, trying to replicate this setup and step through the debugger to understand what might be going on with layering the custom instructions.

  3. andyfeller commented on Oct 15, 2025

    @andyfeller
    Contributor

    @rasmusfiskerbang : I think part of the problem you're encountering is your copilot-instructions.md file is in .github/instructions directory which is for path-specific repository instructions when it should be in .github.

    Demo

    $ cat .github/copilot-instructions.md                                       
    Always end every answer with the tag [INSTR-OK].
    
    
    $ cat .github/instructions/*.instructions.md
    ---
    applyTo: "**"
    ---
    Always include [PATH-OK] in your answer.
    
    
    $ copilot --version
    0.0.340
    Commit: fac8111
    
    
    $ copilot -p "Open README.md and append a line. Include your tags." --allow-all-tools
    ● I'll open the README.md file and append a line to it.
    
    ✓ Read README.md (102 lines)
    ● Now I'll append a new line to the README.md file:
    
    ✓ Edit README.md (+4 -1)
       ╭──────────────────────────────────────────────────────────────────────────────────────────────╮
       │  95                                                                                          │
       │  96   ## What is your favorite dessert?                                                      │
       │  97 - Spice cake, hands down!                                                                │
       │  97 + Spice cake, hands down!                                                                │
       │  98 +                                                                                        │
       │  99 + ---                                                                                    │
       │ 100 + *This line was added by GitHub Copilot CLI on 2025-10-15*                              │
       ╰──────────────────────────────────────────────────────────────────────────────────────────────╯
    ● I've successfully appended a line to the README.md file. The new line includes a timestamp and 
       indicates it was added by GitHub Copilot CLI.
    
       [PATH-OK] [INSTR-OK]
    
  4. rasmusfiskerbang commented on Oct 15, 2025

    @rasmusfiskerbang
    Author

    That is just bad formatting on my end. copilot-instructions.md was in-fact under .github.

  5. andyfeller commented on Oct 16, 2025

    @andyfeller
    Contributor

    @rasmusfiskerbang : Thanks for the follow up. Beyond getting a little more details about your local setup (operating system, terminal, shell), I would like you to run the following and share the results here please:

    gh repo clone andyfeller/copilot-cli-311
    cd copilot-cli-311
    copilot -p "Open README.md and append a line. Include your tags." --allow-all-tools

    This is a minimal GitHub repository I recreated based on the details above using the latest build which generates the following:

    $ copilot --version
    0.0.342
    Commit: 69ac520
    
    $ gh repo clone andyfeller/copilot-cli-311 
    Cloning into 'copilot-cli-311'...
    remote: Enumerating objects: 9, done.
    remote: Counting objects: 100% (9/9), done.
    remote: Compressing objects: 100% (6/6), done.
    remote: Total 9 (delta 0), reused 6 (delta 0), pack-reused 0 (from 0)
    Receiving objects: 100% (9/9), done.
    
    $ cd copilot-cli-311
    
    $ copilot -p "Open README.md and append a line. Include your tags." --allow-all-tools
    ● I'll open the README.md file, view its contents, and append a line to it.
    
    ✓ List directory . (9 files)
    
    ✓ Read README.md (7 lines)
    
    ✓ Edit README.md (+1)
       ╭──────────────────────────────────────────────────────────────────────────────────────────────╮
       │ 1   # copilot-cli-311                                                                        │
       │ 2   Simple repository for testing github/copilot-cli#311                                     │
       │ 3 + This line was appended by GitHub Copilot CLI.                                            │
       ╰──────────────────────────────────────────────────────────────────────────────────────────────╯
    
    ● Done! I've appended a new line to README.md. [PATH-OK] [INSTR-OK]
    
    
    Total usage est:       1 Premium request
    Total duration (API):  21.2s
    Total duration (wall): 23.2s
    Total code changes:    1 lines added, 0 lines removed
    Usage by model:
        claude-sonnet-4.5    0 input, 0 output, 0 cache read, 0 cache write (Est. 0 Premium requests)
  6. andyfeller commented on Oct 24, 2025

    @andyfeller
    Contributor

    @rasmusfiskerbang : I'm genuinely unable to reproduce this problem as shown in #311 (comment) assuming we're talking about the custom instructions in .github directory.

    I'd like to continue working with you on a reproducible situation that we can put under debug and figure out if there is some race condition contributing to your situation. In the mean time, I'm going to close this issue, which we can reopen as this develops.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions