// troubleshooting guide · hammerspoon
Hammerspoon Timer or Watcher Stops Working
- Status
- Fixed in latest version
- platforms:
- macOS
- updated:
- November 16, 2026
- reports:
- 2
- Method
- how we research
RUNBOOK · hammerspoon/timer-stops-working2 FIXES
// quick answer
A timer or watcher stops when Lua garbage-collects it. Save it in a variable that lives for the whole session.
Most likely fix: Store the object
How to fix it
// try these in order, the most common fix is first
FIX 1Store the object
- 01Assign it to a global or a table kept in a required module
- 02Example: myTimer = hs.timer.doEvery(60, fn)
Did this fix it?FIX 2Use an upvalue pattern for locals
- 01Declare the local first, then assign inside the callback
- 02Call :stop() and set the variable to nil to finish
Did this fix it?
Symptoms
An hs.timer, path watcher or app watcher runs for a while and then silently stops.
Why it happens
- C-01Return value not stored
- C-02Local variable went out of scope
// this guide also covers
- hammerspoon timer stops
- hammerspoon garbage collection
Still not working?
If Hammerspoon keeps failing, you're not alone. See every Hammerspoon problem users report or the alternatives people switch to.
Done fighting Hammerspoon? Our small team builds your own Hammerspoon alternative, or any software you need: web, mobile, games, desktop. Price agreed together.
Talk to usOther Hammerspoon errors
- Hammerspoon Accessibility Permission Not Working
- Hammerspoon Keystrokes Not Working
- Hammerspoon Hotkeys Stop Working
- Hammerspoon Modal Hotkeys Not Working
- Hammerspoon UI Not Showing in Full-Screen Apps
- Hammerspoon Cannot Find Application By Name
- Hammerspoon selectMenuItem Not Working From Console
- Hammerspoon v2: What Changes and Should You Wait