Help us improve
Share bugs, ideas, or general feedback.
From workspaces
Deletes a specified workspace and its git worktrees after checking repositories for uncommitted changes or unpushed commits, prompting confirmation if issues found.
npx claudepluginhub openshift-eng/ai-helpers --plugin workspacesHow this command is triggered — by the user, by Claude, or both
Slash command
/workspaces:delete <workspace-name>The summary Claude sees in its command listing — used to decide when to auto-load this command
## Name workspaces:delete ## Synopsis ## Description The `workspaces:delete` command removes a workspace directory and its associated git worktrees. Before deletion, it checks the status of all repositories in the workspace to detect uncommitted changes or unpushed commits, prompting the user for confirmation when issues are found. This command helps clean up task workspaces created by `/workspaces:create` while ensuring no work is accidentally lost. ## Implementation ### Workflow --- ## Step 1: Identify workspace and check configuration Get available workspaces (includes configu...
/deleteSafely deletes a Git worktree by name, checks for uncommitted changes with user confirmation, removes it, and optionally deletes the branch.
/remove-worktreeInteractively lists issue git worktrees, lets user select one, checks uncommitted changes and GitHub issue status, then removes it.
/clean-worktreesSafely removes specified git worktrees using `git worktree remove` without --force, relying on git's safety checks for clean state and pushed commits.
/cleanup-worktreesRemoves safe git worktrees for merged branches only (checked via git branch --merged and gh PRs), cleans orphans, categorizes kept ones, and generates a cleanup report.
/worktree-cleanupManually removes development track git worktrees after safety checks for uncommitted changes and unpushed commits. Supports specific track or --all to also delete merged branches.
/worktree-cleanCleans finished git worktrees by removing directories for safe (merged, no uncommitted changes) ones, pruning references, and reporting removed/kept items.
Share bugs, ideas, or general feedback.
workspaces:delete
/workspaces:delete <workspace-name>
The workspaces:delete command removes a workspace directory and its associated git worktrees. Before deletion, it checks the status of all repositories in the workspace to detect uncommitted changes or unpushed commits, prompting the user for confirmation when issues are found.
This command helps clean up task workspaces created by /workspaces:create while ensuring no work is accidentally lost.
- [ ] Step 1: Identify workspace and check configuration
- [ ] Step 2: Execute deletion
Get available workspaces (includes configuration check):
${CLAUDE_PLUGIN_ROOT}/commands/delete/list.sh
If the output contains STATUS: NOT_CONFIGURED:
Use AskUserQuestion to ask the user for:
/home/user/git-repos or ~/work/repos)/home/user/workspaces or ~/dev/workspaces)Run list again with the user's paths:
${CLAUDE_PLUGIN_ROOT}/commands/delete/list.sh --repos-root <REPOS_PATH> --workspaces-root <WORKSPACES_PATH>
Verify the output shows CONFIGURATION SAVED before proceeding to Step 2
Match user's input against the workspace list:
Use the workspace NAME (not full path) from Step 1.
Example: If the workspace is at /home/user/workspaces/feature-azure-template-field, use feature-azure-template-field (not the full path).
Execute the deletion script:
${CLAUDE_PLUGIN_ROOT}/commands/delete/execute.sh {WORKSPACE_NAME}
The script will:
Case A: Exit code 0 (success)
The workspace was clean and has been deleted successfully. Report completion to user.
Case B: Exit code 2 (user input required)
The workspace has uncommitted changes or unpushed commits. The status has already been displayed to the user.
Use AskUserQuestion with these options:
Then execute based on user's choice:
If user chose "Keep branches":
${CLAUDE_PLUGIN_ROOT}/commands/delete/execute.sh {WORKSPACE_NAME} --keep-branches
If user chose "Delete branches":
${CLAUDE_PLUGIN_ROOT}/commands/delete/execute.sh {WORKSPACE_NAME} --delete-branches
If user chose "Abort":
Case C: Exit code 1 (error)
An error occurred (e.g., workspace not found, configuration issue). Report the error to the user.