[FEATURE]: Configurable data/history directory for repo/devcontainer #8655

Open
opened 2026-02-16 18:10:30 -05:00 by yindo · 1 comment
Owner

Originally created by @davzucky on GitHub (Feb 5, 2026).

Originally assigned to: @thdxr on GitHub.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

In devcontainers, OpenCode history is lost on container restart because data is stored in the container filesystem. Please add a way to configure the data/history directory so it can be persisted on a mounted volume or within the repository. Proposed options:

  • Config option (e.g. in opencode.json) to set the data directory relative to the current git repo (like .opencode/) for project-scoped history.
  • Environment variable to override the data directory path globally (for containerized/devcontainer use).

Benefits: persistent history across container restarts, easier backups, and predictable project-local storage when working inside git repositories.

Originally created by @davzucky on GitHub (Feb 5, 2026). Originally assigned to: @thdxr on GitHub. - [x] I have verified this feature I'm about to request hasn't been suggested before. ## Describe the enhancement you want to request In devcontainers, OpenCode history is lost on container restart because data is stored in the container filesystem. Please add a way to configure the data/history directory so it can be persisted on a mounted volume or within the repository. Proposed options: - Config option (e.g. in opencode.json) to set the data directory relative to the current git repo (like .opencode/) for project-scoped history. - Environment variable to override the data directory path globally (for containerized/devcontainer use). Benefits: persistent history across container restarts, easier backups, and predictable project-local storage when working inside git repositories.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 5, 2026):

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

  • #8968: [FEATURE]: Support OPENCODE_CACHE_DIR and OPENCODE_LOG_DIR for full isolation - Proposes environment variables (OPENCODE_DATA_DIR, OPENCODE_CACHE_DIR, OPENCODE_LOG_DIR, OPENCODE_STATE_DIR) for full portable mode with zero reliance on default XDG directories
  • #10349: Sessions not visible across platforms when syncing data directory - Related issue about syncing OpenCode data directory across platforms (Windows, macOS, Linux) with path normalization concerns
  • #4526: [FEATURE]: Full portable mode - Original feature request for portable mode with configurable data directories

Feel free to ignore if your specific use case differs from these.

@github-actions[bot] commented on GitHub (Feb 5, 2026): This issue might be a duplicate of existing issues. Please check: - #8968: [FEATURE]: Support OPENCODE_CACHE_DIR and OPENCODE_LOG_DIR for full isolation - Proposes environment variables (OPENCODE_DATA_DIR, OPENCODE_CACHE_DIR, OPENCODE_LOG_DIR, OPENCODE_STATE_DIR) for full portable mode with zero reliance on default XDG directories - #10349: Sessions not visible across platforms when syncing data directory - Related issue about syncing OpenCode data directory across platforms (Windows, macOS, Linux) with path normalization concerns - #4526: [FEATURE]: Full portable mode - Original feature request for portable mode with configurable data directories Feel free to ignore if your specific use case differs from these.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8655