Skip to content

OpenCode nuked my storage (318 GB added) #9290

Closed

Description

@pythonlearner1025

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

Activity

  1. added
    perfIndicates a performance issue or need for optimization
    on Jan 18, 2026
  2. github-actions commented on Jan 18, 2026

    @github-actions
    Contributor

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

    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.

  3. changed the title [-]OpenCode nuked my storage (284 GB added)[/-] [+]OpenCode nuked my storage (318 GB added)[/+] on Jan 18, 2026
  4. miguelnavarro89 commented on Jan 19, 2026

    @miguelnavarro89

    same for me, see

    Image

    Thank you for looking into this.

  5. rekram1-node commented on Jan 19, 2026

    @rekram1-node
    Contributor

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

  6. rekram1-node commented on Jan 19, 2026

    @rekram1-node
    Contributor

    e2f1f4d

    will auto cleanup snapshot things older than 7 days

  7. miguelnavarro89 commented on Jan 20, 2026

    @miguelnavarro89

    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.

  8. HustCoderHu commented on Feb 12, 2026

    @HustCoderHu

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

  9. ThePhilosopha commented on Feb 22, 2026

    @ThePhilosopha

    Same. Mine ballooned to 40gb. I deleted it. Ran opencode cli again and it readded it.

  10. wastee commented on Mar 5, 2026

    @wastee

    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.

    You may can set "snapshot": false as a workaround.

  11. joeyism commented on Mar 6, 2026

    @joeyism

    I had to manually rm -rf ~/.local/share/opencode/storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingperfIndicates a performance issue or need for optimization

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions