session-handoff is a Codex / Claude skill for recovering and transferring local AI coding-agent sessions when a conversation is interrupted by rate limits, account switching, window switching, or tool switching.
It uses continues to read local session files and export a structured handoff Markdown file. The receiving agent can then continue from the exported file instead of starting from scratch.
Common situation:
- You are working in one Codex or Claude account.
- The conversation hits a rate limit or runs out of quota.
- You switch to another account, another window, or another tool.
- The new session cannot see the previous chat context.
This skill turns the previous local session into a portable handoff file with:
- session overview
- current state
- recent conversation
- tool activity
- modified files, when available
- original session path
- a ready-to-paste continuation prompt
.
├── README.md
├── CHANGELOG.md
├── VERSION
├── install.sh
├── scripts/
│ └── verify.sh
└── skill/
└── session-handoff/
├── SKILL.md
├── agents/openai.yaml
├── references/continues-usage.md
└── scripts/handoff.py
The runtime skill is only the skill/session-handoff/ folder. Documentation and release files stay outside the skill folder so the installed skill remains small.
Install continues first:
npm install -g continues
continues --versioncontinues requires Node.js >=22.5.0. If your default Node is older, install a newer Node or create a wrapper that runs continues with a compatible Node binary.
You also need local session files from at least one supported tool, such as:
- Codex:
~/.codex/sessions/ - Claude Code:
~/.claude/projects/
Clone the repository:
git clone https://github.com/SUNRNEHUI/session-handoff-skill.git
cd session-handoff-skillInstall for Codex:
./install.sh --codexInstall for both Codex and Claude:
./install.sh --allThe installer creates symlinks:
~/.codex/skills/session-handoff -> <repo>/skill/session-handoff
~/.claude/skills/session-handoff -> <repo>/skill/session-handoff
Using symlinks avoids drift between the Git checkout and installed skill.
Ask Codex or Claude:
帮我找另一个账号的最后一个 Codex 线程,生成交接文档
Or:
帮我找“修复某个 App 启动失败”那个线程,生成交接文档
The skill will search local sessions and export a Markdown file to:
~/Documents/Codex-Handoffs/
The output includes a continuation prompt like:
请先读取 <handoff.md>,按里面的 Current State、Recent Conversation、Tool Activity、Files Modified(如果有)、Session Origin 继续任务。不要从头开始。
Paste that prompt into the new account, window, or tool.
List recent Codex sessions:
continues list --source codex -n 10List recent Claude sessions:
continues list --source claude -n 10Export the best matching Codex session by query:
python3 skill/session-handoff/scripts/handoff.py \
--source codex \
--query "app launch failure" \
--preset standardExport a known session by id:
python3 skill/session-handoff/scripts/handoff.py \
--id <session-id> \
--preset standardShow matching candidates without writing a file:
python3 skill/session-handoff/scripts/handoff.py \
--source codex \
--query "app launch failure" \
--show-candidatesUse a custom output directory:
python3 skill/session-handoff/scripts/handoff.py \
--source claude \
--query "my project" \
--out-dir ~/DesktopThe skill passes these presets through to continues inspect:
| Preset | Use case |
|---|---|
minimal |
urgent, low-token recovery |
standard |
default handoff |
verbose |
complex debugging or multi-file work |
full |
high-risk long task where context loss is costly |
Each exported handoff is validated before the script reports success.
Required checks:
- file exists
- file is non-empty
- session id is present
Session OverviewexistsCurrent StateexistsRecent ConversationexistsSession Originexists
At least one detail section must also exist:
Tool ActivityFiles Modified
The command prints JSON with validation.ok: true when the handoff is structurally usable.
This repository was tested with real local Codex sessions before release. The public repository intentionally does not include raw session files, generated handoff files, or real local session ids.
Verification method:
- Export with the skill script.
- Export the same session with raw
continues inspect. - Compare the two files with
cmp.
Expected result:
cmp_exit=0
This proves the skill wrapper preserves the original continues output.
The skill reads local session files. It does not upload session content by itself.
Be careful before publishing or pasting generated handoff files. They may contain:
- local file paths
- recent prompts
- shell commands
- excerpts of tool output
- sensitive project context
Prefer sharing the handoff file path with a local agent instead of pasting the full file into chat.
continues not found
npm install -g continuescontinues complains about Node version
Install Node.js >=22.5.0, or create a wrapper that runs continues with a newer Node binary.
No matching session found
Try a broader query:
python3 skill/session-handoff/scripts/handoff.py --source codex --query appOr list candidates:
python3 skill/session-handoff/scripts/handoff.py --source codex --show-candidatesThe handoff differs from an older exported file
That usually means the source session kept receiving new turns. A handoff file is a snapshot of the source session at export time.
Run verification:
./scripts/verify.shThe verification checks:
- skill metadata validity
- Python syntax
- candidate search
- real handoff export against local sessions when available
MIT