openai / openai/codex

Feature request: Built-in session storage dashboard, backups, and safe bulk cleanup

Open
#38,838 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app CLI enhancement session
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing related issues #34061, #28187, and #8784, then inspect the existing codex delete --force entry point and session storage layouts. Compare the requested CLI commands with current behavior; done means a supported CLI/API and shared UI can account for, export, and safely batch-delete sessions while protecting active writers, locked, pinned, recent, and unindexed records.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sqlite
Domain
backend, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.