Environment
- VS Code Insiders: 1.117.0 (commit
173f07e5fc, auto-updated April 20 2026)
- Previous version: 1.112.0 (commit
294552bebf)
- OS: Windows 11
- Model: Claude (Anthropic) via Copilot Chat
Bug
Rule files in ~/.claude/rules/ that have applyTo glob patterns are now unconditionally injected into the Copilot Chat system prompt, regardless of whether any files matching those globs are in the active editor context or relevant to the conversation.
The system prompt wraps all discovered rule files with:
"Make sure to acquire the instructions before working with the codebase."
The model obeys this blanket directive and eagerly calls read_file on every rule file at session start — even when no files matching any applyTo glob are open or relevant.
Previously (1.112), rule files with applyTo globs were not listed in the system prompt at all. Only unconditional instruction files (no applyTo) appeared.
Evidence — system_prompt_0.json diff
I compared debug logs (github.copilot.chat.agentDebugLog.enabled: true) from the same workspace with the same rule configuration, before and after the update.
Before (Apr 12, VS Code Insiders 1.112, 35,195 bytes)
<instructions>
Here is a list of instruction files...
<instruction>
<file>c:\Users\...\dotfiles\global.instructions.md</file>
</instruction>
</instructions>
1 file listed — only the unconditional global.instructions.md.
After (Apr 20, VS Code Insiders 1.117, 28,161 bytes)
<instructions>
Here is a list of instruction files...
Make sure to acquire the instructions before working with the codebase.
<instruction>
<file>c:\Users\...\.claude\rules\env-security.md</file>
<applyTo>**/.env*, **/secrets/**, **/*.secret.*, **/credentials*</applyTo>
</instruction>
<instruction>
<file>c:\Users\...\.claude\rules\migration-safety.md</file>
<applyTo>**/migrations/**, **/prisma/migrations/**, **/db/migrate/**</applyTo>
</instruction>
<instruction>
<file>c:\Users\...\.claude\rules\terminal-workarounds.md</file>
<applyTo>**/bin/**, **/*.sh, **/*.bash</applyTo>
</instruction>
<instruction>
<file>c:\Users\...\.claude\rules\test-conventions.md</file>
<applyTo>**/*.test.{ts,tsx,js,jsx}, **/*.spec.{ts,tsx,js,jsx}, **/__tests__/**</applyTo>
</instruction>
<instruction>
<file>c:\Users\...\.claude\rules\global.instructions.md</file>
</instruction>
</instructions>
5 files listed — all 4 conditional rule files injected alongside the blanket "acquire" directive. The <applyTo> metadata is present but the model has no instruction to treat it as a gate.
Additional changes in the new system prompt
| Aspect |
Old (1.112) |
New (1.117) |
| Model identity |
"Claude Opus 4.6" |
"GPT-5.3-Codex" (incorrect when using Claude) |
| Personality sections |
<communicationStyle>, <securityRequirements>, <operationalSafety>, <implementationDiscipline> |
<gptAgentInstructions>, <structuredWorkflow>, <communicationGuidelines> |
| Removed sections |
— |
<fileLinkification>, <notebookInstructions>, <toolSearchInstructions>, <communicationExamples>, <parallelizationStrategy>, <taskTracking> |
| New sections |
— |
<applyPatchInstructions>, <example> |
Impact
- Context bloat: ~30-50% unnecessary token usage at session start from loading irrelevant rule files
- Rules designed for narrow file types (
.env, migrations, tests) are loaded for every conversation regardless of topic
- The model has no way to distinguish "conditional metadata" from "load everything" since the wrapper says "acquire the instructions"
- Model identity is incorrect when using non-GPT models
Expected behavior
Rule files with <applyTo> globs should either:
- Not be injected into the system prompt unless files matching the glob are in the active editor context (the old 1.112 behavior), OR
- The wrapper text should instruct the model to respect
<applyTo> as a conditional gate and not load those files unless matching files are being worked on
Steps to reproduce
- Create rule files in
~/.claude/rules/ with frontmatter like applyTo: "**/*.test.*"
- Open a workspace with no test files, no
.env files, no migrations
- Enable
github.copilot.chat.agentDebugLog.enabled: true
- Start a new Copilot Chat agent session
- Observe the agent calling
read_file on every rule file at session start
- Check
system_prompt_0.json in debug logs to confirm all rules are in the prompt
Workaround
Adding a counter-directive in an always-loaded instruction file:
<rule-loading>
Instruction/rule files that include an `<applyTo>` glob pattern are CONDITIONAL —
only read them when a file matching that glob is actively being edited or is
directly relevant to the current task. Do NOT eagerly load all rule files at
session start. The `<applyTo>` metadata is a gate, not a label.
</rule-loading>
This is a soft mitigation — it depends on model compliance rather than platform enforcement.
Related issues
Environment
173f07e5fc, auto-updated April 20 2026)294552bebf)Bug
Rule files in
~/.claude/rules/that haveapplyToglob patterns are now unconditionally injected into the Copilot Chat system prompt, regardless of whether any files matching those globs are in the active editor context or relevant to the conversation.The system prompt wraps all discovered rule files with:
The model obeys this blanket directive and eagerly calls
read_fileon every rule file at session start — even when no files matching anyapplyToglob are open or relevant.Previously (1.112), rule files with
applyToglobs were not listed in the system prompt at all. Only unconditional instruction files (noapplyTo) appeared.Evidence —
system_prompt_0.jsondiffI compared debug logs (
github.copilot.chat.agentDebugLog.enabled: true) from the same workspace with the same rule configuration, before and after the update.Before (Apr 12, VS Code Insiders 1.112, 35,195 bytes)
1 file listed — only the unconditional
global.instructions.md.After (Apr 20, VS Code Insiders 1.117, 28,161 bytes)
5 files listed — all 4 conditional rule files injected alongside the blanket "acquire" directive. The
<applyTo>metadata is present but the model has no instruction to treat it as a gate.Additional changes in the new system prompt
<communicationStyle>,<securityRequirements>,<operationalSafety>,<implementationDiscipline><gptAgentInstructions>,<structuredWorkflow>,<communicationGuidelines><fileLinkification>,<notebookInstructions>,<toolSearchInstructions>,<communicationExamples>,<parallelizationStrategy>,<taskTracking><applyPatchInstructions>,<example>Impact
.env, migrations, tests) are loaded for every conversation regardless of topicExpected behavior
Rule files with
<applyTo>globs should either:<applyTo>as a conditional gate and not load those files unless matching files are being worked onSteps to reproduce
~/.claude/rules/with frontmatter likeapplyTo: "**/*.test.*".envfiles, no migrationsgithub.copilot.chat.agentDebugLog.enabled: trueread_fileon every rule file at session startsystem_prompt_0.jsonin debug logs to confirm all rules are in the promptWorkaround
Adding a counter-directive in an always-loaded instruction file:
This is a soft mitigation — it depends on model compliance rather than platform enforcement.
Related issues
.instructions.mdfiles withapplyTo: "**"discovered but not automatically included (inverse problem — files not loading when they should)excludeAgentflag in instructions file