What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.429.30905 (2345)
What subscription do you have?
Pro and Business
What platform is your computer?
Darwin 25.3.0 arm64 arm
What issue are you seeing?
Summary
Codex Desktop App becomes slow/unresponsive when ~/.codex/sessions contains many rollout JSONL files.
The important point: these session files are not only created by Codex Desktop. They are also created by other Codex clients that share the same CODEX_HOME, including CLI, codex exec, app-server clients, VS Code-style clients, and subagents.
Desktop appears to scan/read the entire ~/.codex/sessions folder, even though ~/.codex/session_index.jsonl contains a much smaller set of sessions that seem to be the intended Desktop-visible history.
Clearing or moving files out of ~/.codex/sessions immediately fixes the Desktop UI lag.
Environment
- Codex Desktop App: Version 26.429.30905 (2345)
- Codex CLI:
codex-cli 0.128.0
- OS: macOS
- Platform: Apple Silicon / Darwin
CODEX_HOME: default ~/.codex
Actual behaviour
Codex Desktop App becomes laggy as ~/.codex/sessions grows.
In my local case:
find ~/.codex/sessions -type f -name '*.jsonl' | wc -l
# 109
du -sh ~/.codex/sessions
# 78M
wc -l ~/.codex/session_index.jsonl
# 22
The Desktop app becomes responsive again after clearing/moving files out of ~/.codex/sessions.
What steps can reproduce the bug?
- Use Codex Desktop App with the default
CODEX_HOME.
- Also use Codex CLI / app-server / other Codex clients that share the same
CODEX_HOME.
- Let
~/.codex/sessions accumulate many rollout JSONL files.
- Open Codex Desktop App.
- Observe Desktop UI lag/slowness.
- Move or clear old files from
~/.codex/sessions.
- Reopen Codex Desktop App.
- Observe that the lag is resolved.
What is the expected behavior?
Codex Desktop App should not eagerly scan or parse every rollout JSONL file under ~/.codex/sessions.
Desktop should only load the sessions it needs for its UI, using a bounded/indexed source of truth such as:
~/.codex/state_5.sqlite
~/.codex/session_index.jsonl
- Desktop-visible source filters
- lazy loading when a specific thread is opened
The Desktop UI should not degrade just because other Codex clients share the same CODEX_HOME.
Evidence / investigation
The sessions folder contains rollout files from multiple sources, not just Desktop-created sessions.
Observed source breakdown included:
vscode: 64
exec: 22
cli: 3
subagent / guardian / thread_spawn: multiple
Meanwhile:
~/.codex/session_index.jsonl: 22 entries
~/.codex/sessions: 109 rollout files
Archived sessions are physically moved out of the hot sessions tree into:
~/.codex/archived_sessions/
and state_5.sqlite marks them as archived. This suggests that files physically present under ~/.codex/sessions are on the Desktop hot path.
Additional information
Suggested fix
Make Codex Desktop App avoid full eager scans of ~/.codex/sessions.
Possible approaches:
- Use
state_5.sqlite or session_index.jsonl as the bounded source for Desktop history.
- Filter by Desktop-relevant sources before touching rollout JSONL contents.
- Lazy-load rollout files only when opening a specific thread.
- Avoid scan-and-repair work across all rollout files during normal Desktop startup or history rendering.
- Add a way to hide/archive non-Desktop sessions from Desktop history.
The core issue is that Codex Desktop App appears to pay an O(number/size of all rollout files) cost for a shared sessions directory that is written by many Codex clients.
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.429.30905 (2345)
What subscription do you have?
Pro and Business
What platform is your computer?
Darwin 25.3.0 arm64 arm
What issue are you seeing?
Summary
Codex Desktop App becomes slow/unresponsive when
~/.codex/sessionscontains many rollout JSONL files.The important point: these session files are not only created by Codex Desktop. They are also created by other Codex clients that share the same
CODEX_HOME, including CLI,codex exec, app-server clients, VS Code-style clients, and subagents.Desktop appears to scan/read the entire
~/.codex/sessionsfolder, even though~/.codex/session_index.jsonlcontains a much smaller set of sessions that seem to be the intended Desktop-visible history.Clearing or moving files out of
~/.codex/sessionsimmediately fixes the Desktop UI lag.Environment
codex-cli 0.128.0CODEX_HOME: default~/.codexActual behaviour
Codex Desktop App becomes laggy as
~/.codex/sessionsgrows.In my local case:
The Desktop app becomes responsive again after clearing/moving files out of
~/.codex/sessions.What steps can reproduce the bug?
CODEX_HOME.CODEX_HOME.~/.codex/sessionsaccumulate many rollout JSONL files.~/.codex/sessions.What is the expected behavior?
Codex Desktop App should not eagerly scan or parse every rollout JSONL file under
~/.codex/sessions.Desktop should only load the sessions it needs for its UI, using a bounded/indexed source of truth such as:
~/.codex/state_5.sqlite~/.codex/session_index.jsonlThe Desktop UI should not degrade just because other Codex clients share the same
CODEX_HOME.Evidence / investigation
The sessions folder contains rollout files from multiple sources, not just Desktop-created sessions.
Observed source breakdown included:
Meanwhile:
Archived sessions are physically moved out of the hot sessions tree into:
and
state_5.sqlitemarks them as archived. This suggests that files physically present under~/.codex/sessionsare on the Desktop hot path.Additional information
Suggested fix
Make Codex Desktop App avoid full eager scans of
~/.codex/sessions.Possible approaches:
state_5.sqliteorsession_index.jsonlas the bounded source for Desktop history.The core issue is that Codex Desktop App appears to pay an O(number/size of all rollout files) cost for a shared sessions directory that is written by many Codex clients.