Loading...
Loading...
End-to-end Cursor IDE restart on the user's MacBook: snapshot metrics, kill ALL Cursor processes, relaunch Cursor, report before/after memory. Recovers from the known renderer memory leak that makes Cursor lag. Manual-only — run ONLY when the user explicitly invokes it (/nuke-cursor-app, "nuke cursor"). Differentiator: kills the Cursor desktop app; cursor-cli sessions are unrelated.
npx skill4agent add davidondrej/skills nuke-cursor-app/Applications/Cursor.app/Contents/MacOS/Cursor/Applications/Cursor.app/Applications/Cursor.appCursorUIViewServicecursor-metrics.sqlite3sqlite3 -readonlyDB="$HOME/Library/Application Support/<metrics-collector>/cursor-metrics.sqlite3"
LOG_DIR="$HOME/Library/Application Support/<metrics-collector>/nuke-logs"
mkdir -p "$LOG_DIR"
LOG="$LOG_DIR/$(date +%Y-%m-%d-%H%M).md"
# Live per-process readout — these are the "before" numbers
ps -axo pid,rss,comm | grep "/Applications/Cursor.app" | grep -v grep
# Totals for the summary line (rss is in KB on macOS)
ps -axo rss,comm | awk 'index($0, "/Applications/Cursor.app") {n++; s+=$1} END {printf "%d processes, %.1f GB", n, s/1048576; print ""}'
# Last 30 min from the collector (read-only)
sqlite3 -readonly "$DB" "SELECT datetime(timestamp,'unixepoch','localtime'), role, process_count, ROUND(cpu_percent,1), ROUND(resident_bytes/1073741824.0,2) || ' GB' FROM raw_samples WHERE timestamp > strftime('%s','now') - 1800 ORDER BY timestamp;"
sqlite3 -readonly "$DB" "SELECT datetime(timestamp,'unixepoch','localtime'), kind, role, reason, memory_pressure FROM events WHERE timestamp > strftime('%s','now') - 1800 ORDER BY timestamp;"$LOG# Graceful quit first — lets Cursor save session state
osascript -e 'tell application "Cursor" to quit' 2>/dev/null
sleep 3
# Kill anything still alive under the bundle path
pkill -f "/Applications/Cursor.app" 2>/dev/null
sleep 1
# Verify; force-kill leftovers by PID if needed
ps -axo pid,comm | grep "/Applications/Cursor.app" | grep -v grep
# if any remain: kill -9 <pid> ...
# Final check — must print "all Cursor processes gone"
ps -axo pid,comm | grep "/Applications/Cursor.app" | grep -v grep && echo "STILL RUNNING" || echo "all Cursor processes gone"sleep 2
open -a Cursor
# Wait up to 15 s for the main process to come back
for i in $(seq 1 15); do
ps -axo comm | grep -q "/Applications/Cursor.app/Contents/MacOS/Cursor" && break
sleep 1
done
ps -axo pid,comm | grep "/Applications/Cursor.app/Contents/MacOS/Cursor" | grep -v grepsleep 10 # let Cursor settle and restore windows
ps -axo pid,rss,comm | grep "/Applications/Cursor.app" | grep -v grep
ps -axo rss,comm | awk 'index($0, "/Applications/Cursor.app") {n++; s+=$1} END {printf "%d processes, %.1f GB", n, s/1048576; print ""}'$LOGKilled 14 processes using 21.3 GB. Cursor is back with 9 processes using 2.1 GB. Snapshot saved to nuke-logs/2026-08-14-1832.md.
ps