Agent Skills: Codex handoff

Delegate tasks to Codex non-interactively with `codex exec`. Use for agent-to-agent handoffs, unattended runs, deterministic CLI invocation, JSONL event capture, or structured final output.

UncategorizedID: cardoso-neto/personal-ai-infra/codex-handoff

Install this agent skill to your local

pnpm dlx add-skill https://github.com/cardoso-neto/personal-ai-infra/tree/HEAD/.agents/skills/codex-handoff

Skill Files

Browse the full folder contents for codex-handoff.

Download Skill

Loading file tree…

.agents/skills/codex-handoff/SKILL.md

Skill Metadata

Name
codex-handoff
Description
Delegate tasks to Codex non-interactively with `codex exec`.

Codex handoff

Pass a complete, self-contained task through stdin:

set -o pipefail
codex exec \
  --yolo \
  --cd "$workspace" \
  --strict-config \
  -c model_reasoning_effort=medium \
  --json \
  --color never \
  --output-last-message "$result" \
  - < "$prompt" \
  | tee "$events"
  • Parse $events as JSONL; read $result for the final response.
  • Capture .thread_id from the first event (thread.started) to resume the session later with codex exec resume <id>.
  • Keep every session in ~/.codex/sessions/<YYYY>/<MM>/<DD>/rollout-<timestamp>-<thread_id>.jsonl.
    • Never override CODEX_HOME, use a temporary Codex home, or use --ephemeral for handoffs.
    • Its turn_context events record the effective model and reasoning effort; the JSON event stream does not.
  • Add --output-schema <schema.json> when the caller requires a machine-validated response.
  • Keep -c model_reasoning_effort=medium; without it runs can default to none.
    • Raise to high for hard tasks (deep reviews, tricky debugging).
  • Add --add-dir <dir>, --skip-git-repo-check, --image, or --model (e.g. --model gpt-5.6-sol) only when the task requires it.
  • Put the top-level --search before exec when live web search is required.
  • Recheck codex exec --help after CLI upgrades; the installed binary is authoritative.