self-terminate

Send SIGINT to the Claude parent process after validating git state.

3|1|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/nsheaps/ai-mktpl --skill self-terminate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: self-terminate
Source: https://github.com/nsheaps/ai-mktpl/tree/main/plugins/self-terminate/skills/self-terminate
Command: npx skills add https://github.com/nsheaps/ai-mktpl --skill self-terminate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a safe, repeatable way to terminate a running Claude Code session by sending a SIGINT to the Claude process so the agent can perform a graceful shutdown instead of abrupt termination.

Core Features & Use Cases

  • Graceful shutdown: Sends SIGINT (or SIGTERM as an alternative) to the parent Claude process to allow cleanup and orderly exit.
  • Pre-shutdown validation: Runs automatic git state checks to block termination if there are uncommitted changes, unpushed commits, or untracked files.
  • Multi-environment support: Works for local CLI sessions and remote Claude Code Web sessions with environment detection and stop-hook integration.

Quick Start

Run the plugin's self-terminate script to send SIGINT to the Claude process and gracefully end the session.

Frequently Asked Questions about self-terminate

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

FAQPage Schema
How do I gracefully shut down a Claude Code session without losing uncommitted git changes?

You can gracefully end a Claude Code session by sending a SIGINT signal to the parent process, which triggers an orderly shutdown instead of an abrupt exit. This enforces pre-shutdown validation to ensure there are no uncommitted changes, unpushed commits, or untracked files before terminating.

What is the safest way to terminate a Claude Code process after making configuration changes?

The safest termination method after configuration changes is sending a SIGINT signal to the Claude parent process. This triggers a graceful shutdown that verifies the parent process identity and enforces a clean git state, preventing data loss from abrupt termination.

Does graceful termination of Claude Code work for both local CLI and Web sessions?

Yes, graceful termination applies to both local CLI and Claude Code Web sessions. The process detects the specific environment and utilizes stop-hook integration to send the SIGINT signal for an orderly shutdown across both local and remote platforms.

Why does my Claude Code session termination get blocked by git checks?

Termination is blocked by pre-shutdown validation to prevent data loss. The enforcement checks for a clean git state, halting the SIGINT signal if uncommitted changes, unpushed commits, or untracked files are detected in the local repository before allowing the session to end.

Can I use SIGTERM instead of SIGINT to end a Claude Code session?

Yes, SIGTERM can be used as an alternative to SIGINT for ending a Claude Code session. Both signals trigger a graceful shutdown by prompting the agent to perform cleanup and exit orderly, rather than terminating the process abruptly.