Documentation on sessions
Question
Is there documentation on how sessions are created / where they are stored?
Im asking mainly because I may use opencode in a directory that has git initialized but do something there thats not related to the project. However, if I want to reuse that session to follow up on something / see what was said, I have to go back to that directory. It would be nice to have a way to globally manage sessions rather than hopping around directories.
This issue might be a duplicate of existing issues. Please check:
- #4048: [FEATURE]: tie working directory / directories with chat session - Requests the ability to tie working directories with sessions to avoid re-navigating
- #3551: Sessions are now mixed with home directory session list - Related to sessions being isolated by directory
- #1143: Create session with a different root/working directory - Requests the ability to create sessions with different working directories
- #4980: Does OpenCode automatically clean up old session/conversation data? - Related to understanding session data storage
These issues discuss related concerns about session management, directory context, and session storage/persistence. Issue #4048 in particular seems closely related to your use case of globally managing sessions without hopping directories.
Feel free to ignore if none of these address your specific case.
This may be helpful? https://opencode.ai/docs/troubleshooting/#storage
If you have git initialized we only show sessions for that "project"