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
create a new session and just give it this prompt "My archived OpenCode chat session (your session name) are missing from the sidebar. They are stored in the SQLite database at ~/.local/share/opencode/opencode.db in the session table. The column time_archived is set to a timestamp when a session is archived. To restore them, set time_archived = NULL. Please run a query to show me all archived sessions, ask me which one to restore, and then run the UPDATE query to fix it." Restart after the execution! The session will be recovered!
Reacted by Ilya Shaplyko, Saw Lay, Ryan Beall, Tung Dao, Digga-coder, SinnySupernova, Wallbreazzz, Mateusz Wu, Jay Jay, Rahul Kumar Agrawal and 26 more
Reacted by Maxim Erokhin and printf-KobeBryant
Reacted by Ilya Shaplyko, Saw Lay, TMays, Paolo Lammens, R011, Mateusz Wu, Jay Jay, Martin Staiger, Bohdan Mart, yoshiiafk and 17 more
on linux you can install sqlite3 cli and run sqlite3 ~/.local/share/opencode/opencode.db "SELECT id,title,slug,time_archived FROM session ORDER BY time_archived DESC LIMIT 1;" to get last archived session details- increase limit to get more sessions
then run sqlite3 ~/.local/share/opencode/opencode.db "UPDATE session SET time_archived = NULL WHERE slug = 'PASTE_SLUG_HERE';" for the session you want to unarchive
Just accidentally pressed "CTRL+Alt+Backspace" and my super massive conversation just got deleted. It says "Archive", but there's seemingly no way to view archived conversations and/or bring them back - which is quite misleading. And there really should be a confirmation modal for such an irreversible action.
Reacted by Matt, zenrazent, Sergey Volkov, Lakany and inochebuena
create a new session and just give it this prompt "My archived OpenCode chat session (your session name) are missing from the sidebar. They are stored in the SQLite database at ~/.local/share/opencode/opencode.db in the session table. The column time_archived is set to a timestamp when a session is archived. To restore them, set time_archived = NULL. Please run a query to show me all archived sessions, ask me which one to restore, and then run the UPDATE query to fix it." Restart after the execution! The session will be recovered!
WHY the fuck is this topic opened since FEB.6????
How the fuck can a programm behave like this for over 5 months?
Omfg.... can some one explain to me, how to edit the C:\Users\FreeRide23.local\share\opencode\opencode.db to reset the sessions???
I read 20 different approaches, no one works.... cause there are terms like "TUI" what NO ONE EXPLAINS.....
How the fuck should a normal person understand ANY SHIT that is written here????
I dont have any fucking idea how to fucking open a database, or what to klick where to edit WHAT....
So can anyone fucking explain this shit to me? IN SIMPLE FUCKING TERMS????
This:
"create a new session and just give it this prompt "My archived OpenCode chat session (your session name) are missing from the sidebar. They are stored in the SQLite database at ~/.local/share/opencode/opencode.db in the session table. The column time_archived is set to a timestamp when a session is archived. To restore them, set time_archived = NULL. Please run a query to show me all archived sessions, ask me which one to restore, and then run the UPDATE query to fix it." Restart after the execution! The session will be recovered!"
Did not work, because I DO NOT FUCKING KNOW THE NAME OF THE SESSION......
Also it does not work because it says i need to close the OpenCode software...
So you realy mean, i should install:
Python
Opencode TUI
and then follow 20 steps of shit, just to install a FEATURE that should have been there 5 month ago????
So your fix for a problem, is a installation process of its own????
WHY THE FUCK can no one in this dev community ADD the CODE that is written ALLREADY here: #24153 ????
WHO THE FUCK IS IN CHARGE OF THIS???? What ASS we need TO KICK to MAKE THIS FUCKING HAPPEN????????
I realy love the open source community, but you fucking guys are missing the abilit to MAKE DECISIONS and MAKE IT HAPPEN!!!! FOR FUCK SAKE WHO IS IN CHARGE OF THIS SHIT?????
Reacted by Jacques Bodin-Hullin
Reacted by Nuno Vieira, MefistoCoder, europlugged, klopppo, Alex, zDll233, Alexey Egorov, Vadim, GentlemanOfCulture and GrumpyEqualTrue
open C:\Users\<YOURUSER>\.local\share\opencode\opencode.db (yes, I know it's unnatural, should be under C:\Users\<YOURUSER>\AppData\Roaming\opencode, sic)
find the session e.g.
SELECT id, title, slug, time_archived
FROM session
ORDER BY time_archived DESCLIMIT1;
to get last archived session details (copy-paste then press Execute)
4. save the value of the slug cell (right-click, Copy cell)
5. un-archive executing another command
UPDATE session
SET time_archived =NULLWHERE slug ='PASTE_COPIED_SLUG_HERE';
close and reopen Opencode Desktop
at least it worked for me
thanks @SinnySupernova for the tip
Reacted by 4you4me4us, AhmadReza Saghari, backar2, CarlosURB and Yury Kapoyko
SELECT id, title, slug, time_archived
FROM session
ORDER BY time_archived DESC
LIMIT 1;
to get last archived session details (copy-paste then press Execute) 4. save the value of the slug cell (right-click, Copy cell) 5. un-archive executing another command
UPDATE session
SET time_archived = NULL
WHERE slug = 'PASTE_COPIED_SLUG_HERE';
6. close and reopen Opencode Desktop
DUDE! THX! That works!
Finaly a good explanation!
Ok, what i was missing (a friend helped me then) was the following information:
You say "find the session e.g." and then post the SQL execution parameters....
I told you, i dont know shit about databases....
So what i was missing, was the information, Open the *.db with the SQL Lite viewer, then you see the Database, on the tab "database structure, Browse Data, Edit Pragmas, execute SQL" press the execute SQL tab.
Then paste the code:
SELECT id, title, slug, time_archived
FROM session
ORDER BY time_archived DESC
LIMIT 1;
Then press > run
Now you find your the slug you need, the slug is showed below the execution window, copy the slug name and paste it into the other command:
found slug:
jolly-forest
UPDATE session
SET time_archived = NULL
WHERE slug = 'PASTE_COPIED_SLUG_HERE';
=
UPDATE session
SET time_archived = NULL
WHERE slug = 'jolly-forest';
Repeat it as often as you need (i needed to do it two times).
Fuck that shit, make that user interface work.... please, for fuck sake....
I dont know if this programm is run by a dev community or a vibe coding community i realy dont care....
All i see are endless treads, with different approaches, and it needs me to get fucking angry, to get a answer that helps....
I see https://github.com/OllyJohnston/OpenCode-Archive-Session-Manager this and just get angry, because a simple explanation (that is now given) would solve all the problems.... and all the problems would not even exist, if the suggestion of the implementation of this bugfix would WORK in TIME.....
So who ever is in charge of this shit here, get your shit together, for fuck sake.....
This: "create a new session and just give it this prompt "My archived OpenCode chat session (your session name) are missing from the sidebar. They are stored in the SQLite database at ~/.local/share/opencode/opencode.db in the session table. The column time_archived is set to a timestamp when a session is archived. To restore them, set time_archived = NULL. Please run a query to show me all archived sessions, ask me which one to restore, and then run the UPDATE query to fix it." Restart after the execution! The session will be recovered!"
Did not work, because I DO NOT FUCKING KNOW THE NAME OF THE SESSION...... Also it does not work because it says i need to close the OpenCode software...
Then just use a generic prompt "My archived OpenCode chat sessions are missing from the sidebar. They are stored ..."
It will give you all of them, and you will be able to choose which ones to restore (you can select one, a few or all).
@galenfontaise Similar prompt worked for me as well! This is the exact request I used in a new session:
The OpenCode chat session we were just working on — I hadn't submitted my lengthy reply yet! — is missing from the sidebar; it was accidentally archived. Archived sessions are stored in the SQLite database at ~/.local/share/opencode/opencode.db in the session table. The column time_archived is set to a timestamp when a session is archived. To restore them, set time_archived = NULL. Please run a query to show me all archived sessions, ask me which one to restore, and then run the UPDATE query to fix it.
...I had to restart OpenCode Desktop before the restored session reappeared, and the un-submitted text didn't initially show up. I asked in the restoration session to restore text as well, and it claimed it wasn't possible. But when I went back to the restored session, there was all the un-submitted text I'd been working on. Immediately copied it to a text editor with deletion protection, finished drafting, and submitted. All seems to be working as expected.
System: MacOS 26.5.1
Model: Claude Opus 4.7 High (via OpenCode Zen)
Total cost of the restoration session was $0.21. Really hope the developers can add an archive view in the GUI so we don't have to go through vibe coding our way back from an accidental deletion! I definitely removed the archive keyboard shortcut — it's far too close to existing text editing shortcuts in MacOS, and without restoration options built-in to the app, at the very least I don't think the shortcut should be enabled by default!
And no, OpenCode is not trash software by trash devs; I very much appreciate all the work that goes into open source development, and I'm very glad for options like OpenCode! Even if occasionally it gives me a fright. 😬
How to Restore Archived Chats in OpenCode
If you accidentally archived a chat and can't find it anywhere — don't worry, your data is not deleted. OpenCode stores all sessions in a SQLite database, and archiving simply sets a timestamp in the time_archived column. The chat data is still there, just hidden from the UI.
The Problem
OpenCode currently has no built-in way to list or restore archived sessions. So when you hit that archive button by mistake, there's no obvious way to get it back. Now enter the following prompt on any chat page:
The Fix
Here's a prompt you can paste directly into OpenCode to restore all your archived chats:
My opencode chats disappeared after I accidentally archived them. Please restore them from the SQLite database.
1. Connect to the database at ~/.local/share/opencode/opencode.db using Python's sqlite3 module
2. List all archived sessions by running: SELECT id, title, datetime(time_created/1000, 'unixepoch', 'localtime') as created, datetime(time_archived/1000, 'unixepoch', 'localtime') as archived FROM session WHERE time_archived IS NOT NULL ORDER BY time_archived DESC;
3. Show me the list of archived sessions with their titles and dates
4. Restore all of them by setting time_archived = NULL
5. Verify the restoration was successful
Important: Do not delete anything. Only unarchive by setting time_archived to NULL.
This worked for me: My archived OpenCode chat sessions are missing from the sidebar. They are stored in the SQLite database at ~/.local/share/opencode/opencode.db in the session table. The column time_archived is set to a timestamp when a session is archived. To restore them, set time_archived = NULL. Please run a query to show me all archived sessions, ask me which one to restore, and then run the UPDATE query to fix it
When he asked me which session I wanted to restore, I said "restore all of them" and voilà!
Also, don't forget to remove the shortcut in Settings > Shortcuts > Archive session, just click on the keys binding and press delete.
The SQLite "solution" did not work for me. Even after updating the entire table and setting the "time_archived" to NULL for all rows, I still can't see them in OpenCode. This is idiotic.
Activity
github-actions commentedon Feb 6, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
github-actions commentedon Apr 7, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
NashYang96 commentedon Apr 29, 2026
create a new session and just give it this prompt "My archived OpenCode chat session (your session name) are missing from the sidebar. They are stored in the SQLite database at ~/.local/share/opencode/opencode.db in the session table. The column time_archived is set to a timestamp when a session is archived. To restore them, set time_archived = NULL. Please run a query to show me all archived sessions, ask me which one to restore, and then run the UPDATE query to fix it." Restart after the execution! The session will be recovered!
devbijay commentedon Apr 30, 2026
opencode export > session-export.json
jq 'del(.info.time.archived)' session-export.json > session-unarchived.json
opencode session delete
opencode import session-unarchived.json
opencode --session
SawLay043 commentedon Apr 30, 2026
Well, it was a weird way to find out this issue after I accidently miss pressed the caps lock and stuff, and my sessions went disappeared, lol.
g19375592715-del commentedon May 1, 2026
test
SinnySupernova commentedon May 12, 2026
on linux you can install
sqlite3cli and runsqlite3 ~/.local/share/opencode/opencode.db "SELECT id,title,slug,time_archived FROM session ORDER BY time_archived DESC LIMIT 1;"to get last archived session details- increase limit to get more sessionsthen run
sqlite3 ~/.local/share/opencode/opencode.db "UPDATE session SET time_archived = NULL WHERE slug = 'PASTE_SLUG_HERE';"for the session you want to unarchiveTimChinye commentedon May 18, 2026
Just accidentally pressed "CTRL+Alt+Backspace" and my super massive conversation just got deleted. It says "Archive", but there's seemingly no way to view archived conversations and/or bring them back - which is quite misleading. And there really should be a confirmation modal for such an irreversible action.
zkxil commentedon May 22, 2026
Thanks Yang, Really helps me a lot.
FreeRide23 commentedon May 23, 2026
WHY the fuck is this topic opened since FEB.6????
How the fuck can a programm behave like this for over 5 months?
Omfg.... can some one explain to me, how to edit the C:\Users\FreeRide23.local\share\opencode\opencode.db to reset the sessions???
I read 20 different approaches, no one works.... cause there are terms like "TUI" what NO ONE EXPLAINS.....
How the fuck should a normal person understand ANY SHIT that is written here????
I dont have any fucking idea how to fucking open a database, or what to klick where to edit WHAT....
So can anyone fucking explain this shit to me? IN SIMPLE FUCKING TERMS????
This:
"create a new session and just give it this prompt "My archived OpenCode chat session (your session name) are missing from the sidebar. They are stored in the SQLite database at ~/.local/share/opencode/opencode.db in the session table. The column time_archived is set to a timestamp when a session is archived. To restore them, set time_archived = NULL. Please run a query to show me all archived sessions, ask me which one to restore, and then run the UPDATE query to fix it." Restart after the execution! The session will be recovered!"
Did not work, because I DO NOT FUCKING KNOW THE NAME OF THE SESSION......
Also it does not work because it says i need to close the OpenCode software...
I found this one:
https://github.com/OllyJohnston/OpenCode-Archive-Session-Manager
So you realy mean, i should install:
Python
Opencode TUI
and then follow 20 steps of shit, just to install a FEATURE that should have been there 5 month ago????
So your fix for a problem, is a installation process of its own????
WHY THE FUCK can no one in this dev community ADD the CODE that is written ALLREADY here: #24153 ????
WHO THE FUCK IS IN CHARGE OF THIS???? What ASS we need TO KICK to MAKE THIS FUCKING HAPPEN????????
I realy love the open source community, but you fucking guys are missing the abilit to MAKE DECISIONS and MAKE IT HAPPEN!!!! FOR FUCK SAKE WHO IS IN CHARGE OF THIS SHIT?????
giuliov commentedon May 24, 2026
@FreeRide23 on Windows I suggest this:
C:\Users\<YOURUSER>\.local\share\opencode\opencode.db(yes, I know it's unnatural, should be underC:\Users\<YOURUSER>\AppData\Roaming\opencode, sic)to get last archived session details (copy-paste then press Execute)
4. save the value of the slug cell (right-click, Copy cell)
5. un-archive executing another command
at least it worked for me
thanks @SinnySupernova for the tip
FreeRide23 commentedon May 24, 2026
DUDE! THX! That works!
Finaly a good explanation!
Ok, what i was missing (a friend helped me then) was the following information:
You say "find the session e.g." and then post the SQL execution parameters....
I told you, i dont know shit about databases....
So what i was missing, was the information, Open the *.db with the SQL Lite viewer, then you see the Database, on the tab "database structure, Browse Data, Edit Pragmas, execute SQL" press the execute SQL tab.
Then paste the code:
SELECT id, title, slug, time_archived
FROM session
ORDER BY time_archived DESC
LIMIT 1;
Then press > run
Now you find your the slug you need, the slug is showed below the execution window, copy the slug name and paste it into the other command:
found slug:
jolly-forest
UPDATE session
SET time_archived = NULL
WHERE slug = 'PASTE_COPIED_SLUG_HERE';
=
UPDATE session
SET time_archived = NULL
WHERE slug = 'jolly-forest';
Repeat it as often as you need (i needed to do it two times).
This works!
THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Fuck that shit, make that user interface work.... please, for fuck sake....
I dont know if this programm is run by a dev community or a vibe coding community i realy dont care....
All i see are endless treads, with different approaches, and it needs me to get fucking angry, to get a answer that helps....
I see https://github.com/OllyJohnston/OpenCode-Archive-Session-Manager this and just get angry, because a simple explanation (that is now given) would solve all the problems.... and all the problems would not even exist, if the suggestion of the implementation of this bugfix would WORK in TIME.....
So who ever is in charge of this shit here, get your shit together, for fuck sake.....
GitBruced commentedon Jun 7, 2026
This worked! In TUI not the desktop version. FYI.
it is unbelievable that such a shitty issue just needed an entire repo for providing a solid solution.
galenfontaise commentedon Jun 22, 2026
Then just use a generic prompt "My archived OpenCode chat sessions are missing from the sidebar. They are stored ..."
It will give you all of them, and you will be able to choose which ones to restore (you can select one, a few or all).
It worked for me!
planetzalex commentedon Jul 9, 2026
trash app by trash devs. you can tell when people don't dogfood.
jeinselen commentedon Jul 10, 2026
@galenfontaise Similar prompt worked for me as well! This is the exact request I used in a new session:
...I had to restart OpenCode Desktop before the restored session reappeared, and the un-submitted text didn't initially show up. I asked in the restoration session to restore text as well, and it claimed it wasn't possible. But when I went back to the restored session, there was all the un-submitted text I'd been working on. Immediately copied it to a text editor with deletion protection, finished drafting, and submitted. All seems to be working as expected.
System: MacOS 26.5.1
Model: Claude Opus 4.7 High (via OpenCode Zen)
Total cost of the restoration session was $0.21. Really hope the developers can add an archive view in the GUI so we don't have to go through vibe coding our way back from an accidental deletion! I definitely removed the archive keyboard shortcut — it's far too close to existing text editing shortcuts in MacOS, and without restoration options built-in to the app, at the very least I don't think the shortcut should be enabled by default!
And no, OpenCode is not trash software by trash devs; I very much appreciate all the work that goes into open source development, and I'm very glad for options like OpenCode! Even if occasionally it gives me a fright. 😬
1paramveer commentedon Jul 21, 2026
cant believe we have to pay for our own shit, this issue is still prevalent
21hook commentedon Aug 8, 2026
Fork a new session from the archive one using OpenCode CLI directly
ni3dre commentedon Aug 19, 2026
How to Restore Archived Chats in OpenCode
If you accidentally archived a chat and can't find it anywhere — don't worry, your data is not deleted. OpenCode stores all sessions in a SQLite database, and archiving simply sets a timestamp in the time_archived column. The chat data is still there, just hidden from the UI.
The Problem
OpenCode currently has no built-in way to list or restore archived sessions. So when you hit that archive button by mistake, there's no obvious way to get it back. Now enter the following prompt on any chat page:
That's all. Now restart OpenCode.
fabiovaldez commentedon Sep 3, 2026
This worked for me:
My archived OpenCode chat sessions are missing from the sidebar. They are stored in the SQLite database at ~/.local/share/opencode/opencode.db in the session table. The column time_archived is set to a timestamp when a session is archived. To restore them, set time_archived = NULL. Please run a query to show me all archived sessions, ask me which one to restore, and then run the UPDATE query to fix itWhen he asked me which session I wanted to restore, I said "restore all of them" and voilà!
Also, don't forget to remove the shortcut in Settings > Shortcuts > Archive session, just click on the keys binding and press delete.
GrumpyEqualTrue commentedon Sep 18, 2026
The SQLite "solution" did not work for me. Even after updating the entire table and setting the "time_archived" to NULL for all rows, I still can't see them in OpenCode. This is idiotic.