Back to Blog
Oct 09, 2026·Efe·7 min read·How-to · Workflow

Claude Code to Codex Handoff: Keep Context Mid-Task

You start a task in Claude Code and need to finish it in Codex — but the second agent cannot see the first session. A claude code to codex handoff works when both plugins share one project memory, so Codex starts with your conventions, decisions, and gotchas already loaded.

On this page

  1. Why a claude code to codex handoff starts blank
  2. Prerequisites: point both plugins at one project key
  3. Handoff A: move a mid-task refactor to Codex
  4. What carries over: conventions, decisions, gotchas
  5. Handoff B: hand task history to a review agent
  6. Verify the handoff worked

Why a claude code to codex handoff starts blank

You start a refactor in Claude Code and need to finish it in Codex. A teammate picks it up in a different terminal, you paste the plan into the new session, and Codex still asks which package manager the repo uses. It proposes a pattern you already rejected and misses the migration ordering you settled an hour ago.

The second agent never saw the first conversation. Context lasts only for its own chat lifetime: compaction rewrites it lossily, /clear discards it, and a new process in another tool never had it. Anything that lives only in Claude Code's context window stays invisible to Codex.

Pasted summaries do not fix this. A handoff note goes stale when the task changes direction, it omits the one-line reasons behind decisions, and the receiving agent cannot check what the note left out. A HANDOFF.md helps humans, but agents do not reliably read it unless told.

The second agent needs distilled facts, not a transcript: the conventions the repo enforces, the decisions made with their reasons, and the gotchas discovered mid-task. A claude code to codex handoff works when those facts live outside either conversation, in one project memory both agents read and write.

Prerequisites: point both plugins at one project key

The setup is two installs pointed at the same project. Claude Code and Codex each get a plugin, and both plugins use the same ak_ project key, so they read and write the same memory:

npx @audaxic/memory-claude install
npx @audaxic/memory-codex install

Each plugin saves facts as you work and injects relevant memories when a session starts. There is no handoff command to learn — the handoff is a workflow built on that save-and-inject loop. The Claude Code plugin docs and the Codex plugin docs cover the per-tool configuration.

Use one project per repo. That scoping keeps recall precise: when Codex opens the checkout service, it gets checkout facts, not rules from an unrelated side project. Projects are unlimited on every plan from Hobby through Enterprise, so a separate project per repo costs nothing extra.

Confirm both agents resolve to the same key before you rely on a handoff. Store a convention in Claude Code and recall it in Codex. If Codex cannot retrieve it, the keys differ. The quickstart shows the REST equivalent with POST /search. Fix the mismatch now to avoid a silent empty-memory handoff later.

Same key, same project. Two agents with different project keys have two separate memories and no shared context.

Handoff A: move a mid-task refactor to Codex

Take a concrete claude code to codex handoff: you are splitting an oversized auth module in the billing service. Claude Code already extracted the token refresh path, decided the new file layout, and hit a staging rate-limit quirk that forced a backoff rule.

First, finish your Claude Code turn and let the plugin save. State what it learned in plain language — the file layout decision with its reason, the backoff requirement, the test command for the touched packages. The plugin extracts those as individual facts. No save command or summary document is needed. The Claude Code persistent memory setup describes what gets saved and how session-start injection stays small.

Second, open Codex in the same repo with the same project key. Its plugin injects relevant memories at session start, so the new session arrives with the auth layout, the backoff rule, and the test command. Open with a recall-first prompt: ask Codex what it knows about the auth split, the staging backoff rule, and the test command before assigning the next step.

Third, direct the continuation against that recalled context. Name the next step: extract the session store into the agreed path, keep the backoff on staging calls, run the stored test command. Codex checks its injected facts instead of asking and runs the right test filter on the first try.

Fourth, let Codex write back what the continuation taught it. If the session store extraction surfaced a new constraint — the provider rejects concurrent refreshes, so refreshes must serialize — that becomes a new fact in the same project memory. Each handoff leaves the project memory richer, which pasted notes never do.

What carries over: conventions, decisions, gotchas

A good handoff carries three kinds of facts and nothing else. Keep each memory atomic — one fact per entry — so either agent can update or delete a single rule without untangling a paragraph.

Carries over Example Why Codex needs it
Conventions pnpm, not npm; pnpm test --filter billing-service Stops re-asking tooling questions every session
Decisions with reasons Auth split into three modules because the single file hid circular imports Prevents re-litigating settled design
Gotchas Staging provider rate-limits bursts; backoff required with reason in PR description Avoids repeating a discovered failure

Conventions transfer first because they apply to every command. Without them, Codex spends its opening turns on questions Claude Code already answered: which manager, which test filter, which branch rules. Stored once, these facts answer in every future session.

Decisions need their reasons attached. A bare rule — use three modules — invites the next agent to consolidate them again. A rule with a one-line cause — the single file hid circular imports — survives. Store the decision plus the cause, not the discussion thread.

Gotchas are the highest-value handoff cargo. They record failures already paid for: the migration that must run after the backfill, the 429 responses that need Retry-After handling, the test that passes locally but flakes in parallel. When these live in shared memory, Codex avoids the trap Claude Code already escaped. The Codex memory guide covers what Codex remembers across its own sessions; the handoff extends that mechanism across tools.

Leave out transcripts, diffs, and temporary debugging state. The repo holds file contents, and single-session scratch reasoning has no reuse value. Small facts retrieve cleanly — a search for the backoff rule returns that rule, not a bundle covering four unrelated topics.

Facts, not transcripts. If a memory would not help the third session after this handoff, do not store it.

Handoff B: hand task history to a review agent

The same shared memory supports a second direction: from the agent that wrote the code to the agent that reviews it. The reviewer — Claude Code on a diff, Codex in a CI job, or a script calling the REST API — opens the pull request with only the files in front of it. Point it at the same project memory and it reviews with the task history attached.

The mechanics match Handoff A. The coding agent wrote decisions and gotchas into project memory during implementation. The reviewer starts with a search combining repo, touched areas, and rules, and gets back the conventions, the layout decision with its reason, and the backoff requirement. It then checks instead of asking: it runs the stored test command and catches an ordering bug a stateless run would miss.

The reviewer also writes back, sparingly. If review discussion settled a detail — the agreed backoff interval, a new exception to a convention — store that detail. If the PR introduced no new rule, the reviewer writes nothing. This discipline keeps code review agent memory trustworthy: every stored fact earned its place in a real session.

REST and MCP read and write the same project memory, so the reviewer implementation does not matter. A CI job calls POST /search and POST /add against the data plane at https://api.memory.audaxic.com with the ak_ key and a pinned date-based X-Api-Version header, currently 2026-09-25. An agent in an MCP-compatible client uses the remote server over Streamable HTTP with the same Bearer key. Either way, coders and reviewers never diverge because there is only one memory per project.

Verify the handoff worked

Never trust a handoff without a recall check. The verification takes under a minute and catches the two common failures: mismatched keys and facts that were never stored.

Start in the receiving agent. Ask for something only the first session could know: the auth layout decision and its reason, the staging backoff rule, the test command for the billing service. A working handoff answers all three without repetition. If Codex asks a question Claude Code already resolved, stop and diagnose before continuing — every further turn on a broken handoff compounds the divergence.

If recall fails, check two things in order. First, confirm the project key matches in both plugin configurations — a wrong-project key makes memory look empty while both agents work in isolation. Second, confirm the fact was stored: call GET /list with a small limit and scan for it, or run POST /search with the task terms. A fact you never stated was never saved; restate it to the first agent in plain language and let the plugin extract it.

Audit stored facts the same way you would any agent memory. GET /list is paginated with limit and offset, so pull the first page and look for duplicates and contradictions — two competing facts force every future search to return both and make the receiving agent guess. Correct drift with PUT /update and remove expired rules with DELETE /delete/{memory_id}. Keep entries atomic and small: an add counts per memory extracted from a message batch, and retrieval is tiered with the first 10 memories counting as one request, so tight facts keep both accounting and recall predictable.

Close the loop as a habit. At the end of each handoff session, state the one new thing the project should keep. The next agent — whichever tool it runs in — starts informed, and the claude code to codex handoff becomes routine instead of risky.

FAQ

How does a claude code to codex handoff actually transfer context?

Both plugins save facts as you work and inject relevant memories when a session starts. When Claude Code and Codex share one project key, facts stored in the first session are injected into the second, so Codex continues with your conventions, decisions, and gotchas already loaded.

Do both agents need the same project key?

Yes. The shared project memory is keyed by project, so both plugins must use the same ak_ project key for the same repo. Different keys mean separate memories, and the second agent will start blank even though both plugins work correctly.

What if Codex does not know something from the Claude Code session?

Confirm the keys match first, then check whether the fact was stored with GET /list or POST /search. If the fact is missing, restate it to the first agent in plain language so the plugin extracts it, then ask the receiving agent again.

Can a review agent join the same shared memory?

Yes. Point the reviewer at the same project memory and have it search before reviewing. REST and MCP read and write the same project memory, so a CI job calling the API and an agent in an MCP client both see the same facts.

Try Audaxic free. Hobby is $0 — 10,000 adds, 1,000 retrieves, unlimited projects. Get an API key or read the quickstart. Related: How to Give Claude Code Persistent Memory (5-Minute Setup) and Codex CLI Memory: Keep Context Across Sessions and Code Review Agent Memory: Stop Repeat Comments.

Written by Efe — Oct 09, 2026 · More articles · X @AudaxicTech