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 agentmods add commands/cbmono/ai-setup/codex-handoffgit clone --depth 1 https://github.com/cbmono/ai-setupWhat 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 | $0.00000 | $0.02661 |
| Opus 5 | $0.00000 | $0.01331 |
| Sonnet 5 | $0.00000 | $0.00532 |
| Haiku 4.5 | $0.00000 | $0.00266 |
Grade B, and why
codex-handoff scanned grade B 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.
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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
[ -n "$BASE" ] && [ "$BASE" != none ] || BASE="$(cat "$ROOT/.claude/codex-baseline-head" 2>/dev/null || true)" How it starts
The opening of the file, as written. The whole thing — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Hand this session off to Codex — or pull Codex's work back into Claude. One command, both directions.
Use this when Claude tokens are running low (or you want a different model on the problem). It wraps
the codex plugin's transfer, fixing the two things that make the raw command awkward: the
transcript it can't auto-detect, and the fact that there is no built-in way back.
Requires the opt-in codex plugin (openai/codex-plugin-cc). If it isn't installed, say so and stop:
/plugin marketplace add openai/codex-plugin-cc, /plugin install codex@openai-codex,
/reload-plugins, then /codex:setup.
Argument: $ARGUMENTS — empty means go to Codex; back means return to Claude, and
back <session-id> returns from a specific handoff when the checkout has more than one on record.
Preflight (both directions)
- Resolve the companion script, preferring the version this setup pins. Never hardcode a single
version — the path contains one and it changes on plugin update — but don't blindly take the
newest either, or a freshly-cached release silently supersedes the pinned one:
If the pinned version is absent and a different one is used, say which — the user is running code they didn't pin. If nothing resolves, the plugin isn't installed (see above) — stop.CODEX_PIN="v1.0.6" # keep in step with `ref` in settings.codex.example.json CODEX_ROOT="$HOME/.claude/plugins/cache/openai-codex/codex" CODEX_COMPANION="$CODEX_ROOT/${CODEX_PIN#v}/scripts/codex-companion.mjs" if [ ! -f "$CODEX_COMPANION" ]; then CODEX_COMPANION="$(ls -1d "$CODEX_ROOT"/*/scripts/codex-companion.mjs 2>/dev/null | sort -V | tail -1)" fi - Confirm Codex is ready:
node "$CODEX_COMPANION" setup --json. Ifreadyis nottrue, report which check failed (node/npm/codex/auth) and stop —authfalse means!codex login. - Resolve one state file path, used by both directions. A relative path breaks when the return
leg runs from a different directory, so anchor it to the repo root and create the parent:
The log holds one append-only record per handoff, keyed by session id —ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" SESSION_LOG="$ROOT/.claude/codex-sessions.log" mkdir -p "$(dirname "$SESSION_LOG")"<utc-timestamp>\t<session-id>\t<baseline-head>. Handoff state must never live in a single-slot file: two handoffs from one checkout (a second problem the same afternoon, two agents, two worktrees of the same repo) would overwrite each other's baseline, andbackwould silently resume whichever was last without saying so. Everything the return leg needs is in the record it selects.
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.
- 2d ago First seen · 153 lines · 0 tokens per session scan B 4fe9abd87014
codex-handoff is a command published in the GitHub repository cbmono/ai-setup (2 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,661 tokens. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
claude-flow-swarm
Coordinate multi-agent swarms for complex tasks.
bootstrap
PACT session-start ritual — identify the session team (platform-provisioned), secretary spawn, paused-state surface, bootstrap marker.
ox-session-review
Command "ox-session-review" from sageox/ox, covering failure-mode watch-list (read first), from the ledger root. should print 0, phase 1 — scan & score (read-only), quality buckets (first match wins) and removal candidates.
add-agent
引导新增一个 Agent 适配器。用法 /add-agent.
handoff
Package current state for the next agent.
xdo
Direct development by the Main Agent.