Download src/tools/EnterWorktreeTool/prompt.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/chenbhao/codev/resolve/e91c8197c9918ff9e5df3140e8c36282bb30e9a2/src/tools/EnterWorktreeTool/prompt.ts
- Command line
-
hf download hf://chenbhao/codev@e91c8197c9918ff9e5df3140e8c36282bb30e9a2/src/tools/EnterWorktreeTool/prompt.ts
-
curl -L -o prompt.ts https://huggingface.co/chenbhao/codev/resolve/e91c8197c9918ff9e5df3140e8c36282bb30e9a2/src/tools/EnterWorktreeTool/prompt.ts
1.41 kB
| export function getEnterWorktreeToolPrompt(): string { | |
| return `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 | |
| - Use ExitWorktree to leave the worktree mid-session (keep or remove). On session exit, if still in the worktree, the user will be prompted to keep or remove it | |
| ## Parameters | |
| - \`name\` (optional): A name for the worktree. If not provided, a random name is generated. | |
| ` | |
| } | |