`ghost_commit` tool creates large session that kills codex
What version of Codex is running?
0.61.1-alpha.1
What subscription do you have?
Business
Which model were you using?
Gpt-5.1-Codex
What platform is your computer?
_No response_
What issue are you seeing?
As seen in multiple issues, many users are having issues with indefinite reconnecting that never ends on both cli and vs code extension.
After many tests, and attempted fixes i have found that this issue in my case was due to an abnormally large jsonl session file. Which wasnt just 100% larger, or 200%, but a whopping 33,000% larger than the 2nd largest file. (3.9gb in size) now after inspecting this file i of course saw its all single line, and had to format it with jq to read it. And the issue was immediately obvious. This file contained every node module path, every pip path, and the path of every single file inside every node module and python package in this workspace. Not once, or twice, but several times.
Why is this? "Ghost_commit", 2476 snapshots listing every single untracked file in the repo.
These snapshots should exclude build files, .venv, dist, node modules, and several others. They should adhere to git ignore, and if there isnt one there is no reason they shouldnt be automatically ignoring these directories.
What steps can reproduce the bug?
Use codex on a large repository, with node_modules, venv, dist, or build. View jsonl file for that session.
What is the expected behavior?
_No response_
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This script will simply remove all untracked files from the arrays in ghost_snapshot. Doing this reduced my problem jsonl from 3.9gb all the way down to 150mb.
running python3 fix.py --all-sessions ~/.codex --in-place will fix your codex until it happens again. (fix.py name obviously not necessary) running this will clear all untracked file arrays, after its done restart vs code, or re run codex cli, and it will work again. make sure you back up your sessions folder just in case.
https://github.com/openai/codex/pull/7483