Description
When running opencode, the application installs runtime dependencies (node_modules, package.json, and package-lock.json) into ~/.config/opencode.
This is a violation of the XDG Base Directory Specification. The ~/.config directory ($XDG_CONFIG_HOME) is strictly reserved for user-specific configuration files. Runtime data, dependencies, and state files should be stored in ~/.local/share ($XDG_DATA_HOME).
Why this is a problem
- Many users back up their
~/.config directory using tools like git (dotfiles), stow, or chezmoi. Placing node_modules in this directory causes massive repository bloat, sync issues, and forces users to manually add workarounds to their .gitignore files.
- Broken File Watchers: Applications, background daemons, or text editors that monitor
~/.config for configuration changes get overwhelmed or stuck in infinite reload loops due to the massive number of files and rapid I/O operations within node_modules.
- Loss of Configuration Portability: Mixing mutable runtime dependencies with immutable configuration files breaks portability across different environments (Linux, macOS). It prevents users from symlinking their configs using tools like
stow, as the application attempts to write heavy runtime data directly into the clean config structure.
Plugins
None
OpenCode version
1.15.0
Steps to reproduce
- Launch
opencode.
- Check the contents of the config directory:
ls ~/.config/opencode.
- Notice that
node_modules, package.json, and package-lock.json are created there.
Expected behavior
- Configuration files stay in
~/.config/opencode/ (or $XDG_CONFIG_HOME/opencode/).
- Runtime dependencies, packages, and downloaded data should be placed in
~/.local/share/opencode/ (or $XDG_DATA_HOME/opencode/).
Actual behavior
Runtime dependencies and package tracking files are placed in ~/.config/opencode/.
Operating System
Arch Linux
Terminal
Ghostty
Description
When running
opencode, the application installs runtime dependencies (node_modules,package.json, andpackage-lock.json) into~/.config/opencode.This is a violation of the XDG Base Directory Specification. The
~/.configdirectory ($XDG_CONFIG_HOME) is strictly reserved for user-specific configuration files. Runtime data, dependencies, and state files should be stored in~/.local/share($XDG_DATA_HOME).Why this is a problem
~/.configdirectory using tools likegit(dotfiles),stow, orchezmoi. Placingnode_modulesin this directory causes massive repository bloat, sync issues, and forces users to manually add workarounds to their.gitignorefiles.~/.configfor configuration changes get overwhelmed or stuck in infinite reload loops due to the massive number of files and rapid I/O operations withinnode_modules.stow, as the application attempts to write heavy runtime data directly into the clean config structure.Plugins
None
OpenCode version
1.15.0
Steps to reproduce
opencode.ls ~/.config/opencode.node_modules,package.json, andpackage-lock.jsonare created there.Expected behavior
~/.config/opencode/(or$XDG_CONFIG_HOME/opencode/).~/.local/share/opencode/(or$XDG_DATA_HOME/opencode/).Actual behavior
Runtime dependencies and package tracking files are placed in
~/.config/opencode/.Operating System
Arch Linux
Terminal
Ghostty