pi-move-session
v0.2.4
Published
Move a live Pi session to a different working directory without losing context and jump into the new session
Maintainers
Readme
Move Session for Pi (pi-move-session)
Losslessly move a live Pi session to a different working directory and jump into the new session. Useful when you need a session to move to a different working directory after it's already built up valuable context.
Install
From npm:
pi install npm:pi-move-sessionFrom the dot314 git bundle (filtered install):
{
"packages": [
{
"source": "git:github.com/w-winter/dot314",
"extensions": ["extensions/move-session.ts"],
"skills": [],
"themes": [],
"prompts": []
}
]
}Usage
/move-session <targetCwd>Supports ~ expansion (e.g. /move-session ~/code/my-project).
If your current /tree selection is not the session file's default branch tip, the extension warns before proceeding because that selection is not preserved yet.
How it works
- Forks the current session JSONL into the target cwd's session bucket via
SessionManager.forkFrom() - Clears the fork header's
parentSessionpointer - Tears down the parent's terminal state (Kitty keyboard protocol, bracketed paste, cursor visibility)
- Spawns a new
pi --session <fork>process in the target directory with inherited stdio - Trashes the old session file (via
trashif available; never permanently deletes) - Destroys the parent's stdin so it can't steal keypresses from the child
The parent process stays alive as an inert wrapper that forwards the child's exit code.
