Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsWhen AGENTS.md instructions conflict, first identify the agent harness and session type, then apply only the precedence rule that harness documents. In Codex, closer project instructions override earlier project instructions, while direct system, developer, and user prompts take precedence over AGENTS.md. Copilot CLI combines applicable instructions without defining a general precedence order, and VS Code warns that discovery and merge behavior varies by harness. If the active tool does not specify a winner, reconcile the files or ask their owner.
Start by identifying which agent is reading the files
AGENTS.md does not have one universal conflict rule. Codex CLI, GitHub Copilot CLI, Copilot on GitHub, and VS Code sessions can discover and combine instruction files differently. In VS Code, behavior also depends on the session type and settings: nested AGENTS.md discovery for its Local agent is experimental and disabled by default unless enabled, while Agent Host sessions follow the selected harness’s rules. Check the documentation for the specific product and session you are using before deciding that one file overrides another. VS Code documents these session and discovery differences.
How conflict handling differs by harness
| Harness or feature | Documented behavior | Practical implication |
|---|---|---|
| Codex | Project instructions are combined from the repository root down to the current working directory; closer files override earlier project guidance when they conflict. Direct system, developer, and user prompts take precedence over AGENTS.md. |
Use the applicable, more local project instruction when two project files conflict, but do not let either file override a direct prompt instruction. |
| GitHub Copilot CLI | It combines applicable user-level and repository instruction files, but its documentation does not establish a general precedence order among them. | Do not assume the repository file or user-level file wins. Clarify or remove the contradiction. |
| Copilot on GitHub | GitHub says the nearest AGENTS.md takes precedence when Copilot is working; repository-wide and matching path-specific instructions can also apply. |
Apply this rule to the GitHub feature described, not to every Copilot harness. |
| VS Code | Discovery and merge behavior can differ by session type and harness. VS Code advises against depending on a universal file-order rule to resolve conflicts. | Check the active session and its supported instruction sources; make the requirements consistent if precedence is unclear. |
Sources: OpenAI’s Codex description, GitHub Copilot CLI instructions, GitHub repository instructions for Copilot on GitHub, and VS Code custom instructions.
Resolve a conflict step by step
- Identify the harness and session. Confirm whether you are using Codex CLI, Copilot CLI, Copilot on GitHub, VS Code Local agent, or another session type. A product family may have more than one instruction-loading behavior.
- List the instruction sources that can apply. Note each file’s scope—global, repository-wide, nested, or path-specific—and check whether the harness discovers it for the current task. Do not treat a file as active merely because it exists somewhere in the repository.
- Check the official precedence rule. If the harness documents one, follow it within its stated scope. Do not transfer Codex’s rules to another tool or apply GitHub’s nearest-file rule to Copilot CLI.
- Reconcile unresolved contradictions. Edit the files so their requirements agree, or ask the instruction owner which behavior is intended. Scope local requirements to the relevant directory or path using a mechanism supported by the harness.
- Verify discovery and behavior. Use the product’s available instruction listing, session references, or logs to confirm which sources were loaded. Then try a representative task to check whether the instructions work as intended.
Codex: inspect the instruction chain and its limits
Codex checks its global guidance and project directories from the repository root through the current working directory. It does not search deeper, unrelated folders. At each project directory it uses at most one instruction file, preferring AGENTS.override.md, then AGENTS.md, then configured fallback filenames. Project files are combined from root toward the working directory, and closer guidance overrides earlier project guidance when they conflict. The Codex AGENTS.md configuration guide describes discovery and merging.
Recommended Free Tools
#1 Best Overall
Overrides and global guidance
At the global level, a non-empty AGENTS.override.md is used instead of AGENTS.md; only the first non-empty file is used at that level. Project directories likewise select at most one file per directory, using the documented preference order. An override therefore replaces the applicable file at that level; it is not a universal instruction that outranks every file or direct prompt.
Combined size and session refresh
Codex documents a default combined project-instructions size limit of 32 KiB; content beyond the configured limit may not be included. Its instruction chain is built when it starts, which in a TUI usually means once per launched session. After changing the working directory or updating instructions, start a new run or session if necessary so Codex can rebuild the active chain.
Direct prompts still take precedence
OpenAI’s published Codex system-message text says that more deeply nested AGENTS.md files take precedence when they conflict, and that direct system, developer, or user instructions take precedence over AGENTS.md. That is Codex-specific guidance; it does not establish how another harness resolves its files. See OpenAI’s published Codex description.
Copilot and VS Code: do not assume the same rule applies everywhere
GitHub Copilot CLI
Copilot CLI searches standard locations including the repository root, current working directory, intermediate directories, and directories nested along the path of a file it is working on. Path-specific *.instructions.md files apply when their applyTo pattern matches. The CLI combines applicable user-level and repository instructions, but its documentation does not define a general precedence order among them. Use /instructions to inspect discovered files and enable or disable individual ones. See GitHub’s Copilot CLI instructions guide.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
Copilot on GitHub
GitHub’s documentation for Copilot on GitHub says the nearest AGENTS.md takes precedence while Copilot is working, and that repository-wide and matching path-specific instructions can also be used. This is a documented behavior for that feature, not a rule to infer for Copilot CLI or every IDE integration. Read GitHub’s repository-instructions documentation.
VS Code sessions
VS Code supports multiple agent session types and instruction formats, so the active harness matters. Its Local agent’s nested AGENTS.md support is controlled by chat.useNestedAgentsMdFiles and is documented as disabled by default; Agent Host sessions follow their selected harness. VS Code recommends keeping user, repository, and organization requirements consistent rather than relying on file order to settle conflicts. See VS Code’s custom-instructions guide.
Rank #4
Confirm what was loaded, then test the result
Discovery is not the same as compliance: seeing a file in an instruction list confirms loading, but does not prove that the agent followed it. Codex documentation suggests asking Codex to report its loaded instruction sources and reviewing session logs when necessary. For Copilot CLI, inspect /instructions. In VS Code, confirm the file was discovered, then run a representative task and assess the behavior. If the contradiction persists despite a documented precedence rule, check that you are in the expected directory and session and that the latest instructions were loaded.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.

