Most days my screen is a competition for my attention, some of it my own doing (juggling various apps and agents) and some of it engineered by people whose business depends on interrupting me. I wanted a way to pick one window to focus on and quiet the rest: not to close anything, just to make a single app the only thing in view.
I assumed a tool like this existed and went looking for it. I didn't find one, or at least not one that did what I pictured. I probably could have kept digging, but building it myself with agentic coding tools took about as long as a proper search would have. Most of the effort went into defining and iteratively refining what I wanted in the interface, and that is the same work a search demands: you only learn your real requirements by trying candidates and seeing where they fall short. The whole thing came together in about 250 lines of Lua, with no purchase and no subscription, and it was exactly what I had imagined.
The result is Zen Mode, a Hammerspoon script for macOS. Press a hotkey and the frontmost window glides to the center of the screen and grows to full height, while the menu bar, the dock, the wallpaper, and every other window gently dim behind it. Press the hotkey again, or Escape, and everything returns to where it was.
Why not just use full-screen mode, which macOS has had for years? Full-screen stretches a window edge to edge, and for most of what I do that makes things worse: text lines run too long, or the app fills the extra width with empty space. Some apps have their own focus modes, but not all of my daily drivers. I designed Zen Mode to apply across all macOS apps, to move the window front and center while preserving its width, and to softly dim everything around it, leaving the window in a spotlight. When you're done, the lights come back on.
The first version was rough around the edges, literally: the window's border glowed against the dark backdrop. Fixing it meant getting acquainted with how the effect actually works. Zen Mode doesn't hide or resize other apps; it draws one dark canvas over the entire screen, raised to the level of the mouse cursor so it covers even the menu bar and the dock, and punches a transparent, rounded hole exactly where the window sits. The cutout is inset slightly so the darkness overlaps the window's edge rather than leaving a bright seam, and its corners must be rounded at least as much as the window's own, or slivers of background peek through at the diagonals. macOS offers no way to ask a window for its corner radius (and the latest release made corners much rounder), so the default errs generous: too round dims a sliver of the window's corner, while not round enough leaks light.
The cutout also follows where the window actually is rather than where it was asked to be. Apps apply frame changes late and round them to their own grids, so a cutout that tracks the requested frame runs ahead of the window and flashes bright background mid-animation. Reading the real frame back after every change means any residual lag errs dark, the window briefly under the overlay, instead of bright.
The animation needed the same care. Hammerspoon's built-in window animation steps through a series of synchronous calls, which looks choppy, so Zen Mode disables it and runs its own sixty-frames-per-second clock, easing the window's frame and the backdrop's darkness together from a single timeline. The clock is tied to time rather than steps: if an app is slow to apply a frame, it simply renders fewer of them, and the transition still completes on schedule. The choreography happens in two phases because moving a window is cheap for the app while resizing forces a re-layout at every step (a terminal reflows its whole character grid). So the window glides to center at its original size as the screen darkens, and only grows to full height once the backdrop is fully dark, the most forgiving moment for the less-smooth resize. Exiting mirrors it: shrink in the dark, then glide home as the darkness lifts.
I would have preferred a frosted-glass blur behind the window, but macOS gives a script no public way to blur what's behind an arbitrary window. The workaround, screenshotting the desktop and blurring the result, needs screen-recording permission and produces a frozen image that goes stale the moment anything behind it changes. A translucent dark fill achieves the same focus, stays live, and costs nothing. It also works regardless of light or dark appearance: darkness lowers both the brightness and the contrast of the background clutter, where a light scrim would itself become the brightest thing on screen. The spotlight works in either mode.
Even with the most powerful frontier models, none of this was delivered automatically. Coding agents can't read my mind (or even anticipate what would feel jarring), so they can converge on a great solution, but only with careful hand-holding.
The code is public, and you're welcome to try it. Installing it is a matter of pasting the script into your Hammerspoon config. Here's the repo:
https://github.com/cabeen/zen-mode
I think agentic coding tools open up a new kind of personalized, on-demand software. You may want a different zen mode, and the same tools that built mine will build yours. I'd only recommend staying in the loop and not relying on the first pass, no matter how fabled the model may be.