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 | $0.00030 | $0.00600 |
| Sonnet 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 4d 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.
- 4d 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 (3 stars, last pushed 4d ago), licensed MIT. It adds 59 tokens to every session and 1,201 once invoked, about $0.0003 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-09-08.
Other skills, from other repositories
agentsight-bugfix
A five-stage workflow for fixing bugs in AgentSight: understand the report, reproduce the problem, find its cause, make a small code change, and verify the result. AgentSight is a system that observes and analyses agent activity.
debug-log
A log viewer for the Prismer Evolution plugin. It shows recent hook activity, timestamps, messages, and errors in a readable form.
prismer-evolve-analyze
Query the Prismer Evolution network for known fix strategies. Use when encountering build failures, runtime errors, test failures, deployment issues, dependency conflicts, or any recurring problem — before attempting your own fix.
aafb9b1b091b4dc00c7d838fa91f75c507e51c36045f31bccfc864a8532819f8
Use exact retained evidence.
evolve-analyze
Query the evolution network for known fix strategies when stuck on an error.
honcho-cli
Inspect and debug Honcho workspaces via the honcho CLI. Use when investigating peer representations, memory state, session context, or dialectic quality — any task that requires introspection of a Honcho deployment, including verifying that a recall/record memory loop is actually working.