restart-webapp
Safely restart the current project's webapp and verify the new build is live.
SKILL.mdskills/restart-webapp/SKILL.md
GitHub/restart-webapp
Restart the webapp for the current project (based on cwd), then confirm the new build is serving.
What this does
This invokes ~/.claude/hooks/restart_and_verify_webapp.py, which:
- Detects the project from the current working directory (looks it up in
~/.claude/hooks/projects.toml). - Reads the project's
webapp_port,restart_cmd, andtray_cmdfromprojects.toml. - Kills only the PID listening on
webapp_port— never blanket-killspython.exe. Sister hubs on[global].never_kill_ports(8000 LLM hub, 8090 whisper, 8446 session-host) are never touched. - Brings the webapp back. For the tray-owned apps (app-launcher, photo-ocr, voice-transcriber) the webapp is a uvicorn child of a long-lived
launcher.py tray, and an idempotenttray.batno-ops while that tray lives — so those projects declare arestart_cmdthat respawns a fresh uvicorn through the app'sWebappManager(which the tray adopts), never touching the:8446session-host. A just-killed port can linger inTIME_WAIT, so the respawn settles and retries. Projects without arestart_cmdfall back to runningtray_cmd(tray.bat). - Polls
<api_version_path>(default/api/version) untilgit_shamatchesgit rev-parse HEAD. - Reports the new
asset_hashso I know the build I'm looking at is the one I just shipped. On an unrecoverable failure it prints the manual-recovery commands instead of a barenothing listening.
Exit codes: 0 the live git_sha was read and matches HEAD · 1 the project isn't in projects.toml · 2 the kill/restart failed, or the live build never converged to HEAD · 3 UNCONFIRMED — the webapp is up but its build identity could not be established (HEAD unreadable, or the version payload carries no git_sha). 3 is not a success: report it as "restarted, build identity unverified" and say which build is live is unknown — never as a verified restart (fleet-config#562).
How to invoke it
Run this from the project root (so cwd resolves to the right project in projects.toml):
& E:/automation/fleet-config/.venv/Scripts/python.exe "C:/Users/rober/.claude/hooks/restart_and_verify_webapp.py"
Report the script's output verbatim — the user wants to see the build line (git_sha=... asset_hash=...) before considering the restart done. If the script exits non-zero, surface the stderr and stop.
When NOT to use this
- During a long debug loop where the user is iterating on backend code and watching logs — restarting yanks their session.
- For projects that aren't registered in
projects.toml— add them first (or use the manual ritual for one-off projects).