Skip to content

Hammerspoon vs yabai

Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.

Hammerspoon

Open source · MIT

A macOS automation tool that runs Lua scripts to control your Mac's windows, keys, and system.

yabai

Open source · MIT

A tiling window manager for macOS that arranges windows automatically using a command line.

The short answer

Choose Hammerspoon if you need…

  • Mac users comfortable writing small scripts who want custom keyboard shortcuts or window behavior
  • Power users who want to automate repetitive desktop tasks on macOS
  • People who used Mjolnir and want a more integrated version with built-in extensions
  • Developers who want to script their own macOS environment

Choose yabai if you need…

  • Mac users who want keyboard-driven window layouts
  • People comfortable editing configuration files and using a terminal
  • Users who want to manage multiple spaces and displays from the command line
  • Users who want focus-follows-mouse behavior

Side-by-side

Hammerspoonyabai
TypeAppApp
PriceFree and open sourceFree and open source
LicenceMITMIT
GitHub stars16.4k29.8k
Setup difficultyIntermediateIntermediate
How you get itInstall with a package managerSee the README
Main languageObjective-CC
Last code update4 months ago5 months ago

What each one is

Hammerspoon

Hammerspoon is a macOS tool that acts as a bridge between the operating system and a Lua scripting engine. It ships with extensions that expose many system features, so you can write Lua scripts to automate parts of your Mac. Out of the box it does nothing; you write your own configuration file to decide what it does.

yabai

yabai is a utility that extends the built-in window manager of macOS. It automatically arranges open windows into tiled layouts based on a binary space partitioning algorithm, so you can focus on content instead of moving windows by hand. You control it through a command line interface and can optionally bind keyboard shortcuts with skhd or other tools.

Best for

Hammerspoon

  • Mac users comfortable writing small scripts who want custom keyboard shortcuts or window behavior
  • Power users who want to automate repetitive desktop tasks on macOS
  • People who used Mjolnir and want a more integrated version with built-in extensions
  • Developers who want to script their own macOS environment

yabai

  • Mac users who want keyboard-driven window layouts
  • People comfortable editing configuration files and using a terminal
  • Users who want to manage multiple spaces and displays from the command line
  • Users who want focus-follows-mouse behavior

Strengths

Hammerspoon

  • Built on Lua, a simple and widely used scripting language
  • Extensions expose many system features, and API docs are available online
  • Open source under the MIT license with an active community and CI testing

yabai

  • Free and open source under the MIT License
  • Based on a documented tiling algorithm and scriptable through the command line
  • Has sample configuration files, a wiki, and documentation in the repository

Not ideal for

Hammerspoon

  • People who want a ready-made app with no configuration, since it does nothing until you write Lua code
  • Users on other operating systems, because it is macOS only
  • Anyone unwilling to learn basic Lua, since scripting is the main way to use it

yabai

  • Users who want a point-and-click setup with no terminal use, since control is through a command line interface
  • Users on macOS versions older than those listed in the README's requirements
  • People who cannot grant Accessibility permissions, since the README says yabai needs them

Trade-offs

Hammerspoon

  • Requires writing code, so it is not a point-and-click tool
  • MacOS only, and the README does not list supported macOS versions
  • Its extension coverage is still growing according to the project's own future plans

yabai

  • Some features require partially disabling System Integrity Protection, which the README says carries risk and is optional
  • Several macOS settings must be changed for commands to work reliably, and some apps such as Terminal and Finder handle tabs incorrectly
  • The README includes a disclaimer that the authors are not responsible for any machine damage

Getting started

Hammerspoon

Install with Homebrew

brew install hammerspoon --cask
Step-by-step guide: how to use Hammerspoon

yabai

Clone the repository

git clone https://github.com/asmvik/yabai
Step-by-step guide: how to use yabai

Frequently asked questions

What is the difference between Hammerspoon and yabai?

Hammerspoon: A macOS automation tool that runs Lua scripts to control your Mac's windows, keys, and system. yabai: A tiling window manager for macOS that arranges windows automatically using a command line. Hammerspoon suits mac users comfortable writing small scripts who want custom keyboard shortcuts or window behavior, while yabai suits mac users who want keyboard-driven window layouts.

Are Hammerspoon and yabai free?

Hammerspoon: Free and open source. yabai: Free and open source.

Is Hammerspoon or yabai more popular?

yabai has more GitHub stars (29.8k) than Hammerspoon (16.4k). Popularity isn't the same as fit — check which one matches your use case above.

What are other alternatives to Hammerspoon and yabai?

Other options people compare them with include Amethyst, AeroSpace.

Keep comparing

Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.