Skip to content

Add worktree create/remove hook scripts#57

Merged
hifi-phil merged 2 commits intodevfrom
feature/worktree-hooks
Apr 21, 2026
Merged

Add worktree create/remove hook scripts#57
hifi-phil merged 2 commits intodevfrom
feature/worktree-hooks

Conversation

@hifi-phil
Copy link
Copy Markdown
Contributor

Summary

  • Registers WorktreeCreate and WorktreeRemove hooks in .claude/settings.json that shell out to scripts/worktree-create.sh and scripts/worktree-remove.sh.
  • New worktrees branch off origin/dev (falling back to main/master), copy .env, and — when a demo-site/ is present — provision an isolated SQL Server database and rewrite launchSettings.json to use dynamic ports. Remove tears the database and worktree down.
  • Adds .claude/worktrees/ to .gitignore and ships a .worktreeinclude stub listing files the create script copies in.

Test plan

  • EnterWorktree a fresh slug and confirm the worktree appears under .claude/worktrees/<slug> on a new feature/<slug> branch.
  • Confirm .env is copied into the new worktree when one exists at the repo root.
  • ExitWorktree and confirm the worktree + branch are cleaned up.
  • On a checkout that also has demo-site/, confirm the SQL Server DB umbraco-mcp-editor-<slug> is created on enter and dropped on exit.

🤖 Generated with Claude Code

hifi-phil and others added 2 commits April 21, 2026 14:23
Registers WorktreeCreate and WorktreeRemove hooks in .claude/settings.json
that call scripts/worktree-create.sh and scripts/worktree-remove.sh, so
Claude Code worktrees get a fresh branch off dev/main, the .env copied in,
an isolated SQL Server database for demo-site when present, and cleanup
on removal. Adds .claude/worktrees/ to .gitignore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Project-level allow list isn't needed by the worktree hooks and several
entries (demo-site pkill, dotnet build/run) were specific to another
repo. Keep project settings hook-only; leave permission allowlisting to
user-level settings.local.json.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hifi-phil hifi-phil merged commit 3a166a8 into dev Apr 21, 2026
7 checks passed
@hifi-phil hifi-phil mentioned this pull request Apr 22, 2026
4 tasks
hifi-phil added a commit that referenced this pull request Apr 22, 2026
  - Existing-instance init: {url, user, password} prompts + E2E testing (#58, #59)
  - Ship .mcp.json with scaffolded projects so they're testable in Claude Code out of the box (#55, #56)                                                                                                                                                 
  - Add worktree create/remove hook scripts (#57)
@hifi-phil hifi-phil deleted the feature/worktree-hooks branch April 27, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant