Repository navigation
ocdbc v0.1.0 — initial release
What it does
Safely analyze and vacuum OpenCode's SQLite database to reclaim freelist bloat.
Commands
- ocdbc analyze — read-only health report (DB size, freelist, table stats, session ages, largest objects)
- ocdbc vacuum — safe VACUUM sequence: fuser check, WAL checkpoint, integrity, verified backup, auto_vacuum=INCREMENTAL, VACUUM with progress, re-enable WAL, verify
Safety
- Refuses to run if OpenCode has the DB open (fuser)
- Refuses to run if fuser is not installed (override with --skip-fuser)
- Creates a verified timestamped backup before every VACUUM
- Integrity check before and after — aborts on failure
- Atomic VACUUM (rename on success, old file untouched on failure)
Install
pip install git+https://github.com/chncaesar/opencode-db-clean.gitor
git clone https://github.com/chncaesar/opencode-db-clean.git
cd opencode-db-clean && pip install .