You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnfmt.Errorf("agent has no session ID - try removing and recreating the agent")
5519
5521
}
5520
5522
5523
+
// Check if Claude is already running
5524
+
ifagent.PID>0 {
5525
+
// Check if the process is still alive
5526
+
process, err:=os.FindProcess(agent.PID)
5527
+
iferr==nil {
5528
+
// Send signal 0 to check if process exists (doesn't actually signal, just checks)
5529
+
err=process.Signal(syscall.Signal(0))
5530
+
iferr==nil {
5531
+
// Process is still running - provide helpful error
5532
+
returnfmt.Errorf("claude is already running (PID %d) in this context.\n\nTo restart:\n 1. Exit Claude first (Ctrl+D or /exit)\n 2. Then run 'multiclaude claude' again\n\nOr attach to the running session:\n multiclaude attach %s", agent.PID, agentName)
5533
+
}
5534
+
}
5535
+
}
5536
+
5537
+
// Get repo for tmux session info
5538
+
repo, exists:=st.GetRepo(repoName)
5539
+
if!exists {
5540
+
returnfmt.Errorf("repo '%s' not found in state", repoName)
5541
+
}
5542
+
5543
+
// Double-check: get the current PID in the tmux pane to detect any running process
// There's a different running process in the pane
5552
+
returnfmt.Errorf("a process (PID %d) is already running in this tmux pane.\n\nTo restart:\n 1. Exit the current process first\n 2. Then run 'multiclaude claude' again\n\nOr attach to view:\n multiclaude attach %s", currentPID, agentName)
5553
+
}
5554
+
}
5555
+
}
5556
+
}
5557
+
5521
5558
// Get the prompt file path (stored as ~/.multiclaude/prompts/<agent-name>.md)
0 commit comments