One Runner, Many Worktrees

A runner can now create Git worktrees. Pick a repository the runner serves, hit Tab, name the branch, and the thread starts in a fresh checkout. Your main checkout stays untouched.

The new thread composer on ampcode.com with the runner mac-mini selected and the directory picker open. The amp repository is highlighted and offers Current or New Worktree.

In the directory picker, every Git checkout on the runner gets a New Worktree option next to it. Choose it and you get a small form:

The worktree form in the new thread composer: New worktree of amp, name fix-flaky-login-test, directory ~/code/amp-fix-flaky-login-test, branch fix-flaky-login-test, from current HEAD, and a Create Worktree button

The name you chose becomes the branch name and the folder name. The runner then creates the worktree as a sibling of the repository: ~/code/amp gets ~/code/amp-fix-flaky-login-test, checked out on a new branch fix-flaky-login-test off the current HEAD. Uncommitted changes stay where they are, in the original checkout. The new directory shows up in the picker right away, marked with a branch icon, and the thread starts in it.

Puck can do this too: ask it to start a thread on your runner in a new worktree and it passes a worktree name to create_thread.

Clean Up When You're Done

A thread that runs in a worktree the runner created gets a new action: Archive and Remove Worktree. It archives the thread, runs git worktree remove, and deletes the branch.

The thread actions menu on ampcode.com with a new entry, Archive and Remove Worktree, between Archive and Delete

New Folders and Projects Too

The picker can also create things. Type the name of a directory that doesn't exist yet and you get New Directory or New Project. Read more.

The directory picker in the new thread composer with a name typed that doesn't exist yet, offering New Directory and New Project

Oh, They Understand Secrets Now Too

Runners can also use the Secrets & Env Vars you configure on ampcode.com. Same variables that orbs get. It's off by default; opt in with --amp-env:

$ amp --no-tui --runner-id mac-mini --discover-dirs --amp-env

Every time a thread starts, the runner fetches the variables that apply to it (personal, then project, then workspace) and adds them to the environment of the thread's shell commands, MCP servers, and plugins. Change a variable on ampcode.com and the next thread gets the new value. No restart, no SSH.

Both need a runner on the current Amp version. If yours has been running for a while, it has updated itself already.

Read more about worktrees and Secrets & Env Vars in the runner docs.