Something Keeps Stealing Focus on My Mac. I Built a Tool to Catch It.

You’re typing. Mid-sentence, your keystrokes vanish. Whatever you were writing — gone, or worse, scattered across some other window that just grabbed the keyboard without asking.

The really maddening thing is that it doesn’t happen consistently. It might hit a few times in a week, then go completely silent for weeks. You start wondering if you imagined it. And when it does happen, the only reliable fix I found was restarting the computer — annoying at best, and a real problem if you have unsaved work open.

If you’ve experienced this on a Mac, you’ve probably also spent time in forums full of theories. Blame Chrome. Blame Spotlight. Blame your calendar app. Blame a background sync process. The threads are long and the advice is contradictory, because the honest answer is: it depends on your specific machine, your specific software, and what’s running quietly in the background.

No generic advice was going to solve this for me. I needed to know what was actually happening on my computer.

So I built a small logger that watches for focus-steal events and records which application caused them. It installs itself, runs silently in the background, and automatically deletes its own logs after 30 days — so it’s not accumulating data indefinitely on your machine.

On my machine, the culprit was G Hub. Logitech’s peripheral management software, which I’d installed a few months ago for a mouse and never thought about since. It’s on a lot of Mac users’ machines. It’s almost never the first thing anyone suspects. And the data was unambiguous: after waking my computer from sleep, G Hub grabbed focus 47 times in 4 minutes — 43% of all focus activity in that period. What’s happening under the hood is that G Hub re-initializes your Logitech devices on every wake, and activates itself with each device it detects. Every. Single. One.

I’ve filed a bug report with Logitech, and I’ll be posting the findings in the forum threads where people are clearly experiencing the same problem but have no idea what’s causing it. If you’re one of those people — hello.

If you have any Logitech hardware, it’s worth checking.

The tool is free, open source, and available on my GitHub: attention-thief-catcher. If you’re comfortable with a terminal, setup takes a couple of minutes. If you’re not, find a technical friend — it’s a five-minute favour.


One more thing worth saying: this is a small project. But it’s one I could not have built on my own — not without spending days learning Swift, macOS daemon architecture, log parsing, and everything else involved. With AI coding tools, I had something working in minutes. Not because the AI did all the thinking, but because it handled the parts I don’t know, so I could focus on the problem I actually wanted to solve.

That’s what I’ll keep writing about here. Not AI in the abstract — but what it actually lets you build, and why that matters. If you want the bigger picture on why I’m doing this, read the companion post.