- Copilot Chat Extension Version: 1.388.0
- VS Code Version: 1.106.2
- OS Version: Windows 11
- Feature (e.g. agent/edit/ask mode): agent, automatic including copilot-instructions.md into context-link.
- Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): Claude 4.5 Sonnet, GPT 4.1, etc...
- Logs:
Note: This issue was identified and documented with assistance from GitHub Copilot Chat
Expected Behavior
According to the official documentation, the copilot-instructions.md file should be:
- ✅ Automatically included in the context for every chat request
- ✅ Visible in the "Used references" section of chat responses
- ✅ Applied to influence AI responses based on the instructions
Actual Behavior
Currently observing:
- ❌ The file is NOT included in chat context attachments
- ❌ The file does NOT appear in "Used references" list
- ⚠️ HOWEVER: Markdown links inside
copilot-instructions.md ARE being parsed, and linked files ARE loaded as attachments
Steps to Reproduce
-
Create .github/copilot-instructions.md in workspace root with content:
[TEST_MARKER_12345] This should be visible to AI
# Project Instructions
- Test 1
- Test 2
- Test 3
-
Ensure github.copilot.chat.codeGeneration.useInstructionFiles setting is enabled
-
Open GitHub Copilot Chat and start a new conversation
-
Send any message (e.g., "Hello") and check "Used references" section
-
Expected: copilot-instructions.md appears in the references list
-
Actual: File is missing from references
-
Ask the AI: "Do you see the TEST_MARKER_12345 in your context?"
- Expected: AI confirms seeing the marker
- Actual: AI reports the file is not in context
Possible Trigger
The issue appeared after modifications to the .github/ directory structure:
- Added subdirectories:
.github/tasks/, .github/modules/, .github/backups/
- Added multiple markdown files within these subdirectories
- File structure before issue: simple
.github/copilot-instructions.md only
- File structure after issue:
.github/ with nested folders and multiple .md files
Hypothesis: The presence of additional .github/ subdirectories or markdown files may interfere with the automatic inclusion mechanism for copilot-instructions.md.
Test to confirm: Try reproducing in a minimal workspace with ONLY .github/copilot-instructions.md and no other files/folders in .github/.
What Still Works
Markdown links inside copilot-instructions.md DO work as expected:
# Main Instructions
See detailed guidelines:
- [Backend Guidelines](./docs/backend-guidelines.md)
- [Frontend Guidelines](./docs/frontend-guidelines.md)
The linked files (backend-guidelines.md, frontend-guidelines.md) WILL be loaded as attachments, but the main copilot-instructions.md file itself is not included.
Additional Workaround Discovered:
If you add a Markdown link to copilot-instructions.md inside itself (a self-link),
**🔗 Workaround:**
- 🔄 **[Link](copilot-instructions.md)**
the file is reliably loaded into the Copilot Chat context as an attachment—even though it does not appear in the "Used references" UI list. This was verified by adding a unique test string at the top of the file and confirming that Copilot Chat could see and reproduce the string in its context.
Example workaround:
Note: This workaround is effective, but the file remains hidden from the UI references list
Note: This issue was identified and documented with assistance from GitHub Copilot Chat
Expected Behavior
According to the official documentation, the
copilot-instructions.mdfile should be:Actual Behavior
Currently observing:
copilot-instructions.mdARE being parsed, and linked files ARE loaded as attachmentsSteps to Reproduce
Create
.github/copilot-instructions.mdin workspace root with content:Ensure
github.copilot.chat.codeGeneration.useInstructionFilessetting is enabledOpen GitHub Copilot Chat and start a new conversation
Send any message (e.g., "Hello") and check "Used references" section
Expected:
copilot-instructions.mdappears in the references listActual: File is missing from references
Ask the AI: "Do you see the TEST_MARKER_12345 in your context?"
Possible Trigger
The issue appeared after modifications to the
.github/directory structure:.github/tasks/,.github/modules/,.github/backups/.github/copilot-instructions.mdonly.github/with nested folders and multiple.mdfilesHypothesis: The presence of additional
.github/subdirectories or markdown files may interfere with the automatic inclusion mechanism forcopilot-instructions.md.Test to confirm: Try reproducing in a minimal workspace with ONLY
.github/copilot-instructions.mdand no other files/folders in.github/.What Still Works
Markdown links inside
copilot-instructions.mdDO work as expected:The linked files (
backend-guidelines.md,frontend-guidelines.md) WILL be loaded as attachments, but the maincopilot-instructions.mdfile itself is not included.Additional Workaround Discovered:
If you add a Markdown link to copilot-instructions.md inside itself (a self-link),
the file is reliably loaded into the Copilot Chat context as an attachment—even though it does not appear in the "Used references" UI list. This was verified by adding a unique test string at the top of the file and confirming that Copilot Chat could see and reproduce the string in its context.
Example workaround:
Note: This workaround is effective, but the file remains hidden from the UI references list