Skip to content

jim-ampcode/handoff-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Handoff Plugin for Amp

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.

What it does

Adds a Handoff › Start command to the Amp command palette. When invoked it:

  1. Captures the current thread ID.
  2. Prompts you for a short goal for the new thread.
  3. Calls amp threads handoff <id> under the hood to create a new thread that references the previous one.
  4. 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.

Install

  1. Make sure you have an Amp plugins directory:

    mkdir -p ~/.config/amp/plugins
  2. Drop handoff.ts into it:

    curl -fsSL https://raw.githubusercontent.com/jim-ampcode/handoff-plugin/main/handoff.ts \
      -o ~/.config/amp/plugins/handoff.ts
  3. Restart Amp. The command should appear in the palette as Handoff › Start.

Usage

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.

Known issues

amp threads handoff is occasionally flaky on the server side:

  • The --goal flag and stdin path can fail asymmetrically depending on the source thread. The plugin tries --goal first, 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.

License

MIT — see LICENSE.

About

Amp plugin: start a new thread that hands off context from the current one

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors