---
title: "Continue a Codex session in Antigravity"
canonical: "https://agentdrive.sh/resume/codex-to-antigravity"
---
# Continue a Codex session in Antigravity

> For the complete documentation index, see [llms.txt](https://agentdrive.sh/llms.txt). Every docs page is also served as markdown at its URL plus `.md`, and the full docs are in one file at [llms-full.txt](https://agentdrive.sh/llms-full.txt).

[Resume across agents](https://agentdrive.sh/resume)

To continue a Codex session in Antigravity, install AgentDrive once with `curl -fsSL agentdrive.sh/install | sh`. After that, hooks in `~/.codex` sync each Codex session in the background. Open Antigravity in the same project and ask it to resume your session (the `agentdrive-resume` skill). Antigravity loads a handoff brief with the goal, the files touched and the recent turns.

## Steps

1. ### Install AgentDrive

   Run `curl -fsSL agentdrive.sh/install | sh`. It signs you in and wires session sync and resume into every agent it finds on this machine, Codex and Antigravity included. Setup approves the AgentDrive hooks in Codex for you. On an older Codex, approve them once via `/hooks`.

   ```
   curl -fsSL agentdrive.sh/install | sh
   ```

2. ### Work in Codex as usual

   Hooks in `~/.codex/hooks.json` fire on `SessionStart`, `Stop`, `SessionEnd` and `PreCompact`. Codex allows a `SessionEnd` hook at most 3 seconds, so every AgentDrive hook uses a 3-second timeout and only starts a background sync. The sync uploads the redacted transcript, plus files the agent wrote that git doesn't track, to `sessions/<project>/codex/<session>.md` in your workspace. Before you switch, leave a clear goal and next step in the session; the brief carries them over.

3. ### Resume in Antigravity

   Open Antigravity in the same project and ask it to resume your session (the `agentdrive-resume` skill). It calls `drive_resume`, which loads the latest session in this project from a different agent. If you run several agents, ask for the session from Codex by name, or list sessions with the `agentdrive-sessions` skill and pass an id.

4. ### Check the files before continuing

   Ask Antigravity to check the files on disk before it continues: the brief says what happened, the repo says what is true now.

From a shell, `adrive resume --list` lists this project's sessions and `adrive resume <id>` prints the brief for one.

## Before you switch from Codex to Antigravity

- Ending the session in Codex triggers a sync right away. Turn-end events re-sync at most every two minutes, so end or compact the session if you switch mid-task.
- Codex runs only hooks you have approved. Setup approves the AgentDrive hooks; on an older Codex, approve them once via `/hooks`.
- With auto-context on, Antigravity is told at session start about up to three recent sessions in this project, the newest from each other agent first, so the Codex session shows up before you ask.
- Antigravity has no custom commands, so resume is a skill: ask for it in plain words.

Codex imports sessions from other agents but has no export command, so Antigravity cannot read Codex sessions natively. AgentDrive syncs them through Codex's own hooks instead. [Source](https://codex.danielvaughan.com/2026/07/24/codex-cli-v0145-import-command-cursor-claude-code-migration-mcp-servers-memories-settings/).

## What carries over

- The goal, the files touched and the most recent turns, as a compact brief (12,000 characters by default).
- Files the Codex agent wrote that git doesn't track, such as plans and notes.
- The full redacted transcript, which stays in your workspace and is searchable later.
- Sessions encrypted with Private Workspace resume with `adrive resume <id>` on a machine that holds your key.

## Frequently asked questions

### How do I pick a specific Codex session in Antigravity?

List sessions with the `agentdrive-sessions` skill. It calls `drive_sessions`, which takes a platform filter, so asking for `codex` sessions shows only Codex's. Then resume with the session id.

### Do Codex and Antigravity need to be on the same machine?

No. Signed-in sessions sync to your workspace, so Antigravity can resume a Codex session from another machine with the same AgentDrive account. With a git remote, the project is keyed by the normalized remote, so any clone of the repo matches. Without an account, `adrive resume` reads only this machine's local transcripts.

### Why does the Codex hook only start a background sync?

Codex allows a `SessionEnd` hook at most 3 seconds, and one AgentDrive hook serves every event, so it starts a detached `adrive sync` and returns. The upload finishes after the hook exits and never slows Codex down.

### Can I hand the work back from Antigravity to Codex?

Yes. Sync runs in both directions: Antigravity sessions sync too, and in Codex you ask it to resume your session, or mention the AgentDrive skill with `$agentdrive` to load the latest session from another agent.

## Related guides

- [Continue an Antigravity session in Codex](https://agentdrive.sh/resume/antigravity-to-codex), the same handoff in reverse
- [AgentDrive for Codex](https://agentdrive.sh/integrations/codex) and [AgentDrive for Antigravity](https://agentdrive.sh/integrations/antigravity): setup details for each agent
- [Quick start](https://agentdrive.sh/docs/quick-start): install, sign in and run your first handoff

### Other handoffs

- [Continue a Claude Code session in Antigravity](https://agentdrive.sh/resume/claude-code-to-antigravity)
- [Continue a Codex session in Claude Code](https://agentdrive.sh/resume/codex-to-claude-code)
- [Continue a Codex session in OpenCode](https://agentdrive.sh/resume/codex-to-opencode)
- [Continue a Codex session in Cursor](https://agentdrive.sh/resume/codex-to-cursor)
- [Continue an OpenCode session in Antigravity](https://agentdrive.sh/resume/opencode-to-antigravity)
- [Continue a Cursor session in Antigravity](https://agentdrive.sh/resume/cursor-to-antigravity)
