From 6adb521c31a3436c67a7df1d10de40060c9f0fbc Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sat, 18 Apr 2026 15:35:00 -0700 Subject: [PATCH] slab: detect terminal-CLI claude as well as desktop-embedded claude_running() now matches both invocation styles: - desktop app: .../claude.app/Contents/MacOS/claude - terminal CLI: node .../@anthropic-ai/claude-code/cli.js Without this, the daemon's stale-marker safeguard would wipe live active-prompt/subagent markers when only terminal claude was running, producing silent lid-close even with an agent in flight. Co-Authored-By: Claude Opus 4.7 (1M context) --- slab/bin/lid-ambient.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slab/bin/lid-ambient.sh b/slab/bin/lid-ambient.sh index c77072eff2..f5a184d9d1 100755 --- a/slab/bin/lid-ambient.sh +++ b/slab/bin/lid-ambient.sh @@ -90,7 +90,9 @@ stop_monitor() { } claude_running() { - ps -eo command | grep -qE '^/Users/.*/claude\.app/Contents/MacOS/claude ' + # Matches both the desktop-app-embedded CLI (.../claude.app/Contents/MacOS/claude) + # and the terminal CLI (node .../@anthropic-ai/claude-code/cli.js). + ps -eo command | grep -qE 'claude\.app/Contents/MacOS/claude |@anthropic-ai/claude-code/.*cli\.js' } active_work_count() { -- 2.51.2