Skip to content
Back to skills

Codex Handoff

ASecurity

Antigravity ↔ OpenAI Codex 双向协同与迁移(跟/和 Codex 协同、让 Codex 干活/改代码/跑测、/codex resume|migrate|ui|send)。凡涉及让 Codex 执行任务,必须调用 MCP `send_to_codex`(禁止裸敲 codex CLI),默认同工作区同一会话持续进行;迁移自 Codex 的对话首次派活前先问续旧还是开新。

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
ai-agentsrustshellbashsqlnodetestinggitapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned November 29, 2026

npx -y skills add xzha0637-design/token-tracker --skill codex-handoff --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codex Handoff?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Codex Handoff
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/xzha0637-design-codex-handoff/badge)](https://www.skillsdirectory.com/skills/xzha0637-design-codex-handoff)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: codex-handoff
description: Antigravity ↔ OpenAI Codex 双向协同与迁移(跟/和 Codex 协同、让 Codex 干活/改代码/跑测、/codex resume|migrate|ui|send)。凡涉及让 Codex 执行任务,必须调用 MCP `send_to_codex`(禁止裸敲 codex CLI),默认同工作区同一会话持续进行;迁移自 Codex 的对话首次派活前先问续旧还是开新。
---

# Codex ↔ Antigravity Bidirectional Workflow (`/codex`)

Supports both **Codex → Antigravity migration** (read-only `~/.codex` SQLite + JSONL, supporting `full` unclipped history / `deep` / `compact`, plus incremental `sync_codex_delta`) and **Antigravity → Codex delegation** (`send_to_codex` with git baseline isolation, safe net-change undo, smart diff index, optional `async: true`, `conversationId` binding scope, and `codex_review_changes` read-only Second-Opinion Review). Always use the `token-tracker_dashboard` MCP tools (`codex_status`, `send_to_codex`, `codex_review_changes`, `sync_codex_delta`, `get_codex_run_status`, `cancel_codex_run`) instead of improvising raw `codex` shell commands.

## Commands & Modes

1. **Instant 0-LLM Inspection** (handled automatically by `PreInvocation` hook, ~38 ms, 0 LLM calls):
   - `/codex` or `/codex list` → lists the latest 10 Codex sessions (`#1..#10`).
   - `/codex 1` or `/codex <idPrefix>` → prints a secret-masked handoff brief right in chat.
2. **Antigravity Plans → Codex Executes (Strict Binding Gate + Tier-A Cadence)**:
   - Always use the `send_to_codex` MCP tool (NEVER run raw `codex` shell commands directly).
   - **Strict Unbound Gate (do NOT trigger Codex unprompted!)**:
     - If the current Antigravity chat is **NOT bound** to a Codex session: **do NOT proactively suggest or trigger Codex** on normal coding tasks. Only create a new Codex session when the user **explicitly asks to create/start a new Codex session** (or confirms after being asked); then pass `createNewAndBind: true` and `cwd: "<current_antigravity_workspace_path>"` (automatically defaults to the active Antigravity conversation's workspace if omitted), which creates the thread in that exact workspace and automatically 1:1 binds it to the current chat.
     - If the current Antigravity chat **IS already 1:1 bound** to a Codex session (and `允许派活 Codex` is ON): handle analysis, investigation, and concrete design/planning directly in Antigravity first; once the plan is confirmed for implementation/testing (or the user explicitly asks Codex to do it), call `send_to_codex` — it automatically reuses the bound Codex session and streams the result + diff back into this chat.
   - **3-Step Review Guardrail**:
     1. Always include explicit acceptance criteria + the exact test/check command in `prompt`.
     2. Inspect Codex's returned `modifiedFiles`, `commands` exit codes, and `reply` — never blindly trust "done".
     3. If checks fail or edge cases remain, follow up on the same bound session for **at most 2 automatic retry rounds**, then report current state to the user to avoid runaway token burn.
3. **One-Click Batch Migration into Matching Antigravity Workspaces (`/codex migrate ...`)**:
   - Automatically matches each Codex session's `cwd` to its Antigravity `projectId`, deduplicates already-migrated sessions (`tags: ["codex-migrated"]`), and creates an Antigravity conversation via the official `ConversationService/CreateConversation` API with a warm-up prompt asking the agent to **familiarize itself with past Codex history and NOT execute concrete work yet**.
   - Run directly in shell (which receives `ANTIGRAVITY_LS_ADDRESS` & `ANTIGRAVITY_CSRF_TOKEN`):
     ```bash
     # Migrate all Codex sessions active in the last 3 days (supports --days 7/14/30, --min-turns 3, --workspace <name>)
     node ~/.gemini/config/plugins/token-tracker/scripts/token_stats.mjs --codex-migrate --days 3

     # Or migrate specific Codex session IDs / #indices (comma-separated)
     node ~/.gemini/config/plugins/token-tracker/scripts/token_stats.mjs --codex-migrate --ids <id1,id2> --model gemini-4-neon-medium
     ```
   - Report the resulting clickable `[<title>](conversation://<id>)` links concisely! If 0 sessions matched the 3-day window, immediately report the available counts for 7d / 14d / 30d so the user can choose a wider window.
4. **Open Dedicated Codex Migration & Command Workbench UI (`/codex ui`)**:
   - Call `open_codex_workbench({ conversationId: "<current_conversation_id>" })` (opens directly in the Chat side panel `aux_pane` locked to the current conversation, with zero-copy one-click migration + Send-to-Codex composer enabled)! Fall back to `open_token_tracker` with `{"tab": "codex"}` if needed.
5. **Direct Continuation in Current Chat (`/codex resume [1|<id>]`)**:
   - Run `node ~/.gemini/config/plugins/token-tracker/scripts/token_stats.mjs --codex-handoff <1-or-id>` and summarize in 3–5 concise bullets before proceeding.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.