What version of Codex CLI is running?
0.118.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
codex-tui
Codex doctor report
What issue are you seeing?
Codex CLI/TUI is creating extremely large session JSONL files under ~/.codex/sessions.
One affected session file is 732 MB:
~/.codex/sessions/2026/03/31/rollout-2026-03-31T22-18-46-019d458c-752d-76c0-bbfa-a29eafa0cbf0.jsonl
A quick breakdown shows the size is dominated by repeated compaction history and raw tool outputs:
- 337.8 MB from
compacted records
- 230.8 MB from
function_call_output
- 54.8 MB from
reasoning
- 26.4 MB from
token_count events
- 18.0 MB from
turn_context
The file has 170,415 JSONL records. The largest single record is about 2.1 MB. My ~/.codex/sessions directory is now about 91 GB total, with 184 JSONL files over 100 MB
and the largest observed file around 1.95 GB.
This looks like unbounded session logging / repeated persistence of compaction history rather than expected transcript storage.
What steps can reproduce the bug?
- Use Codex CLI/TUI for a long coding session with multiple tool calls.
- Run broad search commands that can produce large outputs, for example
rg across large repos or /tmp.
- Continue the session long enough for context compaction to occur multiple times.
- Inspect
~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl.
- Check file size and record composition with commands like
du -h, wc -l, and jq.
Observed result:
The session JSONL grows to hundreds of MB or more. In one case, a single rollout file reached 732 MB with 170,415 records.
The biggest contributors were:
- repeated
compacted records containing large replacement_history payloads
- raw
function_call_output payloads
- reasoning and token count event records
What is the expected behavior?
Session logs should stay bounded and should not grow to hundreds of MB or multiple GB for a normal long coding session.
Expected behavior:
- Tool outputs should be truncated, summarized, deduplicated, or stored with a size cap.
- Context compaction should not repeatedly persist large prior history snapshots in
replacement_history.
- Old session logs should be compressed or covered by a retention policy.
- A long tool-heavy session might produce a larger log, but it should remain within a reasonable size, not 700MB-2GB per JSONL file.
Additional information
Affected file:
~/.codex/sessions/2026/03/31/rollout-2026-03-31T22-18-46-019d458c-752d-76c0-bbfa-a29eafa0cbf0.jsonl
File stats:
- Size: 732 MB
- Lines: 170,415
- Largest single JSONL record: ~2.1 MB
- Average record size: ~4.5 KB
Breakdown by record type:
compacted: 337.8 MB across 684 records
response_item/function_call_output: 230.8 MB across 35,368 records
response_item/reasoning: 54.8 MB across 23,659 records
event_msg/token_count: 26.4 MB across 38,885 records
turn_context: 18.0 MB across 955 records
response_item/custom_tool_call: 16.3 MB
response_item/function_call: 14.5 MB
Two large rg tool outputs in the affected session:
- ~1.9 MB output from an
rg command across local repos
- ~1.3 MB output from an
rg command across /tmp and a local repo
Broader local impact:
~/.codex/sessions total size: ~91 GB
- JSONL files over 100 MB: 184
- Largest observed session JSONL: ~1.95 GB
Session metadata:
originator: codex-tui
- affected session
cli_version: 0.118.0
- current installed CLI:
codex-cli 0.134.0
- current binary path:
/opt/homebrew/bin/codex
- affected session records
model_provider: openai, but no concrete model ID is present
Please try reproducing with the affected CLI version 0.118.0 by downloading/installing that version, running a long tool-heavy Codex TUI session, and then inspecting the
generated ~/.codex/sessions/.../rollout-*.jsonl file size and record breakdown.
What version of Codex CLI is running?
0.118.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
codex-tui
Codex doctor report
What issue are you seeing?
Codex CLI/TUI is creating extremely large session JSONL files under
~/.codex/sessions.One affected session file is 732 MB:
~/.codex/sessions/2026/03/31/rollout-2026-03-31T22-18-46-019d458c-752d-76c0-bbfa-a29eafa0cbf0.jsonlA quick breakdown shows the size is dominated by repeated compaction history and raw tool outputs:
compactedrecordsfunction_call_outputreasoningtoken_counteventsturn_contextThe file has 170,415 JSONL records. The largest single record is about 2.1 MB. My
~/.codex/sessionsdirectory is now about 91 GB total, with 184 JSONL files over 100 MBand the largest observed file around 1.95 GB.
This looks like unbounded session logging / repeated persistence of compaction history rather than expected transcript storage.
What steps can reproduce the bug?
rgacross large repos or/tmp.~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl.du -h,wc -l, andjq.Observed result:
The session JSONL grows to hundreds of MB or more. In one case, a single rollout file reached 732 MB with 170,415 records.
The biggest contributors were:
compactedrecords containing largereplacement_historypayloadsfunction_call_outputpayloadsWhat is the expected behavior?
Session logs should stay bounded and should not grow to hundreds of MB or multiple GB for a normal long coding session.
Expected behavior:
replacement_history.Additional information
Affected file:
~/.codex/sessions/2026/03/31/rollout-2026-03-31T22-18-46-019d458c-752d-76c0-bbfa-a29eafa0cbf0.jsonlFile stats:
Breakdown by record type:
compacted: 337.8 MB across 684 recordsresponse_item/function_call_output: 230.8 MB across 35,368 recordsresponse_item/reasoning: 54.8 MB across 23,659 recordsevent_msg/token_count: 26.4 MB across 38,885 recordsturn_context: 18.0 MB across 955 recordsresponse_item/custom_tool_call: 16.3 MBresponse_item/function_call: 14.5 MBTwo large
rgtool outputs in the affected session:rgcommand across local reposrgcommand across/tmpand a local repoBroader local impact:
~/.codex/sessionstotal size: ~91 GBSession metadata:
originator: codex-tuicli_version: 0.118.0codex-cli 0.134.0/opt/homebrew/bin/codexmodel_provider: openai, but no concrete model ID is presentPlease try reproducing with the affected CLI version
0.118.0by downloading/installing that version, running a long tool-heavy Codex TUI session, and then inspecting thegenerated
~/.codex/sessions/.../rollout-*.jsonlfile size and record breakdown.