Skip to content

Opencode adds stuff to global config folder #3191

Closed

Description

@einarpersson

I noticed that opencode added some random stuff to the global config folder $HOME/.config/opencode

.config/opencode via 🥟
❯ ll
total 12K
drwxr-xr-x. 1 einar  22 Oct 14 18:33 agent
drwxr-xr-x. 1 einar  30 Oct 15 15:24 node_modules
-rw-r--r--. 1 einar 689 Oct 15 15:24 bun.lock
-rw-r--r--. 1 einar  45 Oct 15 15:24 .gitignore
-rw-r--r--. 1 einar  63 Oct 15 15:24 package.json

Why? These aren't config files (expect my agent folder), but rather lookes like some internal concerns that should be somewhere else, eg $XDG_CACHE_HOME or something. I like to keep my dotfiles folder nice and clean and only have stuff there which I control.

If i delete node_modules, bun.lock, package.json and .gitignore and start opencode everything works still. The files are recreated.

I am not an expert in the XDG spec but my feeling is that these files should live elsewhere.
https://specifications.freedesktop.org/basedir-spec/latest/

Activity

  1. github-actions commented on Oct 15, 2025

    @github-actions
    Contributor

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

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

  2. rekram1-node commented on Oct 15, 2025

    @rekram1-node
    Contributor

    opencode automatically adds those so you can take advantage of the plugins and custom tools easily since the dependency will already be installed

  3. xiaotian commented on Jan 17, 2026

    @xiaotian

    Second this as a very annoying bug. I like my ~/.config to be for config files only, so I don't have to write custom .gitignore rules just to exclude them. Runtime artifacts like lock files have no place in such directory.

    Also installing ~100M npm packages and binaries under ~/.opencode/ is an odd choice. they are for dot files.

    Amazing project BTW, but if we can make LLM to do years worth software development in a week, we can find a way to respect XDG conventions.

  4. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  5. vanyauhalin commented on Mar 27, 2026

    @vanyauhalin
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions