Describe the bug
When a repository contains .github/instructions/*.instructions.md files with applyTo YAML frontmatter, the
CLI inlines the full content of every instruction file into the system prompt at session start — regardless of whether the task touches matching files.
The system prompt also tells the agent to view these files before making changes, which is redundant since they're already in context.
In repos with many instruction files (e.g. dotnet/runtime has 14), this wastes significant context tokens on every session.
Affected version
GitHub Copilot CLI 1.0.33
Steps to reproduce the behavior
Steps to reproduce:
- Clone a repo with multiple .github/instructions/*.instructions.md files (e.g. dotnet/runtime)
- Start a Copilot CLI session
- Ask a simple question that doesn't involve code changes
- Observe large context usage from session start — all instruction file contents are in the system prompt
Expected behavior
The CLI should include only the pattern → filepath mapping in the system and let the agent view relevant instruction files on demand using the applyTo glob patterns.
Whenever a tool would decide to read/write a file, the system would frontload the relevant content.
Additional context
This was spotted by increased context usage - for large repos, it is not feasible to fit all instruction files into a single session's context window.
The ability to split instructions based on repo's directory structure is good - but it must be done in a lazy, just in time, manner.
Describe the bug
When a repository contains .github/instructions/*.instructions.md files with applyTo YAML frontmatter, the
CLI inlines the full content of every instruction file into the system prompt at session start — regardless of whether the task touches matching files.
The system prompt also tells the agent to view these files before making changes, which is redundant since they're already in context.
In repos with many instruction files (e.g. dotnet/runtime has 14), this wastes significant context tokens on every session.
Affected version
GitHub Copilot CLI 1.0.33
Steps to reproduce the behavior
Steps to reproduce:
Expected behavior
The CLI should include only the pattern → filepath mapping in the system and let the agent view relevant instruction files on demand using the applyTo glob patterns.
Whenever a tool would decide to read/write a file, the system would frontload the relevant content.
Additional context
This was spotted by increased context usage - for large repos, it is not feasible to fit all instruction files into a single session's context window.
The ability to split instructions based on repo's directory structure is good - but it must be done in a lazy, just in time, manner.