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 codex-thread-repairgit 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/codex-thread-repair)<a href="https://agentmods.dev/skills/songhonglei/better-agent-skills/codex-thread-repair"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/codex-thread-repair/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/codex-thread-repair"><img src="https://agentmods.dev/badge/skills/songhonglei/better-agent-skills/codex-thread-repair.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.00059 | $0.01201 |
| Opus 5.5 | $0.00024 | $0.00480 |
| Sonnet 5.5 | $0.00012 | $0.00240 |
| Haiku 4.5 | $0.00006 | $0.00120 |
Grade A, and why
codex-thread-repair 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 2mo 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 — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codex Thread Repair
- Version: 1.0.1
- License: MIT
- Author: Evan Song · github.com/Songhonglei
- Repository: https://github.com/Songhonglei/better-agent-skills/tree/main/skills/codex-thread-repair
Repair a specific local task without rewriting its message bodies or replacing the whole Codex state directory.
Dependencies
- macOS with the Codex desktop app installed as
/Applications/ChatGPT.app. - Python 3.10 or newer. The repair script uses only the Python standard library.
- A local Codex state directory containing
state_5.sqlite,sqlite/codex-dev.db, and the selected task's JSONL rollout. It defaults to$CODEX_HOMEwhen set, otherwise~/.codex. - Local read/write access to the selected rollout and Codex state. No network access or third-party Python package is required.
Workflow
-
Resolve
<skill-dir>as the directory containing thisSKILL.md; never assume that the current working directory is the skill directory. Resolve and diagnose the user-supplied title or ID while Codex may remain open:python3 "<skill-dir>/scripts/thread_repair.py" diagnose "<title-or-id>"Exact UI-title matches come from
local_thread_catalog; canonical rows and rollout paths come fromstate_5.sqlite. If a title is ambiguous, show the candidates and ask the user for an exact ID. Never choose by recency alone. -
Read references/repair-patterns.md when diagnosis is not
healthyorsupported_ordinal_orphan. Do not auto-repair an unrecognized structure. -
For
supported_ordinal_orphan, explain the detected boundary and prepare one offline launcher:python3 "<skill-dir>/scripts/thread_repair.py" prepare "<title-or-id>"Tell the user to press Cmd+Q and then double-click the returned
.commandfile. The launcher creates a targeted recovery set, applies the patch atomically, verifies it, and reopens Codex. -
After Codex restarts, verify both layers:
What ships with it
8 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.
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.
- 2mo ago First seen · 90 lines · 59 tokens per session scan A 721ea29975bc
codex-thread-repair is a skill published in the GitHub repository Songhonglei/better-agent-skills (4 stars, last pushed 13d ago), licensed MIT. It adds 59 tokens to every session and 1,201 once invoked, about $0.0002 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-09-08.
codex-thread-repair compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| codex-thread-repairSonghonglei/better-agent-skills | Skill | 4 | 13d ago | MIT | A | 59 | Codex |
| agent-performance-optimizerruvnet/ruflo | Skill | 83k | today | MIT | A | 19 | Claude Code |
| agent-refinementruvnet/ruflo | Skill | 83k | today | MIT | A | 15 | Claude Code |
| error-recoverybojieli/ai-agent-book | Skill | 60k | yesterday | Apache-2.0 | A | 111 | Claude Code, Codex |
| memory-recallzilliztech/memsearch | Skill | 3.0k | 3d ago | MIT | A | 152 | Claude Code |
| pre-action-interceptorsBitterbot-AI/bitterbot-desktop | Skill | 2.5k | 2d ago | MIT | A | 44 | Claude Code, Codex |
| agentsight-bugfixalibaba/anolisa | Skill | 688 | 8d ago | Apache-2.0 | A | 67 | Claude Code, Codex |