feelcouchLagrange
RU
Install

"Task for Claude" shortcut (Quick Commands / Siri)

.shortcut files must be signed by Apple to allow import without warnings — you can't auto-generate a working file from the command line without the interactive Shortcuts app. Below is an honest manual path: 2 minutes once, then it works from Spotlight, Siri, and keyboard.

Steps

  1. Open the Shortcuts app → + (new shortcut).
  2. Rename it to "Task for Claude".
  3. Add action "Ask for Input" — type Text, prompt "Task for Claude".
  4. Add action "Open URLs", in the URL field enter:
    hammerspoon://cc?task=
    and right after task= insert the result variable from step 3. The text must be URL-encoded — the Shortcuts app does this with the action "URL Encode", placed between steps 3 and 4.
  5. Done. Test: run the shortcut from the app — a new Ghostty tab with your task should open.
  6. To call by voice — just say Siri "Task for Claude" (the shortcut's name becomes a voice command automatically, no extra setup needed).
  7. To call from keyboard — System Settings → Keyboard → Keyboard Shortcuts → App Shortcuts → assign a hotkey to the Shortcuts app for this shortcut, or via the "Services" section in the same settings if you've added the shortcut as an extension.

To share with colleagues (optional)

Shortcuts not uploaded to iCloud usually can't be imported without a "untrusted source" warning. Local signing removes that warning and doesn't require an Apple account:

shortcuts sign --mode anyone --input "Task for Claude.shortcut" \
  --output "Task for Claude (signed).shortcut"

The signed file can be shared as a file (Slack, AirDrop, repo) — recipients double-click it without App Store or iCloud login.

Limitation

The hammerspoon://cc?task=… URL scheme is handled by Hammerspoon (see handler code in hammerspoon/); the shortcut itself opens nothing if Hammerspoon isn't running or the handler isn't installed.

Focus without Full Disk Access

hammerspoon/macos/macos.lua detects "Focus" mode (distinct from meetings — camera/microphone/Zoom windows, which are visible anyway) via ~/Library/DoNotDisturb/DB/Assertions.json, and that file is read only with Full Disk Access for Hammerspoon. Without it, Focus detection simply doesn't trigger (fail-open, nothing breaks) — check the status via ./install.sh --check (the "Focus/DND" line).

Option 1 — grant Full Disk Access (simplest): System Settings → Privacy & Security → Full Disk Access → add Hammerspoon.app, enable, restart Hammerspoon.

Option 2 — without FDA, via Shortcuts (future-proof). The Shortcuts app on macOS has an "Focus" automation trigger (Automation → + → Focus → "When turning on"/"When turning off" for a specific mode or any) — it works without Full Disk Access because the system gives Focus status directly to Shortcuts. The automation can run an action "Open URLs" with hammerspoon://cc?focus=on (and a separate automation for turning off — hammerspoon://cc?focus=off).

Caveat: today hammerspoon/macos/macos.lua doesn't understand the focus= parameter in hammerspoon://cc — the handler M.handleURL knows only task, open, and panel. For this option to work, a small addition to macos.lua is needed (accept focus=on|off and set M.state.focus directly, bypassing readFocusActive()) — a separate small task for whoever owns that file; here's only the FDA-free path, the code itself hasn't changed.