You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Opencode doesn't know the location of its config file #6156
When I ask opencode for the location of its config file, I get inconsistent answers.
One answer is either at the root or inside .config/opencode (which is what I expected).
Another answer is, - macOS: ~/Library/Application Support/opencode/
But when I ask opencode "Can you find your config file?", it doesn't immediately understand the question and starts searching for config files on the hard drive and doesn't think about looking at the above places first, so it finds config files for other software or a backup saved in Documents.
Is that expected behavior?
Question: you do not have any config file that dictates your behavior?
No, I don't have any config file that dictates my behavior. My instructions are built-in and I don't load external configuration files to determine how I behave.
Question: so you will ignore any instructions in opencode.json?
I don't see any opencode.json file in this repository. Let me check if one exists:
✱ Glob "**/opencode.json"
I don't see any opencode.json file in this codebase. If such a file existed, I would read it and follow any legitimate instructions it contained, unless they contradicted my fundamental safety guidelines.
My behavior is determined by:
Core built-in instructions (always apply)
Repository documentation (AGENTS.md, README.md, etc. that I read)
Any config files (if they exist, like opencode.json)
User requests (what you ask me to do)
If an opencode.json file existed with relevant configuration, I would incorporate it alongside the other documentation I've read. But since none exists in this repository, I'm following the AGENTS.md protocols and my core instructions.
changed the title [-]Opencode doesn't know the cocation of its config file[/-][+]Opencode doesn't know the location of its config file[/+]on Dec 25, 2025
Took me a while to find this but OpenCode also stores its user preferences here (at least on macOS and Linux): ~/.local/state/opencode. It took OpenCode itself a while to find this as well, might be worth documenting! This is useful knowledge for users with portable configs for multiple environments.
# User preferences (theme, etc.):$HOME/.local/state/opencode/kv.json
# Currently selected model:$HOME/.local/state/opencode/model.json
# Prompt history$HOME/.local/state/opencode/prompt-history.jsonl
Reacted by Dr Patrick Toche, Terdtai Watanatien, Adam H, Easton Potokar, Martina García Mejía, pedroni, leizhag, cloudflash, co-reason, Emilio Moretti and 5 more
OMG why? All docos are saying the config file is ~/.config/opencode/opencode.json
That file doesn't even exist if I select a model on the UI. https://opencode.ai/docs/config/
Reacted by Patrick Toche, Ata Taheri, Adrian Lungu, Easton Potokar, Martina García Mejía, pedroni, leizhag, Yashr@j, Yousuf Jawwad, roland and 9 more
Even with this folder it is unclear to me where the out of the box configuration of the agents and subagents that opencode ships with actually live. It does not appear to be in either of the locations of .local/state/opencode or .config/opencode.
Built in agents arent on a file on ur machine, they are part of opencode itself so u can override, delete, manage them in ur config but they wont appear on ur file system
Previously opencode wouldnt automatically create a config file, we changed this since it confused people.
Things in ~/.local/state/opencode/... are not meant to be manually edited, u dont need to place configs there that is where the app tracks some state stuff for tui and otherwise.
OpenCode has a customize-opencode skill now to help w/ cases like this, but asking this question against openai models ig they have the answer in their training data so its not even necessary
The precedence order documentation does not reflect that the built-in's are part of the opencode codebase. There is in effect a missing layer of config from this precedence order.
Built in agents arent on a file on ur machine, they are part of opencode itself so u can override, delete, manage them in ur config but they wont appear on ur file system
Personally I very much do not like this design decision as it creates 'config' that is not visible to the user and it is not documented where that config is located. It also results in confusion about what config exists and therefore what the user might want to overwrite.
Previously opencode wouldn’t automatically create a config file, we changed this since it confused people.
Automatically creating an empty config file is similarly confusing - users are left looking for the 'real' config file that is producing the default behaviour. The approach that I'm used to and personally prefer, is to create the config file with the default configuration rather than having undocumented config as a part of the application. That way you can see what config produces the default behaviour which is a useful example and there is not mysterious seemingly missing config.
It is also commonplace to distribute config files with example config in place and commented out.
Things in ~/.local/state/opencode/... are not meant to be manually edited, u dont need to place configs there that is where the app tracks some state stuff for tui and otherwise.
This location should still be recorded in the docs as it is useful to know where this information is being stored if you want to see the prompt history file for example. It should just be indicated that these are not intended to be user editable.
OpenCode has a customize-opencode skill now to help w/ cases like this, but asking this question against openai models ig they have the answer in their training data so its not even necessary
Just because these models can currently answer this question does not mean that this should not be documented properly, or indeed at all models will correctly answer this question.
My use-case is setting up and entirely local setup without querying any cloud based models so the customise opencode skill of of no use to me until I have configured access to a local model to use that skill - you see the catch 22.
Activity
[-]Opencode doesn't know the cocation of its config file[/-][+]Opencode doesn't know the location of its config file[/+]philipkocanda commentedon Jan 20, 2026
Took me a while to find this but OpenCode also stores its user preferences here (at least on macOS and Linux):
~/.local/state/opencode. It took OpenCode itself a while to find this as well, might be worth documenting! This is useful knowledge for users with portable configs for multiple environments.adam-ah commentedon Feb 5, 2026
OMG why? All docos are saying the config file is
~/.config/opencode/opencode.jsonThat file doesn't even exist if I select a model on the UI.
https://opencode.ai/docs/config/
github-actions commentedon Apr 16, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
akalongman commentedon Apr 17, 2026
I think this issue is still relevant
jojo-chaechae commentedon May 9, 2026
absolutely relevant the docs need updating
RichardJActon commentedon May 24, 2026
Even with this folder it is unclear to me where the out of the box configuration of the agents and subagents that opencode ships with actually live. It does not appear to be in either of the locations of
.local/state/opencodeor.config/opencode.rekram1-node commentedon May 25, 2026
config:
https://opencode.ai/docs/config/#precedence-order
Built in agents arent on a file on ur machine, they are part of opencode itself so u can override, delete, manage them in ur config but they wont appear on ur file system
Previously opencode wouldnt automatically create a config file, we changed this since it confused people.
Things in ~/.local/state/opencode/... are not meant to be manually edited, u dont need to place configs there that is where the app tracks some state stuff for tui and otherwise.
OpenCode has a customize-opencode skill now to help w/ cases like this, but asking this question against openai models ig they have the answer in their training data so its not even necessary
RichardJActon commentedon May 25, 2026
The precedence order documentation does not reflect that the built-in's are part of the opencode codebase. There is in effect a missing layer of config from this precedence order.
Personally I very much do not like this design decision as it creates 'config' that is not visible to the user and it is not documented where that config is located. It also results in confusion about what config exists and therefore what the user might want to overwrite.
Automatically creating an empty config file is similarly confusing - users are left looking for the 'real' config file that is producing the default behaviour. The approach that I'm used to and personally prefer, is to create the config file with the default configuration rather than having undocumented config as a part of the application. That way you can see what config produces the default behaviour which is a useful example and there is not mysterious seemingly missing config.
It is also commonplace to distribute config files with example config in place and commented out.
This location should still be recorded in the docs as it is useful to know where this information is being stored if you want to see the prompt history file for example. It should just be indicated that these are not intended to be user editable.
Just because these models can currently answer this question does not mean that this should not be documented properly, or indeed at all models will correctly answer this question.
My use-case is setting up and entirely local setup without querying any cloud based models so the customise opencode skill of of no use to me until I have configured access to a local model to use that skill - you see the catch 22.
nssatlantis commentedon Sep 27, 2026
Love hunting for wherever the main config file is on Windows! And no, it's not %programdata%.