Search the documentation
7 pages for worktreeremove.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Intercept and control agent behavior with hooks
Claude Code CLI · in the page
agent-sdk/hooks
…| | `WorktreeRemove` | No | Yes | Git worktree removed…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…lt" | "ConfigChange" | "DirectoryAdded" | "WorktreeCreate" | "WorktreeRemove" | "InstructionsLoaded" | "CwdChanged" | "FileChanged" | "MessageDisplay"; ``` ### `HookCallback` Hook ca…
Manage multiple agents with agent view
Claude Code CLI · in the page
agent-view
…s before discarding them. For a hook-created directory it runs your [`WorktreeRemove` hook](/docs/en/hooks#worktreeremove) instead, and without one it refuses the delete and keeps the session. * `clau…
Hooks reference
Claude Code CLI · in the page
hooks
…branch from PermissionRequest for auto-mode denials, WorktreeCreate, WorktreeRemove, Notification, ConfigChange, InstructionsLoaded, CwdChanged, FileChanged, and DirectoryAdded as standalone async ev…
Automate actions with hooks
Claude Code CLI · in the page
hooks-guide
…| | `WorktreeRemove` | When a worktree is being removed at session exit, when a subagent finishes, or when you delete a background…
Plugins reference
Claude Code CLI · in the page
plugins-reference
…| | `WorktreeRemove` | When a worktree is being removed at session exit, when a subagent finishes, or when you delete a background…
Run parallel sessions with worktrees
Claude Code CLI · in the page
worktrees
…rforce, Mercurial, or other systems, configure [`WorktreeCreate` and `WorktreeRemove` hooks](/docs/en/hooks#worktreecreate) to provide custom creation and cleanup logic. Because the hook replaces the…