Protecting my attention is a constant battle for engineers. Learn how I use specific CLI tools and environment automation to minimize distractions and stay deep.
Last month, I spent four days trying to debug a race condition in a legacy service, only to realize I’d been interrupted by Slack notifications or "quick" questions over 60 times. My ability to hold the entire state of the system in my head was constantly being shredded by the very tools meant to keep me connected.
I realized then that if I wanted to survive, I had to stop relying on willpower and start relying on better infrastructure. Protecting my attention isn't about being a monk; it’s about building a digital environment that makes focus the path of least resistance.
We often mistake responsiveness for productivity. When I started my career, I prided myself on answering emails within minutes. Now, I see that as a liability. Every time I switch context to answer a non-urgent message, I lose roughly 15 to 20 minutes of "warm-up" time to get back into the mental model of the code I was writing.
I tried using heavy-handed app blockers, but they felt like prison. If I couldn't check the documentation or a specific PR, I’d just find another way to break my flow. I needed a system that filtered the noise rather than silencing the world entirely.
I’ve settled on a set of tools that prioritize silence and intent. None of these are revolutionary, but they are consistently applied across my workflow.
tmux and zellijI spend 90% of my time in the terminal. I use tmux (version 3.3a) to maintain persistent sessions. When I’m deep in a refactor, I don’t want to see a browser tab or a notification tray. By mapping my workflow into specific tmux windows, I create a visual boundary. If I’m in the terminal, I’m building.
npx and scriptsI’ve stopped letting Slack run in the background. Instead, I use a small shell script to fetch critical mentions once every two hours. I keep my environment lean, similar to how I manage complexity in Laravel Blade Templates: Mastering Inheritance and Sections. By keeping the "view" of my work clean, I stop myself from scanning for new messages.
When I have to switch tasks, I use a simple git stash workflow. Before I leave a task, I write a single-line text file describing exactly where I left off:
Bash# Before switching branches echo "Refactoring user auth controller: fix the null check in line 44" > ~/workspace/current_task.txt git stash
This tiny ritual saves me from the "what was I doing?" loop. It’s the same logic I apply when I think about Remote work productivity: How to Master Deep Work as a Freelancer. You have to externalize your working memory if you want to avoid burnout.
This approach isn't perfect. Sometimes, a production incident happens, and my carefully curated silence becomes a liability. I’ve learned to build "emergency bypasses" into my system. I keep a dedicated, separate device that only notifies me for PagerDuty alerts, ensuring that I’m never truly unreachable when the house is on fire.
I’m still tinkering with my setup. I’ve been looking into better ways to manage local LLM agents for documentation lookup, as described in LLM Agents: Implementing Reflection Patterns for Better Reasoning. The goal is to keep my information retrieval as local and quiet as my code execution.
Q: Do you really turn off Slack for two hours at a time? A: Yes. I’ve socialized this with my team. They know if something is truly on fire, they can call me. Everything else can wait for my scheduled check-in.
Q: Doesn't this make you look unapproachable? A: Maybe. But I’ve found that being "approachable" but unproductive is a worse trade-off for the team. I’m more helpful when I’m actually finished with my work.
Q: What if I have to use a GUI-heavy stack? A: Focus isn't about the tool; it’s about the boundary. If you’re stuck in a GUI, use OS-level focus modes (like macOS Focus or Windows Focus Assist) to hide the specific apps that trigger your habit of checking status updates.
I’m not sure I’ll stick with this exact configuration forever. Technology changes, and the way we interact with our IDEs will evolve. For now, this baseline allows me to protect my attention enough to ship code I’m actually proud of. If you’re constantly feeling fragmented, start by automating just one part of your workflow—it’s worth the overhead.
Remote work productivity depends on protecting your focus. Learn how to avoid the context switching trap and maintain technical depth in your freelance career.