Stop R Shiny App
Kill a running Shiny app started by /rshiny-run and close the browser tab.
Steps
- •
Read port from
~/.claude/rshiny-state/port.txt. If file doesn't exist: report "No app tracked. Run/rshiny-runfirst." - •
Check
lsof -ti:<PORT>for a running process. If nothing found: report "No process on port <PORT>." - •
Graceful shutdown:
bashPID=$(lsof -ti:<PORT>) && kill -15 $PID 2>/dev/null; sleep 2
- •
If still alive, force kill:
bashPID=$(lsof -ti:<PORT>) && kill -9 $PID 2>/dev/null
- •
Close the browser tab using
browser_tabswithaction: "close". Do NOT usebrowser_close- that closes the entire browser context and may destroy other tabs. - •
Report: "App stopped. Log preserved at
~/.claude/rshiny-state/shiny.log"