Skip to content

v0.7.1 — fix silent osascript wake keystroke race

Choose a tag to compare

@ThinkOffApp ThinkOffApp released this 02 May 21:52
· 163 commits to main since this release

Patch release.

Bug: claudemb-wake.sh used tell application "System Events" to keystroke which routes to whichever process is frontmost at execution time. If Claude.app didn't fully take focus during the 0.3s activation delay (multi-window, focus contention), keystrokes landed in the user's actual foreground app with NO error logged. @claudemm observed ~10 lost wakes in a 16-min window on the mini.

Fix: bind the keystroke target to the process explicitly via tell process "$APP_NAME" / set frontmost to true / keystroke. Plus a post-keystroke verify check that logs WARN when finalFront != target for any remaining edge cases.

Affected: anyone using the AppleScript wake path (claudemb-wake.sh in the IAK poller). The Stop hook path (claudecode-stop-resume.sh) was unaffected — it uses exit code 2 + stderr, no keystroke.

Diagnosis credit: @claudemm. Fix design: @claudemb.