Config file not auto-loaded from ~/.config/opencode/opencode.json #6522

Closed
opened 2026-02-16 18:04:28 -05:00 by yindo · 2 comments
Owner

Originally created by @gruszek-i on GitHub (Jan 16, 2026).

Originally assigned to: @rekram1-node on GitHub.

Question

I have a config file at:
~/.config/opencode/opencode.json
It defines a primary agent (research) with a prompt that loads:
$HOME/.config/opencode/prompts/research.txt
However, in my session the config does not seem to be applied automatically (the agent prompt isn’t loaded at startup). I confirmed the file exists and is valid JSON.
Questions:

  1. Is ~/.config/opencode/opencode.json supported, or only workspace root?
  2. How to make the agent automatically apply his prompt defined in a global config (from a file)?
    Expected:
    Config is loaded automatically on startup.
    Actual:
    Config seems ignored unless agent is told to read the file provided in the config.
Originally created by @gruszek-i on GitHub (Jan 16, 2026). Originally assigned to: @rekram1-node on GitHub. ### Question I have a config file at: ~/.config/opencode/opencode.json It defines a primary agent (research) with a prompt that loads: $HOME/.config/opencode/prompts/research.txt However, in my session the config does not seem to be applied automatically (the agent prompt isn’t loaded at startup). I confirmed the file exists and is valid JSON. Questions: 1) Is ~/.config/opencode/opencode.json supported, or only workspace root? 2) How to make the agent automatically apply his prompt defined in a global config (from a file)? Expected: Config is loaded automatically on startup. Actual: Config seems ignored unless agent is told to read the file provided in the config.
yindo closed this issue 2026-02-16 18:04:28 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #152: Read custom providers from opencode.json from central ~/.config/opencode/ config instead of root of each project
  • #6984: Config autoupdate only respected at global path
  • #4288: [FEATURE]: Global config with custom rules

These issues discuss similar problems with global configuration loading from ~/.config/opencode/ not being properly applied at startup.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 16, 2026): This issue might be a duplicate of existing issues. Please check: - #152: Read custom providers from `opencode.json` from central `~/.config/opencode/` config instead of root of each project - #6984: Config autoupdate only respected at global path - #4288: [FEATURE]: Global config with custom rules These issues discuss similar problems with global configuration loading from `~/.config/opencode/` not being properly applied at startup. Feel free to ignore if none of these address your specific case.
Author
Owner

@gruszek-i commented on GitHub (Jan 16, 2026):

The issue was a trailing space in {file:...}

@gruszek-i commented on GitHub (Jan 16, 2026): The issue was a trailing space in {file:...}
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6522