Create and Link Worktrees
Create and link worktrees from GitHub issues and pull requests, fetch forked heads from a named remote, check out GitLab merge requests through actions, and use GitHub bulk creation.
Creating worktrees from issues
The quickest way to start on an issue is to create a worktree straight from it:
- Click the issues count in the toolbar to open the issues panel
- Find or search for the issue you want to work on
- Click the row (anywhere but the title), press Enter on it, or choose Create worktree from its ··· menu
- The Create worktree dialog opens with the issue already linked in its Issue row
That only happens for an open issue without a worktree. If one exists, the same click switches to it instead, and on a closed issue it opens the issue in your browser.
From an issue tracker
A project whose issues come from Jira, Linear or Beads has no issues panel to start from. Open the Create worktree dialog and pick the issue in its Issue row, which lists the tracker's issues with the same search and Open, Closed and All tabs as the Attach issue dialog. The row shows the tracker's key, such as ENG-42 or a bead id, instead of a number.
What gets auto-populated
- Branch name: generated from the issue number and title (for example
feature/issue-42-add-dark-mode). The prefix is inferred from the issue's labels first, then from keywords in its title:bugfix/for bugs and fixes,docs/,refactor/,chore/,test/andperf/for their labels, andfeature/otherwise. A branch prefix configured for the project goes in front. An issue from a tracker can bring its own branch name instead, used as is with no prefix: Jira's key and a slug of the title, Linear's suggested branch name, orbead/and the bead id. When there's no suggestion or it fails Daintree's branch-name check, Daintree generates the name as above. - Worktree path: filled in from your configured path pattern
- Base branch: the branch the project root has checked out, falling back to
mainormaster
Every field is editable before you create. If the branch name is already taken, Daintree picks a free one with a numeric suffix (feature/issue-42-add-dark-mode-2) rather than failing.
Assign to self
When your forge identity is known, the Issue row offers Assign to me. Turn it on and the issue is assigned to you as the worktree is created; the choice is remembered across sessions. A toast confirms Issue assigned with an Undo that unassigns it again, available for about five seconds. If the assignment fails, the worktree is still created and a warning offers Open issue so you can assign it on the forge.
Run a recipe on create
If you have recipes configured, you can pick one in the Recipe row to run when the worktree is created, so the agents you want are launched with the worktree. The dialog can also start a single agent with a first prompt once setup is ready; see Create a Worktree.
{{number}} variable in recipe prompts to insert the issue or PR number at launch time. One recipe then works for both issue-based and PR-based worktree creation. {{issue_number}} and {{pr_number}} are there when you need one specifically.Creating a worktree from a PR
You can create a worktree directly from a pull request. On an open PR without a worktree, clicking the row, pressing Enter, or choosing Create worktree from the ··· menu opens the dialog in a checkout mode titled Check out PR branch, with Check out as its primary button.
The branch comes from the PR's head. When that branch is already available locally, or as a remote-tracking branch on exactly one remote, Daintree uses it as the checkout target. Otherwise it fetches the PR head by number, using the ref shape the provider names (pull/N/head on GitHub, refs/merge-requests/N/head on GitLab) from the remote the PR belongs to. If that fetch fails too, the dialog shows Couldn't fetch the pull request's branch and keeps Check out disabled rather than creating a worktree that might not contain the PR. Fetch from the remote, then reopen the dialog.
On GitLab there is no merge request list inside Daintree to start from. An agent can still create the worktree from a merge request number: the worktree.createWithRecipe action accepts a pull request source and fetches its head the same way.
Bulk worktree creation
When you need worktrees for several issues or PRs at once, the bulk flow saves you from doing them one at a time. Selection happens in the GitHub issues and pull requests panel, so this is where the flow begins. GitLab projects don't have it.
Selecting items
Hover the state icon on any row and it turns into a checkbox. Click to select that item. Once one is selected, every row shows its checkbox and clicking a row toggles it, so you can keep going. Shift+click selects a range between the last selected item and the one you click. From the keyboard, Shift+Space toggles the highlighted row, and every row's ··· menu has Select as well.
The Select button beside the sort button picks a whole set in one step: Select all (N) (or Deselect all when everything is selected), Select unassigned (N) for issues, and Select without worktrees (N), which takes only open items that don't have a worktree yet. The counts are for the rows in the current tab and search.
Closing and reopening the panel within the same project keeps your selection intact, so a quick glance elsewhere doesn't lose it. Cancelling the bulk-create dialog before it runs keeps it too, so you can go back and finish picking. Switching projects clears the selection, and so does finishing a batch.
The bulk action bar
As soon as you select one or more items, the panel's footer becomes a bulk action bar. It shows how many are selected (for example 3 issues selected, with · 1 not shown when part of the selection is outside the current tab or search), a Create worktrees button, and an X to clear the selection.
Reviewing before creating
Clicking Create worktrees opens a dialog titled Create N worktrees. Its Setup section has an Assign to me checkbox naming your account (issues only) and a Recipe picker, if you want agents to launch in each new worktree. Under Worktrees to create, every selected item is listed with the branch name Daintree will create for it. Items that can't be created are dimmed with a badge explaining why:
- Closed or Merged: the issue or PR is no longer open
- Has worktree: a worktree already exists for this item
- No branch info: the PR is missing a head branch reference
Creation progress
Once you confirm, Daintree creates the worktrees three at a time. Each item shows its own state: a spinner and the current step while in progress (with a retry N badge when it is retrying), a check when done, or an error mark and the reason if something went wrong. A progress bar and a line such as 2 of 4 created · 1 failed track the batch. The concurrency limit sits at three because git worktree add --no-track avoids the .git/config.lock contention that used to block parallel operations, while the forge's own rate limiter stays the primary throttle.
Transient errors (git lock files, secondary rate limits, connection blips) are retried on a wall-clock budget, not an attempt count. Each item keeps retrying with exponential backoff (starting at 3 seconds, capped at 30, or 60 for the assignment call) until a five-minute per-item ceiling elapses. Five minutes is chosen deliberately: a GitHub secondary rate limit usually clears inside that window, and one that hasn't is a multi-hour penalty no in-process retry could outlast. Permanent errors fail immediately rather than burning the budget.
When creation finishes
As the batch ends, Daintree switches to the last worktree it created successfully, and the dialog's title becomes Creation complete (or Couldn't create worktrees if nothing succeeded). If any items failed, Retry failed re-queues only those and leaves already-created worktrees alone. Done closes the dialog and clears the selection.
Automatic issue detection
Daintree parses branch names to detect a linked issue. Five patterns are tried in priority order:
| Pattern | Example branch |
|---|---|
issue-42 | feature/issue-42-fix-header |
issue/42 or issues/42 | issues/123 |
#42 | fix-#88-crash |
gh-42 | bugfix/gh-15-login-bug |
jira-42 | jira-904-import |
Long-lived branches are skipped outright: a branch named main, master, develop, staging, production, release or hotfix (or prefixed with any of them followed by a slash) never matches, so a release/2026-04 branch doesn't pick up issue 2026. If the branch name yields nothing, Daintree tries the same patterns against the worktree's folder name.
When Jira or Linear is the project's issues provider, a branch containing the configured project or team key and a number as a whole token, in any case (ENG-42, eng-42-fix-login), links to that tracker issue. It's checked before the patterns above, against the branch and then the folder name, with the same long-lived branches skipped. Beads doesn't claim branch names. See Linear issues on worktrees.
When an issue is detected, the worktree card shows an issue badge with the number and title, and tracks the issue's open and closed state. Detection works the same on GitHub and GitLab.
Manual issue linking
If a worktree already exists and you want to link it to an issue after the fact, you can attach one by hand. This covers the case where you started work before an issue was filed, or where branch-name detection didn't match the right issue. It works with either forge, and with an issue tracker: the dialog lists issues from the project's issues provider.
- Right-click a worktree card, or click the ··· button in the card header, to open the context menu
- Select Linked work > Attach issue… (or Change linked issue… if an issue is already linked)
- The Attach issue dialog opens with a search field and state tabs
- Search by title or issue number, and use the Open, Closed, or All tabs to filter by state
- Select an issue from the list to attach it
The Attach issue dialog
- The search field filters by both title and issue number, with a short debounce so results update as you type. With an issue tracker, the search goes to the tracker, which decides what matches
- State tabs (Open, Closed, All) let you attach closed issues too. The filter resets to Open each time the dialog opens
- Keyboard navigation uses ↑ and ↓ to move through the list, and Enter to attach the selected issue
- The issue already linked to this worktree carries a Linked badge, and the dialog is titled Change linked issue
Detaching an issue
To remove a linked issue, choose Linked work > Unlink issue #N from the card menu. The dialog offers the same Unlink issue #N button while an issue is linked.
The same Linked work submenu also opens what is linked: Open issue #N and Open PR #N go to the forge, and View plan opens the worktree's plan when it has one.
Effect on the worktree card
When any issue is linked to a worktree, whether attached by hand or detected from the branch name, the worktree card updates:
- The issue title becomes the card's primary headline, replacing the branch name at the top
- The branch name moves to a secondary row below the headline
- Clicking the issue title opens the issue in your browser
- Hovering the issue title shows a card with title, description summary, labels, and state, fetched on hover
Persistence
Issue associations are stored in Daintree's local settings, not in your git repository. They survive app restarts, and they're cleaned up when you delete the worktree. Each worktree can have one attached issue at a time.
Automatic PR detection
Daintree checks whether each worktree's branch has a pull request (a merge request on GitLab), and re-checks when the branch changes, so a worktree that switches branches doesn't keep showing its old PR. The root worktree is excluded from branch-name matching, so it won't pick up a spurious PR badge when its branch happens to match a PR's head. When a PR exists:
- The worktree card shows a PR badge with a state glyph (open, draft, merged, or closed) and the number, or the PR's title when it is the card's headline. A CI mark follows when the PR has a status: passing, pending, failing, or neutral.
- A cloud-off glyph joins the badge while the forge is rate-limited or PR detection is paused, so a stale badge says so rather than looking current.
- Hovering fetches PR detail into a rich hover card.
- Clicking the badge opens the PR in your system browser. If no credential is stored for the provider, the click routes you to that provider's section of Settings > Code forge instead.
A branch with a remote but no PR gets no badge on the card. Review Hub is where No PR is spelled out.