recover-codex-project-chats

recover-codex-project-chats is a skill for Codex from Songhonglei/better-agent-skills. It costs 64 tokens per session (1,103 once invoked), scanned A, original, MIT.

A repair guide and scripts for Codex Desktop projects that exist but show no chats, even though some conversations may still appear in Recent. It focuses on restoring links between projects and conversations without overwriting the only copy of a chat.

In plain words
What is it for?
Use it to diagnose missing project chats, back up Codex data, check database integrity, and apply a matching repair for provider mismatches or missing project assignments.
Why use it?
It helps diagnose why project histories are hidden, such as provider changes, moved folders, archived threads, or incomplete data. It adds backups and database checks before repairs.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: reads ~/.codex paths; mentions Codex.

Good fit Use it to diagnose missing project chats, back up Codex data, check database integrity, and apply a matching repair for provider mismatches or missing project assignments.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/songhonglei/better-agent-skills/recover-codex-project-chats
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Songhonglei/better-agent-skills --skill recover-codex-project-chats
Clone the repo
git clone --depth 1 https://github.com/Songhonglei/better-agent-skills

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for recover-codex-project-chats

README.md
[![agentmods](https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/recover-codex-project-chats/github.svg)](https://agentmods.dev/skills/songhonglei/better-agent-skills/recover-codex-project-chats)
Your own site
<a href="https://agentmods.dev/skills/songhonglei/better-agent-skills/recover-codex-project-chats"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/recover-codex-project-chats/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for recover-codex-project-chats

Your own site · 80×15
<a href="https://agentmods.dev/skills/songhonglei/better-agent-skills/recover-codex-project-chats"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/recover-codex-project-chats.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,103 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00064 $0.01103
Opus 5.5 $0.00026 $0.00441
Sonnet 5.5 $0.00013 $0.00221
Haiku 4.5 $0.00006 $0.00110

Measured 21d ago against content hash 1836c029ceb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

recover-codex-project-chats scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/codex_project_recovery.sh, scripts/restore_local_projects.py, tests/test_restore_local_projects.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/recover-codex-project-chats/SKILL.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Recover Codex project chats

Restore project visibility without overwriting the only copy of a conversation.

Account switches and empty sidebar spaces

Read references/account-switch-recovery.md when projects disappear after signing into another GPT account, or projects exist but custom sidebar spaces are empty. Restore local project membership and sidebar membership as separate layers. Prefer the app's sidebar tools for missing space entries while the app is running; direct file/database repair requires the stopped application.

For an authorized transfer of local metadata into the current account:

python3 scripts/restore_local_projects.py
# After reviewing the preview and fully quitting ChatGPT/Codex:
python3 scripts/restore_local_projects.py --apply

On macOS the user can double-click scripts/restore-local-projects.command after quitting. It invokes the same guarded restore. Signing in remains an app operation. Never transfer cloud conversations, cloud project access, credentials, queued work, or file permissions.

Other recovery workflows

  1. Run scripts/codex_project_recovery.sh diagnose [csv-path] while Codex may remain open. Save the output.
  2. Read references/incident-patterns.md and classify the evidence before changing data.
  3. Back up current ~/.codex, the supplied backup, and Codex-related Application Support directories. Exclude only live Unix sockets.
  4. Before any direct on-disk mutation, require Codex Desktop to be fully stopped. Confirm the app-server, renderer, and service processes are absent.
  5. Run SQLite PRAGMA integrity_check on copies first. Inspect .schema; never invent columns.
  6. Apply only the matching repair:
    • Provider mismatch: run scripts/codex_project_recovery.sh repair-provider <old-provider> <current-provider> after explaining the evidence. Repair only when both names refer to the same compatible backend.
    • Missing assignments: rebuild thread-project-assignments in ~/.codex/.codex-global-state.json from actual thread IDs and cwd values. Preserve existing assignments. Resolve overlapping roots and temporary directories explicitly; do not rely solely on prefix matching.
    • Moved paths: create and review an old-cwd to current-project mapping before updating assignments or cwd metadata.
    • Missing database rows: merge only from a schema-compatible backup after integrity checks and a trial on copies.
  7. Run scripts/codex_project_recovery.sh verify while Codex is stopped, then restart Codex and check each project in the UI.
  8. Report root cause, backup paths, CSV rows, database rows, rollout files found, per-project visible counts, changed rows/files, and unrecovered thread IDs.

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 21d ago Changed · +25 lines · -30 tokens per session 1836c029ceb0
  2. 3mo ago First seen · 55 lines · 94 tokens per session scan A 6c9339d2b651

Subscribe to this mod's changes

recover-codex-project-chats is a skill published in the GitHub repository Songhonglei/better-agent-skills (4 stars, last pushed 13d ago), licensed MIT. It adds 64 tokens to every session and 1,103 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

recover-codex-project-chats compared with skills from other repositories

recover-codex-project-chats next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
recover-codex-project-chatsSonghonglei/better-agent-skillsSkill413d agoMITA64Codex
agent-user-toolsruvnet/rufloSkill83ktodayMITA16Claude Code
scheduling-tasksletta-ai/letta-codeSkill3.9ktodayApache-2.0A40Claude Code, Codex
customizing-statuslineletta-ai/letta-codeSkill3.9ktodayApache-2.0A36Claude Code, Codex
imsgBitterbot-AI/bitterbot-desktopSkill2.5k2d agoMITA19Claude Code, Codex
kungfu-agent-onboardingkungfu-systems/kungfuSkill4.5k6d agoApache-2.0A49Claude Code, Codex
daily-reportvolcengine/OpenVikingSkill43kyesterdayAGPL-3.0A88Claude Code, Codex