You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
I work on a database-backed webapp and want to set up dedicated test databases when I open a new workspace (in OpenCode desktop, mac) - I can do this with a shell script that I configure to run as a Workspace startup script. However, when I wrap up a workspace it leaves the database behind.
I'd love a "Workspace delete script" option that would let me hit a cleanup script before the worktree is removed, so I can keep my environment clean.
This issue might be a duplicate of existing issues. Please check:
[FEATURE]: Expose worktree lifecycle events (created, removed, reset) to plugins #15680: [FEATURE]: Expose worktree lifecycle events (created, removed, reset) to plugins — this issue also addresses the need to run cleanup (like tearing down dev servers, DB branches) when a worktree is removed, and proposes lifecycle events that could be used to trigger such scripts.
I've started to work on something but I am definitely not confident about having the time to finish. Like we have the startup script in project settings, having a shutdown script is what I planed.
Activity
github-actions commentedon Mar 13, 2026
This issue might be a duplicate of existing issues. Please check:
jamie commentedon Mar 13, 2026
Agree #15680 is foundational (core) work, I'm specifically requesting that once the support is there that it be surfaced to the desktop app UI.
jacquesbh commentedon Mar 25, 2026
I've started to work on something but I am definitely not confident about having the time to finish. Like we have the startup script in project settings, having a shutdown script is what I planed.
I can share what I have started.
mikew commentedon Jun 29, 2026
I just commented on #15680 but yes, a text field next to "Workspace startup script" is what I'm actually after.
github-actions commentedon Aug 29, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.