worktree.baseRef: "head" resolves to main worktree HEAD, not CWD worktree HEAD

Resolved 💬 1 comment Opened May 27, 2026 by johnstegeman Closed May 28, 2026

Summary

When a Claude Code session is running inside a linked/superset worktree (not the main worktree checkout), subagents created via the Agent tool always branch their new worktrees from the main worktree's HEAD rather than the current session's HEAD — even when \worktree.baseRef\ is set to \\"head\"\.

Setup

  • Main repo: \~/Projects/my-repo\ — checked out on \main\
  • Session running in: \~/.superset/worktrees/<id>/feature-branch\ — a linked worktree of the same repo, checked out on \feature-branch\
  • \.claude/settings.json\ in both locations:

\\\json
{ "worktree": { "baseRef": "head" } }
\
\\

Expected behaviour

Subagent worktrees branch from \feature-branch\ (the HEAD of the current session's working directory).

Actual behaviour

Subagent worktrees branch from \main\ (the HEAD of the main worktree at \~/Projects/my-repo\). The subagent cannot see any commits on \feature-branch\ that haven't been merged to \main\.

Impact

Any multi-agent workflow (e.g. hone:run) running from a linked worktree will have subagents working from a stale base. In this case a subagent re-implemented tasks already committed on the feature branch because it couldn't see them.

Workaround

Manually check out the feature branch in the main worktree before launching subagents, so \baseRef: "head"\ resolves correctly.

Expected fix

\baseRef: "head"\ should resolve to the HEAD of the current working directory's git context, not the HEAD of the main worktree checkout.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗