{"repo":"whtsky/ocgc","free":true,"listed":false,"github":"https://github.com/whtsky/ocgc","clone":"git clone https://github.com/whtsky/ocgc.git","description":"OpenCode Garbage Collector. Analyze and reclaim storage used by OpenCode sessions, diffs, and snapshots","language":"Python","stars":33,"topics":["cleanup","cli","disk-space","garbage-collector","opencode","python","sqlite"],"license":"MIT","category":"databases-storage","readme_excerpt":"ocgc: OpenCode Garbage Collector Analyze and reclaim storage used by OpenCode sessions, diffs, and snapshots. OpenCode stores sessions in a SQLite file that grows without limit and has no built-in cleanup. It also writes session diffs and git snapshots to disk. ocgc shows where the space goes and reclaims it. Screenshots ocgc status ocgc analyze ocgc purge --clean-orphans --clean-snapshots --older-than 14d --dry-run Quick start Copy this to your AI agent: Install Or with pip: Usage Multiple purge flags combine with AND. --strip-reasoning changes the action from deleting sessions to removing reasoning parts (from matching sessions, or all sessions if no other filters are given). --clean-orphans and --clean-snapshots run independently before any session purge. --dry-run previews without touching anything. --force skips the confirmation prompt. Filesystem storage Beyond the SQLite database, OpenCode stores data on the filesystem: - Session diffs ( /.local/share/opencode/storage/session diff/ ): one JSON file per session containing full file contents. Cleaned automatically when sessions are purged. - Snapshots ( /.local/share/opencode/snapshot/ ): git object packs for each project. Use --clean-snapshots to delete. - Tool output ( /.local/share/opencode/tool-output/ ): small files from tool invocations. Shown in stats but no cleanup needed. ocgc status and ocgc analyze show sizes for all three directories. analyze also reports orphan session diff files (files with no matching sess","default_branch":null,"files":null,"tree":[],"storefront":"/r/whtsky","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/whtsky/ocgc/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}