Skip to content

Opencode writes user-specific non-essential data to XDG_CONFIG_HOME #21966

Closed

Description

@sergentbne

Description

Opencode uses .config/opencode to write a package.json, package-lock.json, bun.lock and dump a whole node_modules straight into the config directory.

As per the XDG Specification (alternate), XDG_CONFIG_HOME (earlier mentioned as ".config") is used for "user-specific configurations". Please do not dump what is mostly akin to junk into said config directory.

I wish you to seek the proper alternative. Indeed, the XDG Specification defines "user-specific non-essential (cached) data" to be written to to XDG_CACHE_HOME (or .cache to make simple).

Please write to .cache instead of .config

Thank you for your patience!

Plugins

None

OpenCode version

1.4.0

Steps to reproduce

$ pwd
[~]/.config/opencode
$ ls
opencode.json
$ opencode 
$ ls
node_modules  opencode.json  package-lock.json  package.json

Screenshot and/or share link

No response

Operating System

Macos Sequoia 15.7.1 (should not matter)

Terminal

Wezterm (this either)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 11, 2026
  2. github-actions commented on Apr 11, 2026

    @github-actions
    Contributor

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

  3. sergentbne commented on Apr 11, 2026

    @sergentbne
    Author

    duplicate. did not search enough. that being said. please fix

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions