Skip to content

Add Focus Mode#1

Merged
daxaur merged 26 commits into
mainfrom
focus-mode
Mar 3, 2026
Merged

Add Focus Mode#1
daxaur merged 26 commits into
mainfrom
focus-mode

Conversation

@daxaur

@daxaur daxaur commented Mar 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • One command (openpaw focus setup) to configure distraction blocking — sites, apps, bluetooth, music, lights, DND, Slack, timer
  • Claude orchestrates sessions directly by reading SKILL.md + JSON config
  • Auto-end timer spawns a Claude session that restores environment and sends summary via Telegram
  • Paw walk animation between wizard steps 🐾

What's included

  • openpaw focus setup — interactive wizard with auto-detection, music presets, color picker, skill directory prompt
  • openpaw focus — shows saved config
  • openpaw focus start/end/status — non-interactive commands for Claude
  • openpaw focus auto-end — background timer + Telegram summary
  • Static SKILL.md template pointing to JSON (single source of truth)
  • 24 commits, clean incremental build

Test plan

  • Run openpaw focus setup — full wizard flow
  • Run openpaw focus — shows config
  • Verify SKILL.md installed at chosen directory
  • Verify ~/.config/openpaw/focus.json written
  • Tell Claude to "focus" — should read SKILL.md and orchestrate

🐾 Generated with Claude Code

dax and others added 26 commits March 3, 2026 00:06
Adds auto-detection of machine capabilities (bluetooth, Spotify, Hue,
Slack, Sonos, etc.), config read/write, website blocking via /etc/hosts,
app quitting via osascript, DND, music control across 6 sources, git
stats tracking, Obsidian logging, and notification helpers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Setup wizard auto-detects machine capabilities (bluetooth devices, Spotify,
Hue rooms, Slack, Obsidian, etc.) and only shows relevant questions.
Supports website blocking (always vs ask-each-time), app quitting, bluetooth
auto-connect, music from 6 sources, Hue lights, DND, Slack DND, calendar
blocking, timer notifications, Obsidian logging, and Telegram notifications.
Focus start shows receipt with git stats on session end.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds `openpaw focus` (start), `openpaw focus setup`, and
`openpaw focus configure` commands. Adds Focus Mode option
to the configure menu. Registers c-focus in the skill catalog.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Creates skills/c-focus/SKILL.md with full usage instructions for Claude.
Updates CLAUDE.md generation to include Focus Mode section when configured,
so Claude knows to suggest `openpaw focus` when users express intent to
concentrate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
execSync calls (osascript, etc.) inside detectCapabilities() were
corrupting the terminal raw mode state, causing the duration text
input to glitch. Moving detection before p.intro() fixes it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Custom sites can still be added during setup via the comma-separated
text prompt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simplified to 3 steps: select sites → add custom → mark which ask
each time. Removed twitter.com (x.com covers it). Same cleaner
flow for app quitting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
clack p.text returns placeholder on empty submit. Switched to
defaultValue: "" so hitting enter skips without adding sites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Removed always-available "Open a URL" and "Local file" fallbacks.
Music prompt only appears if Spotify, Apple Music, Sonos, or yt-dlp
is detected on the machine.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Websites: "Custom..." option in the multiselect — text input only
appears when selected. Music: preset playlists per source (lo-fi,
white noise, nature, rain, waterfall, brown noise, etc.) with a
Custom option for typing your own query/URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
yt-dlp needs a URL or ytsearch: prefix — plain strings like
"white noise 1 hour" would fail. Now auto-prefixes ytsearch1:
for non-URL queries so presets actually work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uses detached spawn to sleep for N minutes then fire
terminal-notifier. Survives after the CLI process exits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove calendarBlock (was never implemented, just a dead toggle)
- Remove telegramNotify (was calling local notification, not Telegram)
- Fix lights color placeholder submitting "warm" on empty enter
- Fix unused total variable in printConfig
- Fix sudo site blocking: use stdio inherit so user can enter password
- Remove dead url/local music source code paths
- Timer option only shown when terminal-notifier is detected

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds `openpaw focus start [--all]`, `openpaw focus end`, and
`openpaw focus status` — plain text output that Claude can read
and act on. Claude starts sessions, reads the receipt on end,
and summarizes the session naturally.

Updates SKILL.md with full instructions for Claude: when to use
start vs start --all, how to handle ask-each-time items in
conversation, and how to summarize the focus receipt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When focus starts, a background process sleeps for N minutes then
runs `openpaw focus auto-end`. This spawns a Haiku session via the
Claude Agent SDK that restores the environment, reads the git stats
receipt, writes an encouraging summary, and delivers it via Telegram
(or native notification as fallback). Same pattern as the scheduler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of wrapping everything in CLI commands, the SKILL.md now
gives Claude the exact shell commands to run for each step (block
sites, quit apps, connect bluetooth, play music, set lights, DND,
Slack). Claude reads the config, asks about ask-each-time items in
conversation, executes commands directly, and handles errors
naturally. CLI still exists for setup wizard and auto-end timer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the user runs `openpaw focus setup`, the wizard now generates a
personalized SKILL.md at ~/.claude/skills/c-focus/ with their exact
preferences baked in — blocked sites, apps, music commands, bluetooth
device, lights, DND, etc. Claude reads one file with everything it
needs to orchestrate a focus session.

Also removes stale calendarBlock and telegramNotify from config init.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Focus Mode doesn't need `openpaw add focus` since it has no external
CLI tools to install. `openpaw focus setup` is the single entry point
that writes the config JSON and generates the personalized SKILL.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Preferences are already baked into the SKILL.md — Claude doesn't need
to read the JSON file. The JSON exists for the CLI commands (auto-end,
start, end, status), not for Claude.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Single source of truth: the JSON config. SKILL.md is now a static
template that tells Claude to read ~/.config/openpaw/focus.json for
preferences and shows the commands for each feature. Setup writes
both files, configure only touches the JSON.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude orchestrates focus sessions, not the CLI. Now `openpaw focus`
shows your saved preferences and active session status. Tells you to
ask Claude to "focus" or "lock in" to start.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Matches the main wizard pattern — global ~/.claude/skills/ (with hint
showing how many skills are already there), project .claude/skills/,
or custom path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Little 🐾 walks across the terminal between each section —
sniffing system, distractions, apps, bluetooth, vibes, lights,
finishing up, and saving config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@daxaur daxaur merged commit 2d2032d into main Mar 3, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant