Skip to content

feat: add worktree option to ClaudeAgentOptions#681

Open
Mng-dev-ai wants to merge 1 commit intoanthropics:mainfrom
Mng-dev-ai:feat/add-worktree-option
Open

feat: add worktree option to ClaudeAgentOptions#681
Mng-dev-ai wants to merge 1 commit intoanthropics:mainfrom
Mng-dev-ai:feat/add-worktree-option

Conversation

@Mng-dev-ai
Copy link
Copy Markdown
Contributor

Summary

  • Add worktree option to ClaudeAgentOptions (bool | str | None) to support the --worktree CLI flag
  • When True, creates a git worktree with an auto-generated name
  • When a string, creates a worktree with the specified name
  • Maps to the CLI's -w, --worktree [name] flag

Test plan

  • test_build_command_with_worktree_bool — verifies --worktree flag without name
  • test_build_command_with_worktree_name — verifies --worktree my-feature with name
  • All 160 existing tests pass
  • Lint, format, and typecheck pass (no new errors)

@Mng-dev-ai Mng-dev-ai force-pushed the feat/add-worktree-option branch from 2df4ba2 to c7b424b Compare March 15, 2026 07:08
@Mng-dev-ai Mng-dev-ai closed this Mar 15, 2026
@Mng-dev-ai Mng-dev-ai reopened this Mar 15, 2026
Support the --worktree CLI flag for creating git worktrees per session.
Accepts True for auto-generated names or a string for explicit naming.
@Mng-dev-ai Mng-dev-ai force-pushed the feat/add-worktree-option branch from c7b424b to a10ea61 Compare March 15, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant