Claude Autoshutdown banner
kamiljan11 kamiljan11

Claude Autoshutdown

Development community

Description

Shut down Windows only after every Claude Code session and its subagents have really finished. Reads agent turn state instead of guessing from CPU, 14 safety gates, no UAC prompt. Python + Tkinter, zero runtime dependencies.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude AutoShutdown — shut down Windows only after every Claude Code session has really finished

Leave your AI agents running overnight and let the machine turn itself off — but only once **every** Claude Code / Cowork session, including its subagents, has genuinely stopped working.

A small Windows desktop app (Python + Tkinter, **no third-party runtime dependencies**) that watches Claude Code sessions and triggers shutdown, hibernate, sleep or lock when they are all idle. Built for unattended overnight agent runs.

[![Python](https://img.shields.io/badge/python-3.14-blue)](https://www.python.org/) [![Platform](https://img.shields.io/badge/platform-Windows-lightgrey)](#requirements) [![Tests](https://img.shields.io/badge/tests-105%20passing-brightgreen)](#tests) [![Dependencies](https://img.shields.io/badge/runtime%20deps-none-brightgreen)](#requirements) [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)

![Claude AutoShutdown monitoring live Claude Code sessions](docs/monitor.png)

The UI is currently in Polish. The screenshot above reads: *Live Claude sessions* — state (WORKING / IDLE), session, directory, **why**, silence, CPU, subagents, PID — and below, *Shutdown conditions (all must be green)*. English localisation is not done yet; PRs welcome.


The problem

You start a long agent run, go to sleep, and want the PC off when it's done. Every naive approach gets this wrong in a way that either **kills work in progress** or **never fires at all**:

Naive signal Why it fails
"No CPU usage" An idle Claude Code session and a working one occupy the same CPU range — measured below
"Log file hasn't changed in N minutes" During /compact or an API rate-limit wait the transcript is frozen for minutes while the agent is very much alive
"The process exited" Sessions stay resident between turns; the process living tells you nothing
"Window title / focus" Says nothing about background subagents