A passive, on-demand handoff snapshot between Claude Code and Codex CLI.
When one coding agent stops unexpectedly because of a quota limit, crash, terminal closure, or interrupted step, run this script inside the same Git repository. It creates a single passationlive.md file that the other agent can read before continuing.
The script does not install hooks, modify Claude/Codex configuration, or run permanently in the background.
-
The 4 latest complete prompt/response exchanges.
-
8 earlier progress milestones distributed across the primary session, before the latest exchanges.
-
Recovered session coverage, including:
- activity start and end times;
- total duration;
- prompt count;
- agent-message count;
- tool-action count;
- complete-exchange count.
-
The 20 latest meaningful recovered tool actions, with repeated waits and polling collapsed.
-
The latest unanswered instruction, when one exists.
-
An explicit next step only when it is clearly present in an agent message.
-
Up to 50 currently modified or untracked files, with exact modification times.
-
A summary of the current uncommitted Git changes.
-
Previews of small untracked files.
-
The 10 latest local commits.
-
Statistics and modified-file lists for the 3 most recent commits.
-
Matching Claude Code, Codex CLI, and Claude subagent transcripts.
-
Recent transcript activity and compact Claude Code/Codex CLI process counts.
Git is treated as the source of truth.
Existing local Claude and Codex session files, including matching Claude subagent transcripts, are read passively and on a best-effort basis to reconstruct the work completed before an interruption.
The script does not:
- install hooks;
- call an AI model;
- modify Claude Code configuration;
- modify Codex CLI configuration;
- leave a background process running.
- Python 3.10 or newer;
- Git;
- Claude Code and/or Codex CLI using their normal local session storage.
No Python package needs to be installed.
curl -L -o handoff_snapshot.py \
https://raw.githubusercontent.com/SpendinFR/passation-/main/handoff_snapshot.pyOr download handoff_snapshot.py directly from this repository.
Immediately after Claude Code or Codex CLI stops, run this from the affected repository:
python3 /path/to/handoff_snapshot.py --repo .Windows PowerShell:
py C:\path\to\handoff_snapshot.py --repo .The command creates or replaces:
passationlive.md
It exits immediately. No daemon or watcher remains active.
To keep the generated handoff local without changing the project's shared .gitignore:
echo passationlive.md >> .git/info/excludePowerShell:
Add-Content .git/info/exclude "passationlive.md"Open the other agent in the same repository, working tree, and branch, then use a prompt such as:
Read passationlive.md, then verify git status and git diff.
Identify the interrupted step and any partial file changes.
Continue from the existing implementation without repeating completed work.
Run the relevant tests and commit only when the step is complete.
This works in both directions:
Claude Code interrupted -> generate snapshot -> Codex CLI continues
Codex CLI interrupted -> generate snapshot -> Claude Code continues
Do not run both agents simultaneously against the same working tree.
The script cannot recover:
- text that was never saved to disk;
- hidden model reasoning;
- an intention that was never written to a transcript, task, command, or file;
- the final seconds of a session if the CLI never flushed them to local storage.
It can still recover partial saved edits through Git and can often reconstruct the next step from the latest prompt, tool call, and agent message.
passationlive.md can contain excerpts from prompts, commands, diffs, and local source files. Review it before sharing or committing it. The script does not upload anything and does not make network requests.
Session storage formats are internal implementation details of Claude Code and Codex CLI and may change. Transcript extraction is therefore best effort; Git capture remains reliable as long as changes were saved to disk.
python3 tests/test_snapshot.pyThe test covers both handoff directions with simulated local transcripts, a partially modified tracked file, an unfinished untracked file, and commits from the current day.
MIT