Summary
When using a skill (slash command) as a session-ending routine (e.g., /handover), there's no way to automatically exit the session after the skill completes. Currently, users must manually run /exit after the skill finishes.
Use Case
I use a custom /handover skill to save session notes to Obsidian before ending a session. Ideally, the session would auto-terminate after the handover completes, making it a single-step shutdown routine instead of two steps (/handover → /exit).
Proposal
Any of the following would solve this:
exitAfter option in skill definition — A flag in the skill config (e.g., exitAfter: true) that tells Claude Code to exit after the skill completes.
PostSkill hook event — A new hook event that fires after a skill finishes, allowing users to run arbitrary shell commands (including terminating the session).
--exit-after flag — A CLI flag or in-session option to signal that the current operation should be the last before exit.
Current Workaround
Run the skill, confirm completion, then manually type /exit. This works but adds an extra step to what should be a seamless shutdown routine.
Environment
Summary
When using a skill (slash command) as a session-ending routine (e.g.,
/handover), there's no way to automatically exit the session after the skill completes. Currently, users must manually run/exitafter the skill finishes.Use Case
I use a custom
/handoverskill to save session notes to Obsidian before ending a session. Ideally, the session would auto-terminate after the handover completes, making it a single-step shutdown routine instead of two steps (/handover→/exit).Proposal
Any of the following would solve this:
exitAfteroption in skill definition — A flag in the skill config (e.g.,exitAfter: true) that tells Claude Code to exit after the skill completes.PostSkillhook event — A new hook event that fires after a skill finishes, allowing users to run arbitrary shell commands (including terminating the session).--exit-afterflag — A CLI flag or in-session option to signal that the current operation should be the last before exit.Current Workaround
Run the skill, confirm completion, then manually type
/exit. This works but adds an extra step to what should be a seamless shutdown routine.Environment