Crash-Safe Deep Work Discipline Engine, Dual-Stack Atomic Hosts Blocker & Catppuccin Mocha Desktop HUD.
Engineered in Go and Python (zero external runtime dependencies) for developers, students, and operators who demand uncompromising focus without network corruption.
Conventional website blockers and browser extensions fail under real-world conditions:
- Trivial Extension Bypass: Browser extensions can be disabled in seconds or bypassed via private windows and secondary browsers.
- IPv6 & DNS-over-HTTPS (DoH) Leaks: Single-stack
127.0.0.1blockers leak traffic over IPv6 (AAAA) records and encrypted browser DoH resolvers (cloudflare-dns.com,dns.google,dns.quad9.net,dns.nextdns.io). - Hosts File & ACL Corruption: Naive scripts overwrite
C:\Windows\System32\drivers\etc\hostsin place without write-ahead journaling or Windows DACL preservation—breaking DNS resolution after power loss, crashes, or reboots. - Heavy Runtime Dependencies: Typical desktop wrappers pull hundreds of megabytes of packages just to enumerate processes.
FocusFlow v2.3 solves these failure modes at the operating-system boundary:
- Unified Go CLI + Zero-Dependency Python HUD:
cmd/focusflow(Go) andFocusFlowGUI.py+focusflow_core/(Python stdlib + Win32ctypes) share the exact same state directory,config.json(custom profiles,daily_goal_minutes,schedules,hooks,notifications_enabled),sessions.json,hosts.focusflow.journal.json, and managed block markers. - Automated Recurring Schedules & Daemon Runner: Define recurring weekday or overnight focus windows (
focusflow schedule add --name "Morning Dev" --days mon-fri --from 09:00 --to 12:00 --profile dev), inspect the next upcoming window (focusflow schedule next), and automate enforcement withfocusflow schedule run. - 90-Day Contribution Heatmap (CLI + HUD): Render a GitHub-style 13-week × 7-day focus intensity heatmap calibrated against your daily goal (
focusflow stats --heatmap, with--no-color/NO_COLORASCII fallback) alongside a native Catppuccin Mocha heatmap canvas in the desktop HUD. - Native OS Notifications & Privilege-Hardened Lifecycle Hooks: Non-blocking OS notifications (Windows WinRT Toast / macOS
osascript/ Linuxnotify-send, opt-out via--no-notify) and shell lifecycle hooks (--on-start,--on-break,--on-endorconfig.jsonhooks) with10stimeouts,FOCUSFLOW_*context env vars, and mandatory POSIXsudoprivilege-dropping (SUDO_UID/SUDO_GID). - Custom Named Profiles, Daily Goals & Multi-Cycle Pomodoro Engine: Create validated custom workflow profiles (
focusflow profile create), track daily focus targets (focusflow goal), and run multi-sprint Pomodoro blocks (focusflow start --cycles 4 --break 5) with automatichostsshield pause between sprints (or continuous lockdown inhardcoremode). - Write-Ahead SHA-256 Rollback Journal & Auto-Recovery: Strips any prior managed blocks before computing a clean baseline SHA-256 backup, persists
hosts.focusflow.journal.jsonbefore touchinghosts, preserves Windows DACLs viaReplaceFileW(NetworkService/Usersread permissions remain intact), and automatically recovers orphaned crash/reboot states on startup (RecoverIfOrphaned). - Dual-Stack IPv4 + IPv6 Sinkhole & Expanded Anti-DoH: Blocks both
0.0.0.0and::(includingwww.subdomains) alongside major DoH bypass endpoints, with mid-session tamper verification and non-blocking DNS cache flushing. - Hardened Native Process Supervisor: Uses Win32
CreateToolhelp32Snapshot(Process32FirstW/Process32NextW) on Windows (zeropsutilrequired) and direct/procinspection on Linux (resolving 15-byteTASK_COMM_LENtruncation without spawningpsevery second), guarded by a strict critical system/host process denylist. - High-Friction Strict Mode & Genuine Telemetry: Features a non-pasteable 16-character alphanumeric Friction Challenge,
time.monotonic()zero-drift countdowns, Per-Monitor v2 High-DPI Catppuccin Mocha HUD, and real streak/completion analytics exported to JSON, CSV, or PNG.
+----------------------------------------------------------------------+
| FocusFlow v2.3 CLI (Go) <==> Desktop HUD (Python/Tk) |
+-----------------------------------+----------------------------------+
|
Shared State (%APPDATA%\FocusFlow or $FOCUSFLOW_HOME)
[config.json | sessions.json | hosts.focusflow.journal.json]
|
+---------------------------+---------------------------+
| | |
v v v
+------------------+ +-------------------+ +--------------------+
| Dual-Stack Hosts | | Native Supervisor | | Real-Time Metrics |
| SHA-256 + Journal| | Win32 / Linux proc| | Goals, Streak, CSV |
+--------+---------+ +---------+---------+ +--------------------+
| |
v v
[System hosts File] [Blocked Processes]
(ACL-Safe Swap) (Denylist-Guarded)
Linux & macOS (amd64 / arm64):
curl -fsSL https://raw.githubusercontent.com/aloneangel45/FocusFlow/main/install.sh | shWindows PowerShell (amd64 / arm64):
irm https://raw.githubusercontent.com/aloneangel45/FocusFlow/main/install.ps1 | iexBoth installers download checksums.txt from GitHub Releases and verify the archive SHA-256 digest prior to extraction. Pin a specific release with FOCUSFLOW_VERSION=v2.3.0.
Launch Launch_FocusFlow_GUI.bat on Windows or run directly:
python FocusFlowGUI.pyTo launch directly with Administrator elevation prompt on Windows:
python FocusFlowGUI.py --elevate(Optional) For PNG chart card rendering, install Pillow: pip install .[reports].
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X main.Version=2.3.0" -o focusflow ./cmd/focusflowPrivilege Model: Modifying the system
hostsfile requires Administrator (Windows) orroot(Linux/macOS) privileges. When run unprivileged, FocusFlow honestly reportsPROCESS-ONLY [UNPRIVILEGED]rather than claiminghostsis locked. Pass--elevateto request privilege elevation.
# Launch interactive terminal dashboard
focusflow menu
# Start a 50-minute Developer sprint (elevating via UAC/sudo if needed)
focusflow start --profile dev --minutes 50 --elevate
# Multi-cycle Pomodoro: 4 cycles of 25m work + 5m recovery break with lifecycle hooks
focusflow start --profile study --cycles 4 --break 5 --on-start "echo Sprint started" --on-end "echo Sprint done" --elevate
focusflow start --profile dev --minutes 50 --no-notify
# Automate recurring focus windows (weekday wrap-around & overnight windows supported)
focusflow schedule add --name "Morning Dev" --days mon-fri --from 09:00 --to 12:00 --profile dev
focusflow schedule list
focusflow schedule next --json
focusflow schedule run --check-interval 30s --elevate
focusflow schedule remove "Morning Dev"
# Hardcore Aegis multi-cycle sprint (lockdown stays continuous across breaks)
focusflow start --profile hardcore --cycles 2 --break 5 --strict hardcore
# Create, inspect, list, and delete custom named profiles
focusflow profile list
focusflow profile create writer --from study --minutes 45 --break 10 --sites news.ycombinator.com,medium.com --apps slack.exe --desc "Distraction-free writing"
focusflow profile show writer --json
focusflow profile delete writer
# View or configure your daily focus goal (5..1440 minutes)
focusflow goal
focusflow goal --minutes 180
focusflow goal --json
# Inspect shield capability, daily goal progress, and active journal
focusflow status
focusflow status --json
# Manage global custom RFC-1123 domains and denylist-checked executables
focusflow list --json
focusflow add site reddit.com
focusflow add app steam.exe
focusflow remove site reddit.com
# View genuine focus hours, daily goal progress, streaks, 7-day chart & 90-day contribution heatmap
focusflow stats --days 7
focusflow stats --heatmap
focusflow stats --heatmap --no-color
focusflow stats --days 7 --json
# Export telemetry to JSON or CSV
focusflow export --format json --out focus_report.json
focusflow export --format csv --out focus_sessions.csv
# Run system diagnostics or recover orphaned crash/reboot state
focusflow doctor
focusflow doctor --json
focusflow recover --elevate
# Immediate rollback & DNS cache flush
focusflow stop
focusflow flush| Profile | Default Interval | Target Workflow | Active Protections |
|---|---|---|---|
study |
25m / 5m |
Academic & Exam Prep | Blocks video, social, streaming, chat clients, and game launchers |
dev |
50m / 10m |
Software Engineering | Keeps GitHub, StackOverflow & technical docs open; blocks social & gaming |
hardcore |
25m / 5m |
Aegis Lockdown | Study blocklist + strict Friction Challenge + Anti-Cheat task-manager suppression (taskmgr.exe, SystemInformer.exe, processhacker.exe) |
- Clean Baseline Guarantee: FocusFlow strips any current or legacy managed blocks before hashing and writing
hosts.focusflow.bak, ensuring a contaminatedhostsfile is never backed up. - Write-Ahead Rollback Journal:
hosts.focusflow.journal.jsonrecordsoriginal_sha256,backup_path,hosts_path,session_id,pid,started_at,expected_end_at, andprofileprior to anyhostswrite. - Automatic Startup Recovery: On every CLI or GUI startup,
RecoverIfOrphanedchecks whether a prior session crashed, rebooted, or expired; verifies.bakagainstoriginal_sha256(falling back to deterministic marker stripping if.bakwas altered); restoreshostswhile preserving OS permissions/ACLs; and marks the interrupted sessioncompleted: falseinsessions.json. - Critical Process Denylist: Kernel, session, shell, and host binaries (
csrss.exe,lsass.exe,svchost.exe,explorer.exe,dwm.exe,winlogon.exe,python.exe,pythonw.exe,focusflow.exe,wt.exe, PIDs0/4/self/parent) can never be added or terminated.
All Go and Python tests run hermetically inside temporary FOCUSFLOW_HOME and FOCUSFLOW_HOSTS_PATH sandboxes—never touching your real %APPDATA% or system hosts file:
go vet ./...
go test -v ./...
python -m pytest -vReleased under the MIT License by aloneangel45.
