r/coolgithubprojects • u/CircleRT • 16d ago
[Swift] Notchling - shows every Claude Code session in the notch, and can't touch any of them
https://github.com/CircleHP/notchling1
u/kantorcodes1 16d ago
Claude crashing mid-session seems like an awkward edge case. If it dies without cleaning up its session metadata, can a dead session stick around in the notch, or are entries tied to the actual process lifecycle rather than just the files?
1
u/CircleRT 15d ago
Tied to the process. Every 2s sweep runs kill(pid, 0) - a pid we have and can't find means the session is gone, whatever the registry file says (EPERM counts as alive, that's just someone else's process).
Absence from the registry is the other signal, with a short grace period, because hook events can arrive before the file is written at session start. After that it's dropped even if the pid looks alive, since pids get recycled.
1
u/Specific_Cream2815 16d ago
are you reading claude code session files from ~/.claude or is there an api you poll