codex-task-inspector

A read-only tool for checking the progress of Codex's asynchronous coding tasks. It looks in Codex's actual data directory, where session logs record commands, completion status, and CI checks.

In plain words
What is it for?
Use it to inspect a task by its session ID, determine whether local workers are still active, separate local and CI status, and summarize failures or available next steps.
Why use it?
It prevents confusing repository tracking files with the records that show whether a local worker or CI task is really running, finished, or failed.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/bifrost-proxy/bifrost/codex-task-inspector
Any agent
npx skills add bifrost-proxy/bifrost --skill codex-task-inspector
Clone the repo
git clone --depth 1 https://github.com/bifrost-proxy/bifrost

Made for: Claude Code, Codex.

Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,291 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00091 $0.02291
Opus 5 $0.00046 $0.01145
Sonnet 5 $0.00018 $0.00458
Haiku 4.5 $0.00009 $0.00229

Measured 2d ago against content hash 127660d46728, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex-task-inspector scanned grade A with 1 finding 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 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/detect_codex_data_dir.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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

p = subprocess.run(
.agents/skills/codex-task-inspector/SKILL.md · 239 lines

How it starts

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

Codex Task Inspector

用于统一检查 Codex 异步任务状态,避免把“仓库里的任务跟踪文件(.codex-tasks/)”与“Codex 实际数据目录里的 session/rollout 日志”混为一谈。

关键纠错(高频踩坑)

当用户提供类似 019df414-... 这种 rollout/session id 并询问“任务进展”,默认应优先检查探测出的 Codex 数据目录

  • <detected_codex_dir>/sessions/YYYY/MM/DD/rollout-...-<id>.jsonl(权威事实来源:含 task_complete、命令执行、CI watch 记录)
  • ⚠️ .codex-tasks/ 只在用户明确说“看仓库里的 .codex-tasks 跟踪”或你确定该任务是由仓库派发器写入 .codex-tasks/ 时才用

如果你先去 .codex-tasks/ 导致找不到 id,这是误判路径;应立即切换到探测出的 Codex 数据目录再查。

适用场景

当用户提到以下意图时触发:

  • “检查 Codex 状态”
  • “看看 Codex 任务进展”
  • “汇总 .codex-tasks
  • “本地任务还在跑吗”
  • “CI 这边还剩什么”
  • “哪个 Codex 任务失败了”

核心原则

  1. 先判定本地进程,再看文件产物。 不要因为 .codex-tasks 里还有文件,就误判任务仍在运行。
  2. 本地任务状态与 CI 状态分开汇报。 .pid 代表本地进程,*-last.md / *-report-*.md 代表任务产物,*.log 里的 poll 代表 CI 轮询。
  3. 默认只读。 不修改 .codex-tasks/,不清理 pid/log/report,不擅自重跑任务。
  4. 输出必须给出下一步建议,但只限于:继续查失败原因 / 整理状态表 / 指定某任务深挖。

标准检查顺序

第 0 步:先选对数据目录(必须)

0.0 先探测 Codex 实际数据目录

无论最终是否会落到 .codex-tasks/,先明确当前机器上的 Codex 数据目录,避免把 ~/.codex 当成硬编码事实。

优先运行:

python3 .agents/skills/codex-task-inspector/scripts/detect_codex_data_dir.py

解读规则:

  • selected_source=env:CODEX_HOME → 说明当前应优先看 CODEX_HOME
  • selected_source=default:$HOME/.codex → 说明当前使用默认回退目录
  • markers 里若存在 config_toml/sessions_dir/session_index/history/state_db,可作为“这是活跃 Codex home”的旁证

只有当用户明确要求检查仓库 .codex-tasks/ 时,才切换到仓库路径;否则都先以探测结果为准。

输入信号 → 选路由:

  • 用户给的是 019... 这种 rollout/session id,或明确说“去 Codex 默认数据目录” → 走探测出的 Codex 数据目录
  • 用户明确说“看这个仓库 .codex-tasks” → 走 .codex-tasks/
0.1 在探测出的 Codex 数据目录按 rollout/session id 定位日志

优先在 <detected_codex_dir>/sessions/ 下找 rollout-*-<id>.jsonl

export RID='019df414-235e-74e3-be4b-84f883e0ea17'
export CODEX_DIR="$(python3 .agents/skills/codex-task-inspector/scripts/detect_codex_data_dir.py | python3 -c 'import json,sys; print(json.load(sys.stdin)["selected_path"])')"
python3 - <<'PY'
import glob
import os

rid = os.environ['RID']
base = os.path.join(os.environ['CODEX_DIR'], 'sessions')
paths = glob.glob(f"{base}/**/rollout-*-{rid}.jsonl", recursive=True)
for p in sorted(paths):
    print(p)
PY

Read the full file on GitHub · 239 lines

Files

What ships with it

1 file 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. 2d ago First seen · 239 lines · 91 tokens per session scan A 127660d46728

Subscribe to this mod's changes

codex-task-inspector is a skill published in the GitHub repository bifrost-proxy/bifrost (124 stars, last pushed 3d ago), licensed MIT. It adds 91 tokens to every session and 2,291 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.