recover-codex-project-chats

recover-codex-project-chats is a skill for Codex from Songhonglei/better-agent-skills. It costs 94 tokens per session (778 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: 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 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 778 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.00094 $0.00778
Opus 5 $0.00047 $0.00389
Sonnet 5 $0.00019 $0.00156
Haiku 4.5 $0.00009 $0.00078

Measured 11d ago against content hash 6c9339d2b651, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/codex_project_recovery.sh), 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 · 55 lines

How it starts

The opening of the file, as written. The whole thing — 55 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.

Workflow

  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 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-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.

Safety rules

  • Treat state_5.sqlite plus WAL/SHM, rollout JSONL, .codex-global-state.json, and project metadata as one recovery set.
  • Do not edit a live SQLite database.
  • Do not replace all of ~/.codex when a targeted repair is sufficient.
  • Preserve archived state unless the user explicitly requests unarchiving.
  • Do not change provider metadata merely to make rows visible unless the configured provider is compatible with the original sessions. Prefer restoring the provider configuration when compatibility is uncertain.
  • Keep every pre-repair backup until the user verifies the UI and can open representative chats.

Read the full file on GitHub · 55 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d 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 (3 stars, last pushed 4d ago), licensed MIT. It adds 94 tokens to every session and 778 once invoked, about $0.0005 per session on Opus 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.