Feature request: configurable branch naming for subagent worktrees
Problem
When using isolation: "worktree" on the Agent/Task tool, Claude Code generates branch names like worktree-agent-a5f404ec — these are auto-generated hashes that are meaningless when they show up in PR lists on GitHub.
When dispatching multiple parallel agents that each create PRs, the PR list becomes unreadable:
worktree-agent-a5f404ec chore(tests): remove __init__.py files
worktree-agent-ad5a91a1 refactor(tests): parametrize serial number tests
worktree-agent-aa2385bd refactor(tests): parametrize cloud platform tests
Current workaround
After an agent completes, manually push to a semantic branch name before creating the PR:
git push origin "origin/worktree-agent-XXXX:refs/heads/refactor/descriptive-name"
This is tedious when dispatching 6+ agents in parallel.
Proposed solution
Allow the Agent/Task tool to accept an optional worktree_branch (or similar) parameter that controls the branch name when isolation: "worktree" is set:
{
"description": "Parametrize serial number tests",
"isolation": "worktree",
"worktree_branch": "refactor/parametrize-serial-number-tests"
}
Alternatively, derive a slug from the description field (e.g., "Parametrize serial number tests" → agent/parametrize-serial-number-tests).
Additional context
- The
WorktreeCreatehook receives the auto-generatednamebut there's no way to influence what Claude Code passes as that name for subagent worktrees. - The
descriptionfield on the Agent tool already contains a human-readable summary that would work well as a branch name slug.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗