codex-delegate

codex-delegate is a skill for Claude Code, Codex from kachofugetsu09/akashic-agent. It costs 61 tokens per session (1,964 once invoked), scanned A, original, MIT.

A way to hand a long coding task to another Codex process running in the background. The delegated process explores the repository, makes the requested changes, and reports the result.

In plain words
What is it for?
Use it to delegate a substantial coding task to Codex CLI, wait for it to finish, and bring its result back into the conversation.
Why use it?
It keeps the main conversation available while a separate process handles work that may take a long time. It is intended for tasks that can be completed independently in a repository.

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/kachofugetsu09/akashic-agent/codex-delegate
Any agent
npx skills add kachofugetsu09/akashic-agent --skill codex-delegate
Clone the repo
git clone --depth 1 https://github.com/kachofugetsu09/akashic-agent

Made for: Claude Code, 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 codex-delegate

README.md
[![agentmods](https://agentmods.dev/badge/skills/kachofugetsu09/akashic-agent/codex-delegate.svg)](https://agentmods.dev/skills/kachofugetsu09/akashic-agent/codex-delegate)
Your own site
<a href="https://agentmods.dev/skills/kachofugetsu09/akashic-agent/codex-delegate"><img src="https://agentmods.dev/badge/skills/kachofugetsu09/akashic-agent/codex-delegate.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,964 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00061 $0.01964
Opus 5 $0.00030 $0.00982
Sonnet 5 $0.00012 $0.00393
Haiku 4.5 $0.00006 $0.00196

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

Security

Grade A, and why

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

skills/codex-delegate/SKILL.md · 105 lines

How it starts

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

Codex Delegate

目标

把一个可以独立完成的长任务交给后台 subagent;subagent 内部用 shell 启动 codex exec,再用 write_stdin 长等待直至完成,最后由后台 subagent 把结果带回主会话。

流程

┌─ 主会话
│  ├─ shell(command -v codex && codex --version)
│  └─ spawn(run_in_background=true, profile="scripting" 或 "general")
│     └─ 后台 subagent
│        ├─ write_file(<task_dir>/prompt.txt)
│        ├─ shell(yield_time_ms=30000)
│        │  └─ codex exec --cd <repo> --output-last-message <task_dir>/codex-result.md - < <task_dir>/prompt.txt
│        │     └─ 若返回 execution_id,write_stdin(yield_time_ms=300000) 续接到完成
│        ├─ read_file(<task_dir>/codex-result.md)
│        └─ read_file(<task_dir>/codex-session.txt)
└─ subagent 完成后回灌结果

使用规则

  1. 主 agent 必须先检查 codex 是否存在:调用 shell(command="command -v codex && codex --version")。如果失败,直接告诉用户本机没有可用 Codex CLI,不要 spawn。不要把这个检查下放给 subagent。
  2. 如果用户已经给出 repo 路径,主 agent 不要为了理解任务先 list_dirread_fileshell find/grep 探索该仓库;只把 repo 路径和任务目标原样传给 spawn。代码库探索由 Codex delegate 完成。
  3. 只有用户没给 repo 路径、路径明显缺失、或用户要求主 agent 先确认路径时,主 agent 才做最小路径检查。
  4. 主 agent 不要在 spawn task 里写“重点读取这些文件”“我已经发现这些入口”“候选路径如下”这类预探索结果;除非用户原文明确指定文件。spawn task 只能包含用户给出的 repo 路径、用户目标、输出要求和本技能的执行约束。
  5. Codex prompt 必须要求 Codex 自己从整个 repo 发现入口、目录和相关文件,而不是沿着主 agent 预先挑出的文件列表工作。
  6. 检查通过后,外层必须用 spawn(run_in_background=true),不要在主会话里直接跑长时间 codex exec
  7. subagent 的 profilescripting;如果任务还需要联网调研,选 general
  8. subagent 内部启动 codex exec 时把 yield_time_ms 设为 30000;若返回 execution_id,用空 charswrite_stdin 续接,并把 yield_time_ms 设为 300000,直到结果不再返回 execution_id
  9. timeout 是 execution 进程组的硬截止,默认 14400 秒;它不控制单次等待。只有需要更短硬截止时才显式传入。
  10. codex exec 要用 --cd <repo> 指定工作目录,避免依赖 shell 的 cd 状态。
  11. 默认把任务说明写入 prompt 文件,再用 codex exec --cd <repo> - < prompt.txt 读取,避免 shell 引号、换行和特殊字符破坏 prompt。
  12. 必须给 codex exec--output-last-message <task_dir>/codex-result.md,完成后读这个文件作为主要结果;不要从 /tmp/akashic-shell-*.log 里 grep 或 tail 输出。
  13. 同时把 stdout+stderr 保存到 <task_dir>/codex-run.log,因为 session id: ... 在 stderr 里。
  14. 如果需要后续复用同一个 Codex 会话,必须从 codex-run.log 提取 session id,写入 <task_dir>/codex-session.txt,并在回复里告诉主会话这个 session id。
  15. prompt、result、run log、session id 都必须放在 subagent 任务目录 <task_dir>;不要写 /tmp,也不要依赖 /tmp/akashic-shell-*.log

Read the full file on GitHub · 105 lines

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. 4d ago First seen · 105 lines · 61 tokens per session scan A 65bdca08f78a

Subscribe to this mod's changes

codex-delegate is a skill published in the GitHub repository kachofugetsu09/akashic-agent (488 stars, last pushed today), licensed MIT. It adds 61 tokens to every session and 1,964 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-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens