Answer: Place AGENTS.md in the directory where its guidance should apply; keep guidance that applies everywhere in the global file, put repository-wide guidance at the project root, and more specific guidance closer to the code it covers. Status: Overdue (check was due 2026-11-20T13:36:51Z and has not succeeded) Entry: tool/opencode/memory-and-context/agents-md-file-location Revision: 2 Digest: sha256:c7a72f9117957f63 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:57:40Z Last changed: 2026-11-19T13:36:51Z (example deeper file: — → ~/code/my-project/packages/web/AGENTS.md) Last verified: 2026-11-19T13:36:51Z Next check: 2026-11-20T13:36:51Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of placement rule | Place AGENTS.md in the directory where its guidance should apply. | [1] | 2026-11-19 global file | Keep guidance that applies everywhere in the global file. | [1] | 2026-11-19 project root guidance | Put repository-wide guidance at the project root | [1] | 2026-11-19 global file path | ~/.config/opencode/AGENTS.md | [1] | 2026-11-19 example project root file | ~/code/my-project/AGENTS.md | [1] | 2026-11-19 example nested file | ~/code/my-project/packages/AGENTS.md | [1] | 2026-11-19 example deeper file | ~/code/my-project/packages/web/AGENTS.md | [1] | 2026-11-19 Sources: [1] opencode. "Instructions | OpenCode". https://opencode.ai/docs/instructions/ Role: primary. Accessed: 2026-11-19T13:36:51Z Quote: "Place AGENTS.md in the directory where its guidance should apply." (Supports: placement rule) Quote: "Keep guidance that applies everywhere in the global file." (Supports: global file) Quote: "Put repository-wide guidance at the project root and more specific guidance closer to the code it covers." (Supports: project root guidance) Quote: "~/.config/opencode/AGENTS.md" (Supports: global file path) Quote: "~/code/my-project/AGENTS.md" (Supports: example project root file) Quote: "~/code/my-project/packages/AGENTS.md" (Supports: example nested file) Quote: "~/code/my-project/packages/web/AGENTS.md" (Supports: example deeper file) Snapshot SHA-256: 1658411ae7ccab85bdcabcdc548fba65e11a1a2c73766d8708ecf3e60b45b6ec (captured 2026-11-18T13:40:08Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:40:08Z, so the values verified then were kept. Cross-check: not-available at 2026-11-19T13:36:51Z. No independent second source is configured for this entry Last successful check: 2026-11-19T13:36:51Z Last attempt: 2026-11-19T13:36:51Z Notes and limitations: Extracted automatically from a single official source (section "Scope"). Related: https://latestn.com/tool/opencode/memory-and-context/instructions-updates How do I update opencode project instructions when files change? https://latestn.com/tool/opencode/memory-and-context/manual-compaction How do I trigger compaction manually in opencode? https://latestn.com/tool/opencode/models/choose-edit-models-pricing How do I choose or edit models and set custom pricing in opencode Console? https://latestn.com/tool/opencode/integrations/use-in-ci How do I use opencode in a CI pipeline like GitHub Actions? https://latestn.com/tool/opencode/integrations/websearch-providers-env-vars Which web search providers does opencode support and what environment variables do they use? https://latestn.com/tool/opencode/memory-and-context/agents-md-discovery-order How does opencode discover and order AGENTS.md instruction files? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T13:36:51Z | changed | example deeper file: — → ~/code/my-project/packages/web/AGENTS.md | [1] 2026-11-19T13:36:51Z | changed | example nested file: — → ~/code/my-project/packages/AGENTS.md | [1] 2026-11-19T13:36:51Z | changed | example project root file: — → ~/code/my-project/AGENTS.md | [1] 2026-11-19T13:36:51Z | changed | deeper nested file path: ~/code/my-project/packages/web/AGENTS.md → — | [1] 2026-11-19T13:36:51Z | changed | nested file path: ~/code/my-project/packages/AGENTS.md → — | [1] 2026-11-19T13:36:51Z | changed | project root file path: ~/code/my-project/AGENTS.md → — | [1] 2026-11-13T03:57:40Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/memory-and-context/agents-md-file-location/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/memory-and-context/agents-md-file-location POST: https://latestn.com/dispute/tool/opencode/memory-and-context/agents-md-file-location with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/memory-and-context/agents-md-file-location?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). Where should I place AGENTS.md files so opencode applies them to the right directories? Revision 2, last verified 2026-11-19T13:36:51Z. https://latestn.com/tool/opencode/memory-and-context/agents-md-file-location (accessed 2026-11-21T09:54:56Z). @misc{LatestN_tool_opencode_memory_and_context_agents_md_file_location_r2, title = {Where should I place AGENTS.md files so opencode applies them to the right directories?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/memory-and-context/agents-md-file-location}}, note = {Revision 2; digest sha256:c7a72f9117957f63; last verified 2026-11-19T13:36:51Z; accessed 2026-11-21T09:54:56Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/memory-and-context/agents-md-file-location