You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opencode stores all session history, messages, file parts, and diffs in ~/.local/share/opencode/storage/ with no automatic cleanup and no CLI command to reclaim disk space.
After ~5 months of regular use on a single project, my storage has grown to:
Growth rate: ~500 MB/month. At this pace, it will reach 6+ GB within a year for a single project.
What I'd expect
1. CLI command: opencode session prune
# Dry run — show what would be deleted
opencode session prune --older-than 30d --dry-run
# Delete sessions older than 30 days and reclaim disk space
opencode session prune --older-than 30d
# Show current storage usage by category
opencode session stats
2. Config option for automatic cleanup
"session": {
"retention_days": 30, // auto-prune sessions older than N days"max_storage_mb": 2048// or cap by total size
}
3. What should be cleaned up
When a session is deleted, all associated data should be removed:
storage/session/{project_id}/ses_*.json
storage/message/ entries linked to that session
storage/part/ entries linked to those messages (the biggest contributor at ~1 GB)
Activity
github-actions commentedon Apr 12, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:prefix in the title (e.g.[FEATURE]: Session storage grows unboundedly...)Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
opencode session prune, auto-cleanup config,opencode session stats, and SQLite VACUUM in essentially the same scopeIf you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Apr 12, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.
Feel free to open a new issue that follows our issue templates.