Borrowing it
Nothing to install: this file belongs to cbmono/ai-setup. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/cbmono/ai-setup/main/.claude/commands/codex-handoff.mdgit clone --depth 1 https://github.com/cbmono/ai-setupWrote 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/commands/cbmono/ai-setup/codex-handoff)<a href="https://agentmods.dev/commands/cbmono/ai-setup/codex-handoff"><img src="https://agentmods.dev/badge/commands/cbmono/ai-setup/codex-handoff/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/commands/cbmono/ai-setup/codex-handoff"><img src="https://agentmods.dev/badge/commands/cbmono/ai-setup/codex-handoff.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.00000 | $0.02661 |
| Opus 5.5 | $0.00000 | $0.01064 |
| Sonnet 5.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 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.
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.
- 2mo 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 10d 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
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
constitution
Create or update the project constitution from interactive or provided principle inputs.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.