A pure-local, GUI, zero-backend visual tool to manage OpenAI Codex desktop conversations. Scan ~/.codex, list every thread from state_5.sqlite, search, inspect details, and delete with three tiers: archive only / database delete / full wipe (4 traces). Includes a "Terminate Codex" button to close all Codex processes before deleting.
- Auto-scan
~/.codex: readsstate_5.sqlitethreads table and.codex-global-state.json - Visual list: created time / title / thread ID / active or archived / accessible on this machine / rollout file size
- Batch selection: click the "Sel" column cell to toggle a row, click the column header to select/deselect all
- Live search filter by title or thread ID
- Detail panel: cwd, rollout path, outputs dir, workspace root hint
- Three delete modes:
Mode Action Restorable Archive only (soft) Mark archived=1, rollout untouchedYes Database delete Delete state_5 row + clear 5 global-state fields, rollout kept Yes (manually) Full wipe (4 traces) DB row + global state + rollout file + outputs dirs + run logs No - Terminate Codex: detect and kill all Codex processes in one click (required before deleting, otherwise Codex overwrites your changes on exit)
- Auto-backup DB and global state to
.bak-del-*files before destructive ops - 5-second countdown confirmation to prevent misclicks; extra warning if Codex is still running
- Reads/writes local files only. No network, no upload, no third-party services
- Cross-platform: Windows (wmic/taskkill) and Linux (pgrep/SIGTERM)
- Windows 10/11 or Linux (X11)
- Python 3.8+ with tkinter (default in official installers; on Debian/Ubuntu:
sudo apt install python3-tk)
python codex_thread_manager.pyAfter the GUI opens:
- The left panel auto-loads all threads
- Click a cell in the "Sel" column to tick rows you want to operate on
- Pick a delete mode on the right
- Click Delete → confirm dialog (5s countdown) → confirm
- Click Terminate Codex before deleting for safety
- Click Refresh to reload the list and see the result
Each conversation (thread) leaves 4 traces:
- Thread metadata in
state_5.sqlitethreadstable - Conversation log at
sessions/<year>/<month>/<day>/rollout-*.jsonl(moved toarchived_sessions/when archived) - Global state in
.codex-global-state.json, with 5 fields referencing the thread ID:projectless-thread-idsthread-workspace-root-hintsthread-projectless-output-directoriespinned-thread-idsthread-writable-roots
- Project directory pointed to by
threads.cwd; projectless threads also have anoutputs/dir
Codex's built-in archive only flips archived=1 and moves the rollout. "Full wipe" cleans all 4 traces.
- Terminate Codex before deleting: Codex writes back global state on exit and will overwrite your changes if it's running
- Full-wipe auto-backs-up
state_5.sqliteand.codex-global-state.jsonto.bak-del-*in the same dir (manually restorable) - Deleting a project dir inside an OneDrive sync folder propagates the deletion to other machines via OneDrive. Confirm before deleting
Three suites, none touch real data:
python tests/test_unit.py # 38 unit tests
python tests/test_gui.py # 24 GUI interaction tests (window hidden)
python tests/test_e2e.py # 15 end-to-end three-tier delete tests (temp mock CODEX_HOME)Current status: 77 PASS.
Prebuilt binaries are on the Releases page:
codex-thread-manager-windows.exe— standalone Windows executable, no Python neededcodex-thread-manager-linux— standalone Linux binary (built on a Debian-based system)
pip install pyinstaller
pyinstaller --onefile --windowed --name codex-thread-manager codex_thread_manager.py| File | Purpose |
|---|---|
codex_thread_manager.py |
Main program, single file, no external deps |
tests/test_unit.py |
Unit tests (module import, functions, read-only real .codex, mock full delete) |
tests/test_gui.py |
GUI interaction tests (selection, search, detail, mode switch) |
tests/test_e2e.py |
End-to-end three-tier delete logic (temp mock, never touches real data) |
LICENSE |
MIT |
- The sidebar's authoritative source is
state_5.sqlite;session_index.jsonlmay lag or be garbled, this tool trusts the DB - If you use cc-switch's "Unify Codex session history" toggle, thread count changes accordingly; this tool reads live so it stays correct
- Process detection uses
wmicon Windows (~160ms) andpgrepon Linux
MIT