Codex App session JSONL files grow to 24 GB due to repeated inline image data during context compaction
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by inspecting the representative rollout-*.jsonl files under .codex\sessions\YYYY\MM\DD, focusing on compacted.payload.replacement_history and repeated image_url data. Trace the context-compaction serialization path and verify that completed work stops embedding the same inline images in each snapshot and descendant session.
Written by the indexing model from the issue text.
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.715.2305.0 (bundled Codex CLI: 0.145.0-alpha.18)
What subscription do you have?
ChatGPT Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
The Codex App's local session storage has grown unexpectedly to 27.761 GiB on my C: drive.
Storage breakdown:
C:\Users\<username>\.codex: 27.761 GiBsessions: 25.312 GiBsessions\2026\07: 24.365 GiB across 360 JSONL files- July 13–17 alone: 23.521 GiB across 310 files
A representative 268.4 MiB rollout file contains 234.6 MiB of image_url data (87.4% of the file) and 208 image references.
The largest 359.3 MiB rollout file contains 77 compacted records totaling approximately 239.992 MiB. Inspection of replacement_history shows that previously attached inline images are serialized again in repeated context-compaction records.
Multi-agent or descendant sessions also appear to copy the image-containing history, further amplifying the disk usage.
There is no crash or visible error message. The symptom is rapid and unexpected growth of local session files.
What steps can reproduce the bug?
-
Start a task in Codex Desktop on Windows.
-
Attach several images to the task.
-
Continue using the same task long enough for multiple context compactions.
-
Optionally spawn subagents or descendant tasks from the image-containing conversation.
-
Inspect the files under:
C:\Users\<username>\.codex\sessions\YYYY\MM\DD\ -
Observe that individual
rollout-*.jsonlfiles grow to hundreds of MiB. -
Inspecting JSON field lengths shows that the same inline
image_urldata is stored repeatedly insidecompacted.payload.replacement_history.
In my case, July session files reached 24.365 GiB, while a representative 268.4 MiB session file contained 234.6 MiB of repeated image data.
What is the expected behavior?
Previously attached images should not be embedded again in every context-compaction snapshot.
Image attachments should ideally be stored once and referenced by file path, content hash, or attachment ID. Session storage should grow roughly in proportion to unique conversation content rather than multiplying with every compaction or descendant session.
Additional information
Representative affected session ID:
019f6df5-3051-7602-9310-5fcc14f80edb
Largest affected session ID:
019f49cf-e6c7-7aa0-b8eb-ead797461965
The analysis was performed using file sizes, record types, and JSON field lengths only. No session data was modified.
I have not attached the full JSONL files because they may contain private prompts, local file paths, tool output, and embedded images. I can provide a sanitized diagnostic summary if needed.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
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.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·