Cool!,
This reminded me of my stalled efforts to do something clever with git, databases and uSync - from over a year ago.
https://forum.umbraco.com/t/development-delete-local-db-on-branch-switch/3244/10?u=kevinjump
resurrecting that with some Claude fangling (and poiting in at your post!). I got to this.
https://github.com/KevinJump/uSync.TreeBranch
basically, this detects branches and worktrees and then triggers the database rename/copy at start up in Umbraco (e.g before Umbraco loads the DB)
So if claude or something else creates a new branch or worktree, it creates a copy of the DB, sorts out ports and then uSync runs through it and adds all the settings/content/etc to it. and you (well Claude) just carries on.
I am not sure if this answers the exact same question as you asked, but its close - does require a (small) package 😞 , doesn't require claude hooks 🤷