exit

Terminates the active Claude Code session gracefully upon user request.

3|Updated Jul 17, 2024
One-click install
npx skills add https://github.com/Castrozan/.dotfiles --skill exit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exit
Source: https://github.com/Castrozan/.dotfiles/tree/main/agents/skills/exit
Command: npx skills add https://github.com/Castrozan/.dotfiles --skill exit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures the current Claude Code session ends gracefully upon explicit user request, preventing abrupt termination and potential data loss.

Core Features & Use Cases

  • Graceful session termination: terminates the active Claude Code session safely upon explicit user request.
  • Fallback guidance: provides alternative commands (e.g., /exit or Ctrl+D) if termination is blocked.
  • Safety checks: verifies appropriate parent process before signaling termination.

Quick Start

Terminate the current Claude Code session safely when the user explicitly asks to end the session.

Frequently Asked Questions about exit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely terminate a Claude Code session to avoid abrupt data loss?

Graceful session termination is achieved by verifying the parent 'claude' process before sending a SIGTERM signal. This ensures a safe shutdown during interactive coding sessions, preventing data loss when you explicitly request to end the session.

What is graceful session termination in interactive CLI coding contexts?

Graceful session termination in interactive CLI coding contexts is the process of safely ending an active session by verifying the parent process before signaling. This prevents abrupt termination and ensures no unsaved work is lost during the shutdown sequence.

What happens if SIGTERM fails to end the Claude Code process?

If SIGTERM fails to end the process, this skill provides fallback guidance to manually terminate the session. You can issue the /exit command or use the Ctrl+D keyboard shortcut to close the interactive CLI session.

How do I check the parent process before sending SIGTERM in a CLI session?

Checking the parent process before sending SIGTERM involves verifying the active process is 'claude'. This safety check is automatically enforced by the termination logic to ensure the signal targets the correct interactive coding session.

Does Claude Code support graceful shutdown for interactive chat contexts?

Claude Code supports graceful shutdown for interactive chat contexts through explicit user requests. The termination process applies to both interactive coding sessions and chat contexts, enforcing a parent process check before sending the termination signal.