From 25c05bc2d880a9f6c13cab0b832732f9a1e02eba Mon Sep 17 00:00:00 2001 From: Janis Date: Fri, 5 Jun 2026 11:15:06 +0200 Subject: [PATCH] chore(commands): fix ExitWorktree cleanup + ignore worktrees dir Pass discard_changes: true so cleanup succeeds after branch is pushed. Add .claude/worktrees/ to .gitignore. Co-Authored-By: Claude Sonnet 4.6 --- .claude/commands/fix-defect.md | 3 ++- .claude/commands/implement-feature.md | 3 ++- .gitignore | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.claude/commands/fix-defect.md b/.claude/commands/fix-defect.md index 9f744f4..a6343b1 100644 --- a/.claude/commands/fix-defect.md +++ b/.claude/commands/fix-defect.md @@ -122,5 +122,6 @@ Call `mcp__youtrack__link_issues` for each confirmed link. ## Step 8 — Cleanup -Call `ExitWorktree` to delete the worktree. +Call `ExitWorktree` with `discard_changes: true` to delete the worktree. +(Branch was pushed in step 6 — commits are safe on remote; `discard_changes: true` bypasses the local-ahead guard.) Report: branch pushed, ticket commented, links created, worktree deleted, done. diff --git a/.claude/commands/implement-feature.md b/.claude/commands/implement-feature.md index 51eae30..28a7dec 100644 --- a/.claude/commands/implement-feature.md +++ b/.claude/commands/implement-feature.md @@ -83,5 +83,6 @@ Files changed: ## Step 8 — Cleanup -Call `ExitWorktree` to delete the worktree. +Call `ExitWorktree` with `discard_changes: true` to delete the worktree. +(Branch was pushed in step 6 — commits are safe on remote; `discard_changes: true` bypasses the local-ahead guard.) Report: branch pushed, ticket commented, worktree deleted, done. diff --git a/.gitignore b/.gitignore index 8113cf5..5f62f11 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ graphify-out/ .DS_Store /jacoco-reporter/.venv/ /.claude/settings.local.json +/.claude/worktrees/