Skip to main content
LazyWorktree offers multiple creation modes to fit different workflows. Press c to open the creation menu.

Creation Options

1

Select Creation Mode

Choose from:
  • From current branch (with/without uncommitted changes)
  • Checkout existing branch or create new
  • From GitHub/GitLab issue
  • From open PR/MR
2

Configure Options

Depending on the mode, configure:
  • Branch name (manual or AI-generated)
  • Base branch
  • Include uncommitted changes (checkbox)
3

Create Worktree

Confirm to create the worktree in ~/.local/share/worktrees/<org>-<repo>/<name>

From Current Branch

Create a new worktree from your current branch with optional uncommitted changes.

Without Uncommitted Changes

Creates a clean worktree from the current branch HEAD:
1

Press `c`

Open creation menu
2

Select 'From current branch'

Choose the first option
3

Enter branch name

Type the new branch name (or use AI-generated suggestion)
4

Uncheck 'Include uncommitted changes'

Leave checkbox unchecked for a clean worktree

With Uncommitted Changes

Creates a worktree and carries over your uncommitted changes:
1

Press `c`

Open creation menu
2

Select 'From current branch'

Choose the first option
3

Enter branch name

Type the new branch name
4

Check 'Include uncommitted changes'

Tick the checkbox to copy uncommitted changes
Uncommitted changes are copied using git stash and git stash pop internally.

Checkout Existing Branch or Create New

Select from existing branches or create a new branch from any base.
1

Press `c`

Open creation menu
2

Select 'Checkout existing branch'

Browse available branches
3

Choose branch

Select from local and remote branches

From GitHub/GitLab Issue

Create a worktree from an issue with automatic branch naming.
1

Press `c`

Open creation menu
2

Select 'From GitHub/GitLab issue'

LazyWorktree fetches open issues
3

Choose issue

Select from the list of open issues
4

Branch name generated

Automatic branch name: issue-{number}-{title}
issue_branch_name_template: "issue-{number}-{title}"

Template Placeholders

  • {number} - Issue number
  • {title} - Original sanitised issue title
  • {generated} - AI-generated title (if branch_name_script configured)
Configure worktree_note_script to automatically generate implementation notes from the issue description.

From Open PR/MR

Create a worktree from an open pull request or merge request.
1

Press `c`

Open creation menu
2

Select 'From open PR/MR'

LazyWorktree fetches open PRs/MRs
3

Choose PR/MR

Select from the list with titles and authors
4

Branch handling

  • You’re the author: Uses PR branch name
  • Different author: Uses generated worktree name
pr_branch_name_template: "pr-{number}-{title}"

Template Placeholders

  • {number} - PR/MR number
  • {title} - Original sanitised PR/MR title
  • {pr_author} - PR author username (PR templates only)
  • {generated} - AI-generated title (if branch_name_script configured)
PR/MR creation requires gh CLI for GitHub or glab CLI for GitLab.

AI-Generated Branch Names

Configure branch_name_script to automatically generate meaningful branch names.
branch_name_script: "aichat -m gemini:gemini-2.5-flash-lite 'Generate a short title for this PR or issue. Output only the title (like feat-session-manager), nothing else.'"

Environment Variables

The script receives:
  • LAZYWORKTREE_TYPE - pr, issue, or diff
  • LAZYWORKTREE_NUMBER - Issue/PR number
  • LAZYWORKTREE_TEMPLATE - The configured template
  • LAZYWORKTREE_SUGGESTED_NAME - Default suggested name
Smaller, faster models like gemini-2.5-flash-lite work well for branch name generation.

Automatic Worktree Notes

Configure worktree_note_script to generate initial notes when creating from PR/MR or issue.
worktree_note_script: "aichat -m gemini:gemini-2.5-flash-lite 'Summarise this ticket into practical implementation notes.'"
The script receives the issue/PR title and body on stdin and can output multiline notes.

Environment Variables

  • LAZYWORKTREE_TYPE - pr or issue
  • LAZYWORKTREE_NUMBER - Issue/PR number
  • LAZYWORKTREE_TITLE - Issue/PR title
  • LAZYWORKTREE_URL - Issue/PR URL
If the script fails or outputs nothing, creation continues without a note.

Build docs developers (and LLMs) love