Use a template that directly includes the repository name and the branch checked out. This makes finding and deleting the worktree directory if anything goes wrong a lot easier. Checkout the worktree directly in the temporary directory. With that `TEMP_DIR` becomes obsolete.