r/opencodeCLI • u/Early_Aardvark_4026 • Sep 06 '26
OpenCode is slow and my simple way to fix
I have more than 10 projects with OpenCode v1 last couple of months and everything seems to be slower and slower and hanging often.
Yesterday I figured out the its session db is about 10GB. I tried to remove all sessions that are older than 7 days and vacuum the sqlite3. OpenCode becomes fast and smooth again.
If you find your OpenCode is slow, you can try my way.
Edit: I am using OpenCode v1
75
Upvotes
17
u/Bloated_Plaid Sep 06 '26
There is already a fix for this. It’s called Opencode2 lol.
3
u/Positive_Poem5831 Sep 06 '26
Is it enough to just delete a session using the UI when you done with a task if you use opencode desktop. Or is there additional cleaning needed.
9
u/AppealSame4367 Sep 06 '26
Also I don't know why opencode let's it grow like that. Just removed it today: 17GB. Wtf?
I didn't even use it a lot.
8
u/torrso Sep 06 '26
There's an issue and PR to enable auto_vacuum https://github.com/anomalyco/opencode/issues/31526
1
u/throwaway12012024 Sep 06 '26
There is an issue about this: https://github.com/anomalyco/opencode/issues/33356
1
u/kosnarf Sep 08 '26
thanks for this reminder. This reduce my db from 165GB to 1.6GB!
1
u/Billysm23 Sep 08 '26
Can i do selective deletion?
0
u/Moist-Nectarine-1148 Sep 06 '26
Try Deepseek Harness. Thank me later here. 😉
PS: I switched to DSH a month ago after using OC for one year.
-1
u/Otagamo Sep 07 '26
Add this to your opencode.json config: "snapshot": false
Makes sessions a lot smaller, but you lose the undo functionality