{"thread":{"id":"66158","subject":"Re: [PATCH v2 0/4] worktree: add lifecycle hooks","startedAt":"2026-08-11T20:27:01Z","lastAt":"2026-08-11T20:27:01Z","messageCount":1,"participants":["<Alexander G. Riccio>"],"isPatch":true,"patchVersion":2,"patchTotal":4},"messages":[{"id":"550326","messageId":"CAN3N+zmzKBt75Gue--FbGWDxFY7HKfmRXX6O0FmtMRNyEfCjog@mail.gmail.com","threadId":"66158","inReplyTo":null,"subject":"Re: [PATCH v2 0/4] worktree: add lifecycle hooks","fromName":"<Alexander G. Riccio>","fromEmail":"test35965@gmail.com","sentAt":"2026-08-11T20:26:23Z","receivedAt":"2026-08-11T20:27:01Z","isPatch":true,"body":"(Apologies for replying out of thread -- I have never commented on the\ngit mailing list before, and I found this discussion in the archive\nwhile looking into options for my own worktree hook needs)\n\nI have a concrete example of a motivating workflow, indeed using\nagentic development and proliferous worktrees. I figure it's worth\nwriting in to add support for this - I'm sure I'm not the only one out\nthere bumping into this problem in this current era, but git\ndevelopers can only know about it if we volunteer the information!\n\nFor me, I have disk space issues that relate from the interaction of\nXCode derived data and worktrees. It apparently uses the absolute path\nof the worktree for the per-project build state cache by default, and\nof course it by default stores a lot of this data out-of-worktree. I\nthink I can change this configuration, but it's worth also noting that\nabout a half dozen other related tools do similar things, and none of\nthem have any way to know when the concomitant worktree is removed or\npruned. When I remove a worktree manually, I already have a dedicated\nshell script to do cleanup like this, my script does a lot of very\nuseful things when it gets used!! The root problem remains, that we\ncannot reliably count on agents to remember to do things we tell them\nto do.\n\nCurrently, this means many gigabytes need to be cleaned up manually or\nagentically every day, which is annoying, time consuming, and wastes\nSSD writes.\n\nSadly, it seems like none of the third party tools will emit events\nwhen someone or some-thing calls `git worktree remove` or `git\nworktree prune`, so there's no solid way to implement this outside\nnative hooks expansions.\n\nSincerely,\nAlexander Riccio\n--\n\"Change the world or go home.\"\n\nIf left to my own devices, I will build more.\n"}]}