You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Add option to auto-save session record to disk. #1865
It would be very useful to have the option to automatically save a record of each session (prompts + the model's commentary) to disk, for future reference. Claude Code has this in its settings.
this would automatically create a file (timestamp in file name) in the path at the start of a session and continuously write to it with each prompt/response.
changed the title [-][FEATURE] Add option to auto-save session to disk.[/-][+][FEATURE] Add option to auto-save session record to disk.[/+]on Aug 12, 2025
we actually do write everything in ~/.local/share/opencode but it's not in the best format. we're reworking our storage structure a bunch and we'll probably add opencode query <some simple language> to query out session data
Reacted by Sean Mullen, krshock, Kolya Ay, Leonardo Mora, Martin Havlišta, Bruce Yang and Dietrich Daroch
Reacted by BN-JuzzyP, Finlay, Kolya Ay and Bruce Yang
i would like an option to save my sessions related to a codebase in that same folder. it'll be useful to recognize patterns around what i'm asking, and how is the agent responding. we can also use those sessions to improve the agents.md file
Reacted by Juan Miguel Contreras, Ben, Jeremy Akers, Jason R. Grant, Pablo Farias, Yifan Zhang and thefonso
Why was this closed? This would be a really useful feature. It could be used to help keep context small as well if we could keep conversation history on disk while compacting the in-memory context. Then if the agent needs to recall something it did earlier (Something that's now no longer in context) it could go search the on-disk history. Ideally if this could be stored in a vector database, indexed by timestamp to allow contextual search by time period, so you could do things like "Can you re-run that elaborate command you ran yesterday around this time that compiled these specific source files with that debugging flag we need"?
Reacted by Valérian, Jason R. Grant, Pablo Farias, uzantnomo, Xingzhe Li, Kaan Akşit, Zoee Silcock, 天然純真, Sam Leask, kvn1351 and 5 more
Activity
[-][FEATURE] Add option to auto-save session to disk.[/-][+][FEATURE] Add option to auto-save session record to disk.[/+]github-actions commentedon Aug 12, 2025
👋 This issue might be a duplicate of existing issues. Please check:
If none of these address your specific case for automatic session saving, please let us know how this issue differs.
thdxr commentedon Aug 12, 2025
we actually do write everything in
~/.local/share/opencodebut it's not in the best format. we're reworking our storage structure a bunch and we'll probably addopencode query <some simple language>to query out session datainsane-dreamer commentedon Aug 12, 2025
Nice! Would a plain markdown text file per session be an option? (I.e., the settings could allow the user to select the storage format).
thdxr commentedon Aug 12, 2025
the storage will be raw format but we can transform it into markdown - the current
/exportcommand might work for youLeonardoMor commentedon Aug 29, 2025
But are previous sessions recalled as of right now? Is it a fresh start every time I open opencode?
rekram1-node commentedon Aug 29, 2025
@LeonardoMor are you asking if memory is built in? Answer there is no as of now
LeonardoMor commentedon Aug 30, 2025
I see. So I'm right in not closing opencode for now lol
rekram1-node commentedon Dec 28, 2025
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
theonesud commentedon Jan 13, 2026
i would like an option to save my sessions related to a codebase in that same folder. it'll be useful to recognize patterns around what i'm asking, and how is the agent responding. we can also use those sessions to improve the agents.md file
jeremyakers commentedon Jan 29, 2026
Why was this closed? This would be a really useful feature. It could be used to help keep context small as well if we could keep conversation history on disk while compacting the in-memory context. Then if the agent needs to recall something it did earlier (Something that's now no longer in context) it could go search the on-disk history. Ideally if this could be stored in a vector database, indexed by timestamp to allow contextual search by time period, so you could do things like "Can you re-run that elaborate command you ran yesterday around this time that compiled these specific source files with that debugging flag we need"?
soundstep commentedon Apr 7, 2026
@rekram1-node I was looking for that too, can we re-open please?
Some kind of
Or config based.
thefonso commentedon Jun 14, 2026
Re-open pretty please?