Repository navigation
Description
Description
[BUG] tmp_pack Files Consuming 180GB on Ubuntu 24.04 LTS
Description
OpenCode is creating massive temporary pack files in ~/.local/share/opencode/snapshot/*/objects/pack/ that are never cleaned up, consuming 180.9 GB of disk space. These tmp_pack_* files appear to accumulate over time without any automatic cleanup mechanism.
Environment
- OpenCode version: 1.1.21
- Operating System: Ubuntu 24.04 LTS
- Desktop Environment: Gnome
- Hardware: Thinkpad X390 Yoga 2 (2019)
- Installation method: Official installer (installed to
~/.opencode/bin/) - Usage context: Via VSCode integrated terminal
Affected Location
~/.local/share/opencode/snapshot/ed610c2ec990659cd5a93f0917806ddcc867e270/objects/pack/
Files Found
Multiple tmp_pack_* files:
tmp_pack_L1OcCi- 34.3 GBtmp_pack_g8Pw3x- 34.3 GBtmp_pack_eBJrkn- 34.3 GBtmp_pack_qruqJT- 34.3 GBtmp_pack_uhAqV2- 34.3 GBtmp_pack_qdZhkE- 6.2 GBtmp_pack_Eup0BZ- 1.4 GBtmp_pack_j9Ykzw- 1.4 GBtmp_pack_yB0FXj- 332.2 MB
Total: ~180.9 GB
Steps to Reproduce
[Unclear - appears to happen during normal OpenCode usage over time]
- Use OpenCode normally over extended period
- Files accumulate in snapshot directory
- No automatic cleanup occurs
Expected Behavior
Temporary pack files should be automatically cleaned up after use or session end.
Actual Behavior
tmp_pack_* files accumulate indefinitely, consuming massive amounts of disk space (180GB+) without any cleanup mechanism.
Workaround
Manual deletion of temp files:
rm -f ~/.local/share/opencode/snapshot/*/objects/pack/tmp_pack_*Related Issues
This appears to be related to:
- [BUG] Ubuntu 22.04 Temp_Pack Files Using All of the Storage #5617 (Ubuntu 22.04 - 79GB in 10 minutes)
- HUGE snapshot folder #6845 (NixOS - 169GB snapshot folder)
Additional Context
- Files were write-protected, requiring
-fflag to remove - This confirms the bug also affects Ubuntu 24.04 LTS (in addition to Ubuntu 22.04)
- Pattern suggests this is a persistent Ubuntu/Linux issue with OpenCode's temp file management
Impact
- Critical disk space consumption
- Can fill entire filesystem
- Affects system stability
- No warning or notification to user
Note: This bug report consolidates the issue affecting multiple Ubuntu versions. The pattern is consistent across Ubuntu 22.04 and 24.04 LTS, as well as NixOS.
Plugins
OpenCode version
1.1.21
Steps to reproduce
No response
Screenshot and/or share link
Operating System
Ubuntu 24.04.3 LTS
Terminal
VSCode Terminal
Activity
github-actions commentedon Jan 15, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if this specific case addresses your unique scenario. However, these issues appear to share the same root cause: OpenCode's snapshot feature and temporary pack file management lack proper cleanup mechanisms on Linux/Unix systems.
tianqiii commentedon Jan 16, 2026
It consumes 15+GB on my Ubuntu 25.10. kind of weird. Is there some way to cleanup these files?
tianqiii commentedon Jan 16, 2026
it creates tons of files simultaneously. (202 files)

vincent-pellerin commentedon Jan 22, 2026
✅ Root Cause Identified - Complete Analysis Available
I've completed a deep technical analysis of this bug and found the exact code causing the leak.
Quick Summary
Root Cause:
Snapshot.track()runsgit add .without timeout on every AI interaction (3-5+ times).nothrow()silently ignores failures → no cleanup triggeredgit gcwhich doesn't remove tmp_pack filesMy System:
Immediate Workaround
Complete Analysis
I've created a detailed issue with:
See: #10034 - [ROOT CAUSE ANALYSIS] tmp_pack Leak - Complete Code Analysis & Fix Recommendations
Recommended Fixes (for maintainers)
Priority 1 (CRITICAL):
Priority 2 (HIGH):
3. Add error handling with exit code checking
4. Call cleanup on failed git operations
Priority 3 (MEDIUM):
5. Reduce snapshot frequency with throttling
All details, code snippets, and evidence in #10034.
Confirmed affected: Ubuntu 22.04, 24.04, 25.10, NixOS
Related issues: #5617, #6845, #6523, #8577 - all same root cause
thdxr commentedon Mar 25, 2026
This should be partially addressed by commit 0a80ef4 which adds a 2MB file size limit for snapshotting. Large files are now excluded from git snapshots, which should reduce the tmp_pack accumulation.