Hands a long Pi session off to a fresh one and keeps working. The summary and continuation are written to disk first, so the work resumes whether the session is replaced, restarted, or continued by a successor process.
Tool handoff · command /datcrazy-handoff
pi install npm:datcrazy-handoff
Already installed? Run pi update npm:datcrazy-handoff, then /reload in existing sessions.
Or straight from the public repo:
pi install git:github.com/puru991/datcrazy-handoff
Run it once without installing:
pi -e npm:datcrazy-handoff
A Pi session has one context window. When it fills up — or when work should run in a clean frame — the usual answer is "summarize, then start a new session by hand and paste the summary". That breaks unattended work: an agent running a long task stops and waits for a human.
handoff closes that gap. The session replaces itself with a fresh one
that starts on the continuation prompt, and the handoff record stays on disk for
review.
ctx.newSession, which Pi only hands to command handlers. The tool
dispatches its own command through the user-message path, which Pi runs
immediately — so it works even in a session where no slash command was ever typed.
| Command | What it does |
|---|---|
/datcrazy-handoff status | Pending swap, seed and last artifact |
/datcrazy-handoff list | Recent handoff artifacts for this folder |
/datcrazy-handoff resume | Arm a swap now from the pending seed or a named artifact |
/datcrazy-handoff cancel | Drop the pending swap and clear the seed |
A handoff never dead-ends. In order of preference:
A real command context is acquired and the session is replaced once the turn settles.
pi -p, --mode text|json, or a host that does not run
extension commands: a detached pi starts in the same folder with the
continuation as its prompt. Model, thinking level and tool setup carry over; the
parent's session does not. Chains cap at 25 restarts and log to disk.
The continuation waits on disk: /datcrazy-handoff resume, or the next session in that folder picks it up.
Handoffs stay inside the session's own folder — a root pointing
elsewhere is refused instead of silently moving work. Folder identity is
canonicalised, so C:/x/proj and C:\x\proj resolve to the
same continuation.
pi.datcrazy.co in a footer slot and announces itself once per installed version.datcrazy-remote: its datcrazy_handoff tool delegates here when this addon is installed.