/install codex-history-visibility-repair
Codex History Visibility Repair
Overview
Use the bundled Python script to repair Codex Desktop's local history indexes after migrations. The common root cause is not missing JSONL files: thread/list filters by exact model_provider, source metadata, state database rows, and project assignments.
Quick Start
Run a dry run first:
python "$env:USERPROFILE\.codex\skills\codex-history-visibility-repair\scripts\repair_codex_history_visibility.py" --dry-run --scan-project-parent D:\object
Apply the repair and verify via app-server thread/list:
python "$env:USERPROFILE\.codex\skills\codex-history-visibility-repair\scripts\repair_codex_history_visibility.py" --scan-project-parent D:\object --verify-app-server
If restored sessions are still archived, include them explicitly:
python "$env:USERPROFILE\.codex\skills\codex-history-visibility-repair\scripts\repair_codex_history_visibility.py" --target all --unarchive --scan-project-parent D:\object --verify-app-server
Workflow
- Confirm the symptom with local counts: session files exist but
thread/listor the sidebar returns too few rows. - Run
--dry-run; checkselectedThreads,visibleThreads,providerDistribution, andprojectMappings. - Run without
--dry-run; the script creates~/.codex/history_sync_backups/visibility-repair.*. - Prefer
--verify-app-server; success means boththreadListStateDbOnly.returnedandthreadListScanMode.returnedmatch visible thread count. - Fully exit Codex Desktop, wait 5-10 seconds, reopen it.
What The Script Repairs
| File or store | Repair |
|---|---|
state_5.sqlite |
normalizes \\?\ prefixes, sets source, thread_source, exact model_provider, and millisecond timestamps |
| rollout JSONL | syncs first session_meta.payload so scans do not restore stale metadata |
session_index.jsonl |
rebuilds visible thread index |
history.jsonl |
rebuilds prompt history entries used by desktop history surfaces |
.codex-global-state.json |
rewrites project roots, root hints, and complete project assignments |
Default provider is OpenAI because recent Codex Desktop builds filter by that exact value. Override with --provider only after verifying the active build expects another string.
Common Mistakes
- Do not only copy files into
sessions/; the sidebar also depends on SQLite and global state. - Do not use lowercase
openaiunlessthread/listproves the current app expects it. - Do not patch only
state_5.sqlite; app-server scans rollout JSONL and can reintroduce stale provider/source metadata. - Do not leave old after-exit scripts running; they can overwrite the repaired global state.
- Do not publish personal backups, databases, logs, or auth files with this skill.
Publishing Hygiene
Before sharing or publishing the skill, include only:
SKILL.mdagents/openai.yamlscripts/repair_codex_history_visibility.py
Never include .codex backups, SQLite databases, history.jsonl, session_index.jsonl, logs, auth files, or user-specific rollout contents.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install codex-history-visibility-repair - After installation, invoke the skill by name or use
/codex-history-visibility-repair - Provide required inputs per the skill's parameter spec and get structured output
What is Codex History Visibility Repair?
Use when Codex Desktop history, migrated sessions, restored rollout JSONL files, or old projects exist on disk but do not appear in the sidebar, especially a... It is an AI Agent Skill for Claude Code / OpenClaw, with 37 downloads so far.
How do I install Codex History Visibility Repair?
Run "/install codex-history-visibility-repair" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Codex History Visibility Repair free?
Yes, Codex History Visibility Repair is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Codex History Visibility Repair support?
Codex History Visibility Repair is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Codex History Visibility Repair?
It is built and maintained by lttcn (@lttcnly); the current version is v0.1.0.