opencode icon indicating copy to clipboard operation
opencode copied to clipboard

OpenCode nuked my storage (318 GB added)

Open pythonlearner1025 opened this issue 2 days ago • 1 comments

Description

I asked claude to investigate and here's the report:

Summary

Opencode's snapshot system has consumed 318GB of disk space by:

  1. Tracking the entire home directory as a git worktree
  2. Leaving orphaned temp pack files with no garbage collection

Storage Breakdown

Type Size Files Description
Orphaned temp packs 284 GB 6 Failed/interrupted pack operations, never cleaned
Loose git objects 34 GB 590,600 Actual snapshot data
Total 318 GB For a CLI tool with no storage settings

Orphaned Files

File Size Date
tmp_pack_qM0CSW 108 GB Dec 31
tmp_pack_Latw37 61 GB Dec 31
tmp_pack_Tt4SKV 54 GB Dec 31
tmp_pack_nuK5V1 27 GB Dec 31
tmp_pack_vSc9OC 25 GB Jan 9
tmp_pack_hJO3AO 7.8 GB Jan 1
$ git count-objects -vH
size-garbage: 283.84 GiB

Issues

- No cleanup mechanism — no git gc, no pruning, no temp file cleanup
- No storage limits — grows unbounded
- No user visibility — no warnings, no settings, no documentation
- Tracks entire home directory — not just project folders

Workaround

rm -rf ~/.local/share/opencode/snapshot/

Expected

- Track project directories only, not $HOME
- Clean up temp files on startup
- Run periodic garbage collection
- Implement storage limits
- Warn users or expose settings

### Plugins

_No response_

### OpenCode version

_No response_

### Steps to reproduce

_No response_

### Screenshot and/or share link

<img width="994" height="667" alt="Image" src="https://github.com/user-attachments/assets/fc9d49c5-75f0-46be-8712-2024ad614504" />

### Operating System

macOS 26.01

### Terminal

iTerm2

pythonlearner1025 avatar Jan 18 '26 21:01 pythonlearner1025

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

  • #8749: [BUG] tmp_pack Files Consuming 180GB on Ubuntu 24.04 LTS - Same orphaned temp_pack files in ~/.local/share/opencode/snapshot
  • #5617: [BUG] Ubuntu 22.04 Temp_Pack Files Using All of the Storage - 79GB of tmp_pack files, related to #6845
  • #6845: HUGE snapshot folder - 169GB of orphaned temp pack files affecting Linux systems
  • #8577: Snapshot feature needs safeguards for large directories - Describes how snapshot runs git add on entire worktree without size checks
  • #8887: [BUG] Snapshot module ignores 'watcher.ignore' config - Shows snapshot tracks all files regardless of ignore settings
  • #3182: Very slow session due to 98GB of git snapshots - Same accumulation issue, user had to disable snapshots

All these issues describe the same root cause: orphaned temp_pack files and lack of garbage collection/storage limits in the snapshot system.

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

github-actions[bot] avatar Jan 18 '26 21:01 github-actions[bot]

same for me, see

Image

Thank you for looking into this.

miguelnavarro89 avatar Jan 19 '26 20:01 miguelnavarro89

Next release I added a cleanup function for this sorry about that yall

rekram1-node avatar Jan 19 '26 20:01 rekram1-node

https://github.com/anomalyco/opencode/commit/e2f1f4d81e152f19f6f9d2f8ed873f310296eba4

will auto cleanup snapshot things older than 7 days

rekram1-node avatar Jan 19 '26 20:01 rekram1-node