Skip to content

copilot-instructions.md no longer included in chat context automatically #279045

@Lotrein

Description

@Lotrein
  • 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:
Image Image

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:

  1. ✅ Automatically included in the context for every chat request
  2. ✅ Visible in the "Used references" section of chat responses
  3. ✅ Applied to influence AI responses based on the instructions

Actual Behavior

Currently observing:

  1. ❌ The file is NOT included in chat context attachments
  2. ❌ The file does NOT appear in "Used references" list
  3. ⚠️ HOWEVER: Markdown links inside copilot-instructions.md ARE being parsed, and linked files ARE loaded as attachments

Steps to Reproduce

  1. 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
  2. Ensure github.copilot.chat.codeGeneration.useInstructionFiles setting is enabled

  3. Open GitHub Copilot Chat and start a new conversation

  4. Send any message (e.g., "Hello") and check "Used references" section

  5. Expected: copilot-instructions.md appears in the references list

  6. Actual: File is missing from references

  7. 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

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions