An Amp plugin that starts a new thread referencing the current one, so you can hand off context cleanly when a thread grows long without dragging the full token cost forward.
Adds a Handoff › Start command to the Amp command palette. When invoked it:
- Captures the current thread ID.
- Prompts you for a short goal for the new thread.
- Calls
amp threads handoff <id>under the hood to create a new thread that references the previous one. - Opens the new thread in a fresh terminal window
(
tmux/ iTerm / Terminal.app, in that order of preference), or falls back to opening it in the browser.
-
Make sure you have an Amp
pluginsdirectory:mkdir -p ~/.config/amp/plugins -
Drop
handoff.tsinto it:curl -fsSL https://raw.githubusercontent.com/jim-ampcode/handoff-plugin/main/handoff.ts \ -o ~/.config/amp/plugins/handoff.ts -
Restart Amp. The command should appear in the palette as Handoff › Start.
In any Amp thread, open the command palette and run Handoff › Start. Enter a one-line goal for the new thread and submit. A new terminal window will open running the handed-off thread.
amp threads handoff is occasionally flaky on the server side:
- The
--goalflag and stdin path can fail asymmetrically depending on the source thread. The plugin tries--goalfirst, then falls back to stdin. - Some source threads always fail with
text content blocks must be non-empty. This is a server-side issue the plugin can't fix; the error is surfaced to the user as-is.
MIT — see LICENSE.