worktree.baseRef: "head" creates worktree from default branch (main) instead of current branch

Resolved 💬 3 comments Opened May 21, 2026 by pinsdev Closed May 24, 2026

Summary

When worktree.baseRef is set to "head" in .claude/settings.local.json, new worktrees are created from the repository's default branch (main) instead of the user's current working branch.

Expected behavior

Per the schema description:

'head' branches from your current local HEAD so unpushed commits and feature-branch state are present.

When working on branch develop, a new worktree should be created from develop's HEAD.

Actual behavior

The worktree is created from main regardless of the current branch. Verified by comparing the worktree branch tip with main:

git log --oneline -3 claude/elated-darwin-16dfbc
# 27be31e chore(prod): sync from develop   ← identical to main tip

git log --oneline -3 main
# 27be31e chore(prod): sync from develop   ← same commit

The merge-base of the new worktree branch with develop was an older commit, not the current HEAD of develop.

Steps to reproduce

  1. Set up a repo with main and develop branches (develop is ahead of main)
  2. Set "worktree": { "baseRef": "head" } in .claude/settings.local.json
  3. Check out develop
  4. Enable the worktree checkbox in the Claude Code UI
  5. Observe that the new claude/<name> branch starts from main's HEAD, not develop's HEAD

Configuration

"worktree": {
  "baseRef": "head"
}

Additional context

  • Only two values are accepted by the schema: "fresh" and "head"
  • Both values appear to result in worktrees based on main (the default branch)
  • "fresh" is described as branching from origin/<default-branch> — so the difference between "fresh" and "head" is unclear if both point to main
  • No global settings override was present (~/.claude/settings.json had no worktree key)

Suggestion

Either fix "head" to use the actual current branch's HEAD, or add a third option (e.g. "branch") that explicitly uses the current working branch.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗