Expand description
Filesystem layout for opencode state.
opencode stores everything under $XDG_DATA_HOME/opencode/
(~/.local/share/opencode/ on macOS/Linux). The primary
conversation store is the opencode.db SQLite database; per-step
filesystem snapshots live in sibling bare git repositories under
snapshot/<project-id>/<sha1(worktree)>/.
project.id is itself the SHA of the repo’s first root commit
(git rev-list --max-parents=0 HEAD), so a project survives
being moved on disk. The inner snapshot dirname is the SHA-1 of
the absolute worktree path, which means snapshots are keyed by
exact path — moving the worktree orphans old snapshots even
though the session IDs still resolve.
Structs§
- Path
Resolver - Builder-style resolver over the opencode data directory.