Feature request: Auto-exit after skill/command completion
Resolved 💬 3 comments Opened Feb 6, 2026 by b1010186 Closed Mar 30, 2026
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:
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
- Claude Code CLI
- macOS
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗