BuildGist

How to keep context across Claude Code, Codex and Cursor

Kayvan Zahiri ·

Claude Code, Codex and Cursor don't share memory. Each keeps its own chat, and all three see only the files in the folder you open them in and its Git history. So keep context where they all read it: rules that hold for weeks in one AGENTS.md at the project root, and the live state of the task in a short HANDOFF.md that each new session reads first. When two agents work at once, give each its own branch or Git worktree. On a Mac, BuildGist's Continue can hand the task to the next agent's chat for you. The sample run shows what BuildGist writes about one run.

Why the second agent starts from zero

Cursor can't read a Claude Code transcript, and Codex can't read a Cursor one. So the new agent sees the code but not what you asked for, what you ruled out, or what's left to do.

Each tool can reopen its own past chats: claude --resume, codex resume, and agent resume in the Cursor CLI. They bring back that tool's history only.

Two kinds of context

KindWhat goes in itWhereChanges
RulesStack, build and test commands, style, folders never to touchAGENTS.mdEvery week or two
Live stateThe task, what's done, what failed, the next step, who owns whatHANDOFF.md, plus TASKS.md for parallel agentsEvery session

Which file each agent reads

AgentReadsNotes
CodexAGENTS.md~/.codex/AGENTS.md first, then one file per folder from the repo root down. AGENTS.override.md wins in its folder. 32 KiB combined by default.
CursorAGENTS.md or .cursor/rules/*.mdcRoot and subfolders. A nested one is combined with its parents.
Claude CodeCLAUDE.mdSince v2.1.277 it reads AGENTS.md, but only when there's no CLAUDE.md or CLAUDE.local.md in your folder or above it.

If you also keep a CLAUDE.md, make its first line @AGENTS.md. Claude Code expands that import, so the rules live in one file. To check what loaded, run /context and look under Memory files.

The file layout

AGENTS.md      rules for every agent
CLAUDE.md      @AGENTS.md, plus anything only Claude Code needs
HANDOFF.md     goal, done, tried and failed, next step, don't redo
DECISIONS.md   optional: one dated line per choice you don't want reopened
TASKS.md       parallel agents only: owner, branch, status per task

Add these lines to AGENTS.md:

If HANDOFF.md exists, read it first and say the task and the next step back before you edit.
If TASKS.md exists, claim a task by writing your name and branch on it before you touch code.

Write the handoff note before you switch

Write it before a fresh start: a long session, a limit you can see coming.

Task: Add login with Google.
Done: the sign-in button, the callback route, the signed-in state. See the diff.
Tried and failed: keeping the session in localStorage (lost on refresh).
Next step: check that a deleted note belongs to the signed-in user.
Don't redo the sign-in work.

If the agent writes it, read it first. Run git diff --stat, and if a file the note calls done isn't there, fix the note. Delete it when the task is finished.

Two agents on the same repo at once

Give each agent its own git worktree so they never edit the same checkout:

git worktree add ../app-codex -b codex/export-csv

Open Codex in ../app-codex, Claude Code in the main folder. Merge when a piece is done, then read the combined diff once.

Other ways people do it

Or choose Continue in BuildGist

When you start a new chat in another coding agent in the same project, a BuildGist card at the bottom right of your screen offers the earlier agent's task. Choose Continue and the new chat starts with that task's context. Start fresh hands nothing over.

The context is your own words: what you asked for, and constraints you typed. If the last run's files are unchanged and HEAD hasn't moved, it can also say how many files that run changed, whether a test failed, and up to three paths. No patch.

By default the card offers a task active in this project within 12 hours. Claude Code and Codex take the context on a new session. In Cursor it's best effort, so if the task doesn't show, paste the note. BuildGist doesn't write HANDOFF.md, doesn't touch CLAUDE.md or AGENTS.md, and doesn't merge two agents' edits. Setup is in Getting started.

More: Claude Code to Codex and which agents read AGENTS.md.

Questions

Do Claude Code, Codex and Cursor share memory?

No. Each keeps its own chat history, and Claude Code's auto memory stays on your machine. They share the files in the folder, which is why AGENTS.md and HANDOFF.md work across all three.

Should I symlink CLAUDE.md to AGENTS.md or import it?

Either works. Anthropic suggests the import if anyone clones on Windows, where Git can check a committed symlink out as a one-line text file unless core.symlinks is enabled.

Does context survive Claude Code's /compact?

The project-root CLAUDE.md does: Claude Code re-reads it after compacting. Instructions given only in the chat don't, so put what must last in a file. More in Claude Code lost context after compacting.

What happens to context when I hit a usage limit mid-task?

The chat stays in that agent. Update HANDOFF.md first if you can, then open the other agent in the same folder, or start a new chat there and choose Continue. See usage limit hit mid-task.

What you need

Codex needs you to approve BuildGist once, in Codex. BuildGist shows the steps. Setup is in Getting started.

To explain a run, your computer sends BuildGist what that run needs, and BuildGist passes it to Anthropic. BuildGist does not keep this material. It does not send your whole repository, files the run did not change, or files named like secrets, such as .env files and keys. It keeps the explanation and short cited excerpts of changed code, at most 12 lines each. Secret masking is best-effort. Privacy has the full list.

Every account gets 7 days of BuildGist Pro free, with no card. The 7 days start at your first explanation or Continue handoff. Nobody is charged when the trial ends. After that, BuildGist Pro is $12 per month, plus any applicable tax shown at checkout. See pricing.

Try BuildGist Download for Mac

No Mac handy? Try it in your browser: paste a session or a git diff and see the explanation.

Apple silicon, macOS 12 or later. United States, 18 or older.

Related

Questions: kayvanandre@gmail.com.