Answer: Save Markdown agent files globally at ~/.config/opencode/agents/.md, or per project inside .opencode/agents/.md. Status: Confirmed Entry: tool/opencode/agents-and-automation/agent-file-locations Revision: 1 Digest: sha256:349dd09e74f3a39e (changes whenever the content changes) Timeline: Created: 2026-11-13T03:55:26Z Last changed: 2026-11-13T03:55:26Z Last verified: 2026-11-20T13:44:12Z Next check: 2026-11-21T13:44:12Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Global location | ~/.config/opencode/agents/.md | [1] | 2026-11-20 Project location | .opencode/agents/.md | [1] | 2026-11-20 Nested path example | .opencode/agents/team/reviewer.md → team/reviewer | [1] | 2026-11-20 Sources: [1] opencode. "Agents | OpenCode". https://opencode.ai/docs/agents/ Role: primary. Accessed: 2026-11-20T13:44:12Z Quote: "~/.config/opencode/agents/.md" (Supports: Global location) Quote: ".opencode/agents/.md" (Supports: Project location) Quote: ".opencode/agents/team/reviewer.md → team/reviewer" (Supports: Nested path example) Snapshot SHA-256: a4d70968cf4cad31cb27a288ac9341ec6bcbc97acb00c712b5681098e11ab672 (captured 2026-11-13T03:55:26Z) 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-13T03:55:26Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:12Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:12Z Last attempt: 2026-11-20T13:44:12Z Notes and limitations: Extracted automatically from a single official source (section "Locations"). Related: https://latestn.com/tool/opencode/agents-and-automation/builtin-agents What built-in agents does opencode include and what are their modes? https://latestn.com/tool/opencode/agents-and-automation/create-skill How do I create a skill in opencode? https://latestn.com/tool/opencode/agents-and-automation/export-effect-plugin How do I export an Effect plugin so opencode loads it automatically? https://latestn.com/tool/opencode/admin-and-enterprise/verify-email-domains How do I verify email domains for SSO in opencode? https://latestn.com/tool/opencode/admin-and-enterprise/workspace-roles-ownership What roles exist in an OpenCode Console workspace and how do I transfer ownership? https://latestn.com/tool/opencode/agents-and-automation/agent-file-formats How do I define an opencode agent in Markdown or JSONC format? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:55:26Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/agents-and-automation/agent-file-locations/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/agents-and-automation/agent-file-locations POST: https://latestn.com/dispute/tool/opencode/agents-and-automation/agent-file-locations with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/agents-and-automation/agent-file-locations?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). Where do I save an opencode agent file so it's available globally or per project? Revision 1, last verified 2026-11-20T13:44:12Z. https://latestn.com/tool/opencode/agents-and-automation/agent-file-locations (accessed 2026-11-21T09:58:19Z). @misc{LatestN_tool_opencode_agents_and_automation_agent_file_locations_r1, title = {Where do I save an opencode agent file so it's available globally or per project?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/agents-and-automation/agent-file-locations}}, note = {Revision 1; digest sha256:349dd09e74f3a39e; last verified 2026-11-20T13:44:12Z; accessed 2026-11-21T09:58:19Z} } 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/agents-and-automation/agent-file-locations