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.
npx skills add Songhonglei/better-agent-skills --skill recover-codex-project-chatsgit clone --depth 1 https://github.com/Songhonglei/better-agent-skillsWrote 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.
[](https://agentmods.dev/skills/songhonglei/better-agent-skills/recover-codex-project-chats)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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
- Version: 1.1.0
- License: MIT
- Author: Evan Song · github.com/Songhonglei
- Repository: https://github.com/Songhonglei/better-agent-skills/tree/main/skills/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
- Run
scripts/codex_project_recovery.sh diagnose [csv-path]while Codex may remain open. Save the output. - Read
references/incident-patterns.mdand classify the evidence before changing data. - Back up current
~/.codex, the supplied backup, and Codex-related Application Support directories. Exclude only live Unix sockets. - Before any direct on-disk mutation, require Codex Desktop to be fully stopped. Confirm the app-server, renderer, and service processes are absent.
- Run SQLite
PRAGMA integrity_checkon copies first. Inspect.schema; never invent columns. - 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-assignmentsin~/.codex/.codex-global-state.jsonfrom 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.
- Provider mismatch: run
- Run
scripts/codex_project_recovery.sh verifywhile Codex is stopped, then restart Codex and check each project in the UI. - Report root cause, backup paths, CSV rows, database rows, rollout files found, per-project visible counts, changed rows/files, and unrecovered thread IDs.
What ships with it
11 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.
- .gitignore 650 B
- agents/openai.yaml 281 B
- CHANGELOG.md 774 B
- LICENSE 1.0 KB
- README.md 3.5 KB
- references/account-switch-recovery.md 7.0 KB
- references/incident-patterns.md 2.8 KB
- scripts/codex_project_recovery.sh 8.1 KB runs code
- scripts/restore_local_projects.py 24 KB runs code
- scripts/restore-local-projects.command 296 B
- tests/test_restore_local_projects.py 16 KB runs code
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.
- 21d ago Changed · +25 lines · -30 tokens per session 1836c029ceb0
- 3mo ago First seen · 55 lines · 94 tokens per session scan A 6c9339d2b651
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.
recover-codex-project-chats compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| recover-codex-project-chatsSonghonglei/better-agent-skills | Skill | 4 | 13d ago | MIT | A | 64 | Codex |
| agent-user-toolsruvnet/ruflo | Skill | 83k | today | MIT | A | 16 | Claude Code |
| scheduling-tasksletta-ai/letta-code | Skill | 3.9k | today | Apache-2.0 | A | 40 | Claude Code, Codex |
| customizing-statuslineletta-ai/letta-code | Skill | 3.9k | today | Apache-2.0 | A | 36 | Claude Code, Codex |
| imsgBitterbot-AI/bitterbot-desktop | Skill | 2.5k | 2d ago | MIT | A | 19 | Claude Code, Codex |
| kungfu-agent-onboardingkungfu-systems/kungfu | Skill | 4.5k | 6d ago | Apache-2.0 | A | 49 | Claude Code, Codex |
| daily-reportvolcengine/OpenViking | Skill | 43k | yesterday | AGPL-3.0 | A | 88 | Claude Code, Codex |