OpenCode nuked my storage (318 GB added) #6724

Closed
opened 2026-02-16 18:05:03 -05:00 by yindo · 6 comments
Owner

Originally created by @pythonlearner1025 on GitHub (Jan 18, 2026).

Originally assigned to: @thdxr on GitHub.

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
Originally created by @pythonlearner1025 on GitHub (Jan 18, 2026). Originally assigned to: @thdxr on GitHub. ### 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 | ```bash $ 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
yindo added the bugperf labels 2026-02-16 18:05:03 -05:00
yindo closed this issue 2026-02-16 18:05:03 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 18, 2026):

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] commented on GitHub (Jan 18, 2026): 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.
Author
Owner

@miguelnavarro89 commented on GitHub (Jan 19, 2026):

same for me, see

Image

Thank you for looking into this.

@miguelnavarro89 commented on GitHub (Jan 19, 2026): same for me, see <img width="1199" height="294" alt="Image" src="https://github.com/user-attachments/assets/2efe8f4d-89c3-400b-abb9-d3142116a95c" /> Thank you for looking into this.
Author
Owner

@rekram1-node commented on GitHub (Jan 19, 2026):

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

@rekram1-node commented on GitHub (Jan 19, 2026): Next release I added a cleanup function for this sorry about that yall
Author
Owner

@rekram1-node commented on GitHub (Jan 19, 2026):

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

will auto cleanup snapshot things older than 7 days

@rekram1-node commented on GitHub (Jan 19, 2026): https://github.com/anomalyco/opencode/commit/e2f1f4d81e152f19f6f9d2f8ed873f310296eba4 will auto cleanup snapshot things older than 7 days
Author
Owner

@miguelnavarro89 commented on GitHub (Jan 20, 2026):

hey folks, did you guys release the fix? I don't see this changes on 1.1.28. Now, you guys set 7 days for auto cleanup but opencode currently just need 24h and disk is blown up by this issue, a big deal.

Is there a way to disable snapshots altogether?

Opencode is basically almost useless that way.

@miguelnavarro89 commented on GitHub (Jan 20, 2026): hey folks, did you guys release the fix? I don't see this changes on 1.1.28. Now, you guys set 7 days for auto cleanup but opencode currently just need 24h and disk is blown up by this issue, a big deal. Is there a way to disable snapshots altogether? Opencode is basically almost useless that way.
Author
Owner

@HustCoderHu commented on GitHub (Feb 12, 2026):

same here, snapshot 30+GB, even though source repo is only 50MB

@HustCoderHu commented on GitHub (Feb 12, 2026): same here, snapshot 30+GB, even though source repo is only 50MB
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6724