// 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
Share

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

  1. FIX 1Store the object

    1. 01Assign it to a global or a table kept in a required module
    2. 02Example: myTimer = hs.timer.doEvery(60, fn)
    Did this fix it?
  2. FIX 2Use an upvalue pattern for locals

    1. 01Declare the local first, then assign inside the callback
    2. 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 us

Watch Hammerspoon Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

Other Hammerspoon errors