Reorganize and document dirs for config, agents, auth credentials, sessions #2759

Open
opened 2026-02-16 17:37:08 -05:00 by yindo · 4 comments
Owner

Originally created by @gw0 on GitHub (Nov 10, 2025).

Description

Opencode docs give the incorrect impression that all configuration (aka everything worth preserving) is in ~/.config/opencode/ which is not true. If installed via Bun on Debian, more important things are in ~/.local/share/opencode/. Please reorganize/deduplicate dirs and document what is where (and what one should preserve).

~/.local/share/opencode/: Auth credentials, sessions, logs, and binaries (why are binaries not installed as requirements?).

auth.json  bin  log  storage

~/.local/state/opencode: Recently used model (why separate from config?).

model.json

~/.config/opencode/: Main configuration if you create it (why is there no config by default?), and agent definitions if you create them. Dependencies (duplicates of .bun/install/cache/) (why is code under config?).

bun.lock  node_modules  package.json

~/.cache/opencode/: Dependencies (duplicates of .bun/install/cache/).

bun.lock  models.json  node_modules  package.json  version

OpenCode version

v1.0.55

Steps to reproduce

Run opencode in a clean environment (docker run -it --rm oven/bun:1.3-debian bash) and check what gets created in home dir.

Screenshot and/or share link

No response

Operating System

Debian

Terminal

No response

Originally created by @gw0 on GitHub (Nov 10, 2025). ### Description Opencode docs give the incorrect impression that all configuration (aka everything worth preserving) is in `~/.config/opencode/` which is not true. If installed via Bun on Debian, more important things are in `~/.local/share/opencode/`. Please reorganize/deduplicate dirs and document what is where (and what one should preserve). `~/.local/share/opencode/`: Auth credentials, sessions, logs, and binaries (why are binaries not installed as requirements?). ``` auth.json bin log storage ``` `~/.local/state/opencode`: Recently used model (why separate from config?). ``` model.json ``` `~/.config/opencode/`: Main configuration if you create it (why is there no config by default?), and agent definitions if you create them. Dependencies (duplicates of `.bun/install/cache/`) (why is code under config?). ``` bun.lock node_modules package.json ``` `~/.cache/opencode/`: Dependencies (duplicates of `.bun/install/cache/`). ``` bun.lock models.json node_modules package.json version ``` ### OpenCode version v1.0.55 ### Steps to reproduce Run opencode in a clean environment (`docker run -it --rm oven/bun:1.3-debian bash`) and check what gets created in home dir. ### Screenshot and/or share link _No response_ ### Operating System Debian ### Terminal _No response_
yindo added the documentation label 2026-02-16 17:37:08 -05:00
Author
Owner

@rekram1-node commented on GitHub (Nov 10, 2025):

Most of this is because you as a user shouldn't touch any of the other files.

This is XDG Base Directory Specification

User configuration files: ~/.config/
User data files: ~/.local/share/
User cache files: ~/.cache/
User state files: ~/.local/state/

@rekram1-node commented on GitHub (Nov 10, 2025): Most of this is because you as a user shouldn't touch any of the other files. This is XDG Base Directory Specification User configuration files: ~/.config/ User data files: ~/.local/share/ User cache files: ~/.cache/ User state files: ~/.local/state/
Author
Owner

@gw0 commented on GitHub (Nov 10, 2025):

User configuration files: ~/.config/

So why not have all configuration here? Like auth credentials (~/.local/share/opencode/auth.json) and recently used model (~/.local/state/opencode/model.json)?

Following XDG specs code (node_modules) should not be there.

@gw0 commented on GitHub (Nov 10, 2025): > User configuration files: ~/.config/ So why not have all configuration here? Like auth credentials (`~/.local/share/opencode/auth.json`) and recently used model (`~/.local/state/opencode/model.json`)? Following XDG specs code (`node_modules`) should not be there.
Author
Owner

@rekram1-node commented on GitHub (Nov 10, 2025):

We use the other ones because u as a user shouldn't be editing either of those manually

@rekram1-node commented on GitHub (Nov 10, 2025): We use the other ones because u as a user shouldn't be editing either of those manually
Author
Owner

@rekram1-node commented on GitHub (Nov 10, 2025):

Everything in ~/.config/opencode is owned by u the user, we automatically install the opencode plugin dep in their because people kept getting confused about it not being installed

@rekram1-node commented on GitHub (Nov 10, 2025): Everything in ~/.config/opencode is owned by u the user, we automatically install the opencode plugin dep in their because people kept getting confused about it not being installed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2759