Feature request: Built-in session storage dashboard, backups, and safe bulk cleanup
What variant of Codex are you using?
CLI and App
What feature would you like to see?
Codex needs a supported session-storage control surface, not only single-session deletion.
On 2026-08-16, a privacy-safe scan of my Linux machine found:
- 938 local Codex sessions using 42,254,816,761 bytes (~39.4 GiB)
- 732 subagent sessions using 24,349,191,222 bytes (~22.7 GiB)
- one session file close to 9.5 GB
I would like Codex to provide both a built-in UI and a stable machine-readable CLI/API for:
- reporting total session storage and grouping it by project, source type, age, and size
- distinguishing main sessions, subagents, active writers, pinned sessions, and orphaned records
- exporting selected sessions before cleanup
- copying sessions while preserving the paths required for restoration
- safely deleting selected or filtered sessions in batches
- configuring global and per-session quotas or retention policies
- warning before session storage exhausts the disk
Suggested commands could include:
codex sessions list --json
codex sessions storage --json
codex sessions export <id...> --output <path>
codex sessions delete --ids-file <path> --force
codex sessions prune --older-than <duration> --source subagent --dry-run
The destructive path should re-check active writers and locks immediately before deletion, explain which resume data and associated artifacts will be removed, and fail closed if safety cannot be established.
I built a localhost-only prototype to test this workflow. It scans multiple CODEX_HOME roots, shows storage by project and source type, exports ZIP backups with a manifest, preserves provider-relative paths for migration, protects active/writer-locked/pinned/recent/unindexed sessions, and delegates Codex deletion to codex delete --force instead of unlinking JSONL files directly.
The prototype demonstrates the UX, but it still has to read internal SQLite and JSONL layouts. A supported listing/export/batch-delete interface would let external tools avoid depending on unstable internal storage details.
Additional information
Related issues:
- #34061 documents extreme disk growth from subagent session logs.
- #28187 tracks deletion, retention, and cleanup UX.
- #8784 requested
codex delete <session>, which now addresses individual deletion but not discovery, backup, storage accounting, or safe bulk cleanup.
This request is specifically for a supported end-to-end session lifecycle interface shared by the CLI and App, including storage accounting, export/backup, and batch operations. It is broader than adding another delete button.
I have intentionally omitted transcript contents, project paths, usernames, and session IDs.
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action