codex-infinity-threadlisted
Install: claude install-skill haberlah/codex-infinity-thread
# Codex Infinity Thread
Keep a long-lived Codex conversation usable across hundreds of tasks, and bring it
back when the session grows too large for the desktop app to open, by slimming its
on-disk rollout while preserving the thread.
## The failure this fixes
Codex stores each session as a JSONL "rollout" at
`~/.codex/sessions/YYYY/MM/DD/rollout-<timestamp>-<uuid>.jsonl`. When the desktop
app opens a session it aggregates the entire rollout into a single in-memory
string. Node/V8 caps a string at **536,870,888 bytes (~512 MB)**; past that the
main process throws **`RangeError: Invalid string length`** and the app crashes
on launch (it auto-restores the last session, so it re-crashes every time).
The bloat is almost always **base64 screenshots**: the `computer-use` / browser
tool records one per action, and each is stored twice (as a `data:image` URI in
the model-facing `function_call_output`, and as an MCP `{type:image,data,...}`
block in the display-only event). Text is tiny by comparison.
This is a real, unresolved issue (see references/troubleshooting.md for the
upstream bug reports). There is no official repair command - hence this skill.
## Quick start
```bash
# 1. Find the offender (or pass a path directly)
python {baseDir}/scripts/repair_rollout.py --auto --dry-run
# 2. Repair it (archives the original, swaps in the slimmed file)
python {baseDir}/scripts/repair_rollout.py /path/to/rollout-....jsonl
# 3. Confirm it's safe to load
python {baseDir}/scripts/verif