id: context-paths
Context files are resolved in this order (later sources override earlier ones for conflicting keys):
~/.config/opencode/context/) — user-wide defaults.opencode/context/ in project root) — project-specific, highest priorityThis mirrors OpenCode's own config merging behavior (see OpenCode Config Docs).
| Content Type | Recommended Location | Why |
|---|---|---|
| Project Intelligence (tech stack, patterns, naming) | Local .opencode/context/project-intelligence/ |
Project-specific, committed to git, shared with team |
| Core Standards (code-quality, docs, tests) | Wherever OAC was installed | Universal standards, same across projects |
| Personal Defaults (your preferred patterns) | Global ~/.config/opencode/context/project-intelligence/ |
Personal coding style across all projects |
Example: User installs OAC globally (core standards at ~/.config/opencode/context/core/), then runs /add-context in a project (creates .opencode/context/project-intelligence/ locally). The agent loads both: core standards from global, project intelligence from local.
{
"paths": {
"local": ".opencode/context",
"global": "~/.config/opencode/context"
}
}
Set "global": false to disable global context loading.
The installer supports OPENCODE_INSTALL_DIR to override the install location:
export OPENCODE_INSTALL_DIR=~/custom/path
bash install.sh developer
OpenCode itself supports OPENCODE_CONFIG_DIR for a custom config directory (see OpenCode docs). If set, context files in that directory are loaded alongside global and local configs.
If you installed globally but want project-specific context:
/context migrate
This copies project-intelligence/ from global (~/.config/opencode/context/) to local (.opencode/context/), so your project patterns are committed to git and shared with your team. See /context migrate for details.
bash install.sh developer.opencode/context/bash install.sh developer --install-dir ~/.config/opencode~/.config/opencode/context/core//add-context in project → creates .opencode/context/project-intelligence/ locally/add-context --global to save personal coding patterns/add-context