feat(hook): close mailbox on SessionEnd

New SessionEnd plugin hook runs `claude-mailbox session-end`, which derives the session's auto-name from stdin and asks the daemon to delete the mailbox if it has no pending messages either direction. Renamed mailboxes are preserved (the auto-name no longer exists, so DELETE is a no-op). The daemon-side `SKIP_UPSERT_PATHS` prevents the request from auto-recreating the mailbox. Sweeper remains the safety net for sessions that exit ungracefully.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-05-22 09:39:29 +02:00
parent 7b58db771a
commit 1f7585152e
6 changed files with 150 additions and 1 deletions

View File

@@ -29,6 +29,16 @@
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "claude-mailbox session-end"
}
]
}
]
}
}