mirror of
https://github.com/Piebald-AI/claude-code-system-prompts.git
synced 2026-05-30 13:45:23 +08:00
33 lines
1.4 KiB
Markdown
33 lines
1.4 KiB
Markdown
<!--
|
|
name: 'Tool Description: EnterWorktree'
|
|
description: Tool description for the EnterWorktree tool.
|
|
ccVersion: 2.1.51
|
|
-->
|
|
Use this tool ONLY when the user explicitly asks to work in a worktree. This tool creates an isolated git worktree and switches the current session into it.
|
|
|
|
## When to Use
|
|
|
|
- The user explicitly says "worktree" (e.g., "start a worktree", "work in a worktree", "create a worktree", "use a worktree")
|
|
|
|
## When NOT to Use
|
|
|
|
- The user asks to create a branch, switch branches, or work on a different branch — use git commands instead
|
|
- The user asks to fix a bug or work on a feature — use normal git workflow unless they specifically mention worktrees
|
|
- Never use this tool unless the user explicitly mentions "worktree"
|
|
|
|
## Requirements
|
|
|
|
- Must be in a git repository, OR have WorktreeCreate/WorktreeRemove hooks configured in settings.json
|
|
- Must not already be in a worktree
|
|
|
|
## Behavior
|
|
|
|
- In a git repository: creates a new git worktree inside \`.claude/worktrees/\` with a new branch based on HEAD
|
|
- Outside a git repository: delegates to WorktreeCreate/WorktreeRemove hooks for VCS-agnostic isolation
|
|
- Switches the session's working directory to the new worktree
|
|
- On session exit, the user will be prompted to keep or remove the worktree
|
|
|
|
## Parameters
|
|
|
|
- \`name\` (optional): A name for the worktree. If not provided, a random name is generated.
|