Answer: OpenCode looks for its config file in the system configuration directory (macOS /Library/Application Support/opencode, Linux /etc/opencode, Windows %ProgramData%\opencode), the global configuration at ~/.config/opencode/opencode.json(c), and project files opencode.json(c) or .opencode/opencode.json(c), searching from the current directory to the filesystem root. Status: Confirmed Entry: tool/opencode/settings/config-file-locations Revision: 1 Digest: sha256:4e8cf3515814030f (changes whenever the content changes) Timeline: Created: 2026-11-13T03:56:37Z Last changed: 2026-11-13T03:56:37Z Last verified: 2026-11-20T13:45:39Z Next check: 2026-11-21T13:45:39Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of macOS system directory | /Library/Application Support/opencode | [1] | 2026-11-20 Linux system directory | /etc/opencode | [1] | 2026-11-20 Windows system directory | %ProgramData%\opencode | [1] | 2026-11-20 global config | ~/.config/opencode/opencode.json(c) | [1] | 2026-11-20 project config | /home/user/projects/my-app/opencode.json(c) | [1] | 2026-11-20 project .opencode config | /home/user/projects/my-app/.opencode/opencode.json(c) | [1] | 2026-11-20 search behavior | OpenCode searches from the current directory to the filesystem root. | [1] | 2026-11-20 Sources: [1] opencode. "Config | OpenCode". https://opencode.ai/docs/config/ Role: primary. Accessed: 2026-11-20T13:45:39Z Quote: "macOS /Library/Application Support/opencode" (Supports: macOS system directory) Quote: "Linux /etc/opencode" (Supports: Linux system directory) Quote: "Windows %ProgramData%\opencode" (Supports: Windows system directory) Quote: "~/.config/opencode/opencode.json(c)" (Supports: global config) Quote: "/home/user/projects/my-app/opencode.json(c)" (Supports: project config) Quote: "/home/user/projects/my-app/.opencode/opencode.json(c)" (Supports: project .opencode config) Quote: "OpenCode searches from the current directory to the filesystem root." (Supports: search behavior) Snapshot SHA-256: d03b055dad38e89a68db5764e6da7ba61ffbf573bfd2443c0350640f8718a8f5 (captured 2026-11-17T14:11:49Z) 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-17T14:11:49Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:45:39Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:45:39Z Last attempt: 2026-11-20T13:45:39Z Notes and limitations: Extracted automatically from a single official source (section "Locations"). Related: https://latestn.com/tool/opencode/settings/config-variables How do I set environment variables or reference files in opencode config? https://latestn.com/tool/opencode/settings/configure-claude-code-console How do I configure Claude Code to use OpenCode Console? https://latestn.com/tool/opencode/settings/configure-cli-plugins How do I configure plugins for the opencode CLI in cli.json? https://latestn.com/tool/opencode/settings/cloudflare-customize-config How do I customize the opencode Cloudflare SDK configuration? https://latestn.com/tool/opencode/settings/command-file-locations Where do global and project opencode commands live? https://latestn.com/tool/opencode/settings/compaction-buffer-setting How do I configure the compaction buffer setting in opencode? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:56:37Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/settings/config-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/settings/config-file-locations POST: https://latestn.com/dispute/tool/opencode/settings/config-file-locations with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/settings/config-file-locations?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). Where does opencode look for its config file and in what locations? Revision 1, last verified 2026-11-20T13:45:39Z. https://latestn.com/tool/opencode/settings/config-file-locations (accessed 2026-11-21T09:53:25Z). @misc{LatestN_tool_opencode_settings_config_file_locations_r1, title = {Where does opencode look for its config file and in what locations?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/settings/config-file-locations}}, note = {Revision 1; digest sha256:4e8cf3515814030f; last verified 2026-11-20T13:45:39Z; accessed 2026-11-21T09:53:25Z} } 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/settings/config-file-locations