Subagent sessions duplicate the full parent transcript and create 10+ GB JSONL files
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Codex Desktop on Windows is creating extremely large session files under:
%USERPROFILE%.codex\sessions
In the September session directory, 6 subagent JSONL files consume about 62.8 GB. Each file is approximately 10.4–10.7 GB and references the same parent session.
Investigation shows:
- 1 MB samples taken at 1 GB, 5 GB, and 10 GB offsets are byte-identical across all six files.
- In one representative 10.4 GB file, 273 "compacted" records occupy 10.18 GB (97.8% of the file).
- Most of the duplicated data appears to be image-related parent context.
- Individual compacted JSONL records can reach approximately 92.6 MB.
- The same issue previously produced multiple 8 GB subagent session files.
Expected behavior:
Subagent sessions should reference or deduplicate the parent transcript and store only their own incremental history.
Actual behavior:
Every spawned subagent stores a near-complete copy of the large parent transcript, causing tens of gigabytes of disk usage within a few hours.
Environment:
- Windows
- Codex Desktop
- Bundled Codex CLI: 0.153.0-alpha.5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how spawned subagent sessions persist their JSONL history and inherit the parent transcript; the issue names no files or tests, so locating those entry points is part of the investigation. Done means subagent files retain only incremental history or safely reference shared parent data, without duplicating large compacted records or producing multi-gigabyte files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100