| name | yabai |
| description | Configure and manage yabai, the macOS tiling window manager. Use when the user asks about window tiling, yabai config, layouts (bsp/stack/float), window rules, or managing windows/spaces/displays on macOS. |
| argument-hint | ["query|config|rule|help"] |
yabai — macOS Tiling Window Manager
Install
brew install koekeishiya/formulae/yabai
brew services start yabai
For the scripting addition (needed for space/display control):
https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition
Config file
~/.yabairc — must be executable (chmod +x ~/.yabairc). Reload with yabai --restart-service.
Layouts
Three layout modes per space:
- bsp — binary space partitioning (tiling)
- stack — all windows stacked, cycle with focus
- float — manual positioning
yabai -m space --layout bsp
yabai -m space --layout stack
yabai -m space --layout float
Common patterns
Focus windows
yabai -m window --focus west
yabai -m window --focus recent
yabai -m window --focus prev
Swap / warp windows
yabai -m window --swap east
yabai -m window --warp north
Move window to space or display
yabai -m window --space 2
yabai -m window --space 2 --focus
yabai -m window --display next
Toggle float / fullscreen
yabai -m window --toggle float
yabai -m window --toggle zoom-fullscreen
yabai -m window --toggle zoom-parent
yabai -m window --toggle split
Resize
yabai -m window --resize bottom_right:100:-200
yabai -m window --grid 1:3:0:0:2:1
Space operations
yabai -m space --create
yabai -m space --destroy
yabai -m space --balance
yabai -m space --mirror x-axis
yabai -m space --rotate 90
yabai -m space --padding abs:20:20:20:20
yabai -m space --gap abs:10
Focus spaces with wraparound
yabai -m space --focus next || yabai -m space --focus first
yabai -m space --focus prev || yabai -m space --focus last
Query state (JSON output, pipe to jq)
yabai -m query --windows
yabai -m query --windows --space 2 | jq '.[].app'
yabai -m query --spaces
yabai -m query --displays
Rules — manage specific apps
yabai -m rule --add app="^System Settings$" manage=off
yabai -m rule --add app="^Calculator$" manage=off
yabai -m rule --add app="^Finder$" title="^Copy$" manage=off
yabai -m rule --add app="^Spotify$" space=3
yabai -m rule --list
Signals — react to events
yabai -m signal --add event=window_focused action="echo focused"
yabai -m signal --add event=application_launched action="echo new app"
yabai -m signal --add event=space_changed action="echo space changed"
When helping the user
- Check if yabai is installed:
which yabai && yabai --version
- Check current config: read
~/.yabairc
- Query current state with
yabai -m query --windows / --spaces / --displays
- After config changes, reload:
yabai --restart-service
- For rules targeting apps, use
^exact name$ regex anchors
- For the scripting addition and SIP, point to the wiki — do not attempt to guide SIP changes directly