Skip to main content
LazyWorktree integrates with GitHub and GitLab to display PR/MR status, CI checks, and enable browser navigation.

Requirements

PR/MR integration requires the forge CLI tools:
Install and authenticate with your forge:
gh auth login

Linked PR/MR Display

The Status pane displays linked PR/MR information for each worktree:
  • PR/MR number (clickable in OSC-8 enabled terminals)
  • Title
  • Author
  • State (Open, Merged, Closed)
  • CI status (if available)

Example Display

PR #123: Add new feature
Author: @username
State: OPEN
CI: ✓ All checks passed
In terminals with OSC-8 hyperlink support (Kitty, WezTerm, iTerm2), click the PR/MR number to open in your browser.

View PR/MR in Browser

Press o to open the linked PR/MR in your browser. Behaviour by context:
Opens the PR/MR page in your default browser.
The editor is configured via the editor setting (default: $EDITOR, fallback to nvim).

PR/MR Status Refresh

Press r to refresh PR/MR data for the current worktree. This also refreshes:
  • CI status and checks
  • Divergence status (ahead/behind)
  • Git status and commit log
auto_refresh: true
refresh_interval: 10  # Seconds

Creating Worktrees from PRs/MRs

Press c and select “From open PR/MR” to:
  1. Fetch all open PRs/MRs
  2. Select from a list with titles and authors
  3. Create a worktree with automatic branch naming

Branch Naming Behaviour

LazyWorktree uses the PR’s branch name to maintain consistency.
# PR #123 by you with branch "feat-new-ui"
# Local branch: feat-new-ui
# Worktree name: pr-123-feat-new-ui (based on template)
If the requester identity cannot be resolved, LazyWorktree falls back to the PR branch name.

PR Branch Name Template

Customise PR/MR branch names via pr_branch_name_template:
pr_branch_name_template: "pr-{number}-{title}"

Template Placeholders

  • {number} - PR/MR number
  • {title} - Original sanitised PR/MR title
  • {pr_author} - PR author username
  • {generated} - AI-generated title (requires branch_name_script)

Prune Merged Worktrees

Press X to prune all merged worktrees. The prune operation:
  1. Refreshes PR/MR data from GitHub/GitLab
  2. Checks each worktree’s merge status
  3. Deletes worktrees with merged branches
  4. Removes orphaned worktree references
Prune results show:
  • Pruned: Number of merged worktrees deleted
  • Failed: Number of deletion failures
  • Orphans deleted: Removed invalid worktree references
Run prune regularly to keep your worktree list clean after merging PRs/MRs.

Disable PR/MR Integration

To disable all PR/MR fetching and display:
disable_pr: true
This is useful if:
  • You don’t use PRs/MRs
  • You work in a private environment without forge access
  • You want to reduce network calls
In terminals with OSC-8 support, PR/MR numbers are clickable hyperlinks. Supported terminals:
  • Kitty
  • WezTerm
  • iTerm2
  • foot
  • Ghostty
Fallback: Use o key to open PR/MR in browser on any terminal.

Build docs developers (and LLMs) love