MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isProcessRunning

Function isProcessRunning

src/utils/nativeInstaller/pidLock.ts:82–95  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

80 * Uses signal 0 which doesn't actually send a signal but checks if we can
81 */
82export function isProcessRunning(pid: number): boolean {
83 // PID 0 is special - it refers to the current process group, not a real process
84 // PID 1 is init/systemd and is always running but shouldn't be considered for locks
85 if (pid <= 1) {
86 return false
87 }
88
89 try {
90 process.kill(pid, 0)
91 return true
92 } catch {
93 return false
94 }
95}
96
97/**
98 * Validate that a running process is actually a Claude process

Callers 3

isClaudeProcessFunction · 0.70
isLockActiveFunction · 0.70
getAllLockInfoFunction · 0.70

Calls 1

killMethod · 0.45

Tested by

no test coverage detected