Efficiency Refactor — 2026-04-27¶
Big shipped batch: 5 architectural plans, 10 skills, 5 tools.
Plans (architectural)¶
| # | Plan | Outcome |
|---|---|---|
| 1 | Slim CLAUDE.md | 400 → 209 lines (48% reduction). Session-mgmt commands moved to /sessions and /spawn skills. |
| 2 | Quick Commands cheatsheet at top of CLAUDE.md | 15 muscle-memory ops → exact commands. Always loaded. Solves the gdoc-stumble class of problem. |
| 3 | Dispatcher uses --bare |
scripts/dispatcher.sh now invokes claude -p --bare for headless workers — skips hooks/LSP/plugin sync, faster cold start. |
| 4 | Mount watchdog + cron | scripts/monitors/mount-watchdog.sh runs every 10 min, detects "transport endpoint not connected" zombies, auto-remounts via systemd. Direct response to Drive mount dying for a month silently. |
| 5 | Stop hook for auto-checkpoint | New Stop hook in settings.local.json calls scripts/hooks/auto-checkpoint.sh with last_assistant_message — auto-records a checkpoint when a session ends. |
Skills (10 new)¶
User-invocable + auto-discoverable:
| Skill | Purpose |
|---|---|
/save-to-drive |
markdown → styled .docx → Drive (wraps scripts/gdoc/to-drive.sh) |
/preview-site |
local + Tailscale dev preview (wraps scripts/sites/preview.sh) |
/screenshot |
desktop + mobile screenshots via Playwright |
/spawn |
replaces BootUpAutoRemote — single tmux+claude+remote-control session with URL |
/sessions |
list/kill/status/log/quick/budget for tmux Claude sessions |
/handoff |
scaffold a structured handoff file at memory/handoffs/<topic>-<date>.md |
/mount-check |
read-only health probe for FUSE mounts |
/ssh-status |
one-shot table of fleet host health (uptime, load, mem, disk) |
Action-only (disable-model-invocation: true — not auto-loaded, won't show in skill list):
| Skill | Purpose |
|---|---|
/deploy-site |
deploy a site (or --all) — manual only, has side effects |
/cf-add |
add Cloudflare DNS record + tunnel ingress in one shot |
/decrypt-n8n |
decrypt an n8n credential by ID |
Tools (5 new scripts)¶
| Tool | Purpose | Used by |
|---|---|---|
scripts/cloudflare/cf.py |
Thin Python CF API client (verify, zones, tunnels, ingress, add, rm) | /cf-add |
scripts/n8n/decrypt-cred.sh |
One-shot n8n credential decrypt by ID; --list for inventory |
/decrypt-n8n |
scripts/checkpoint.sh |
Append structured checkpoint to today's daily log; --auto mode for hooks |
Stop hook, /handoff, manual |
scripts/monitors/mount-watchdog.sh |
Detect + auto-recover dead FUSE mounts on Finn | Cron every 10 min |
scripts/sites/all-deploy.sh |
Deploy every site in sites/ with summary table |
/deploy-site --all |
Hooks layout (after this refactor)¶
SessionStart:
- scripts/hooks/since-last.sh (boot briefing — handoffs, alerts, fleet)
UserPromptSubmit:
- scripts/prompt-counter.sh (every-5-prompts checkpoint nudge)
- scripts/hooks/auto-context.py (project keyword → file pointers)
PostToolUse(Write):
- scripts/new-file-log.sh
Stop: ← new
- scripts/hooks/auto-checkpoint.sh (auto-write checkpoint with last assistant msg)
Cron entries (after this refactor)¶
*/10 * * * * scripts/monitors/mount-watchdog.sh ← new
30 3 * * * scripts/search/index.py --quiet
*/5 * * * scripts/monitors/security-check.sh
*/10 * * * scripts/monitors/infra-check.sh
*/15 * * * scripts/monitors/business-check.sh
*/15 * * * infra/context-api/scripts/ha_poller.py
0/22 6 * * scripts/integrations/eight-sleep/poll.py
5/18 6 * * scripts/integrations/garmin/poll.py
30 7 * * * scripts/integrations/morning-wellness-check.sh
0 4 * * * scripts/integrations/minecraft/backup.sh
* * * * * scripts/integrations/telegram/nudge-fire.py
Backup¶
Original CLAUDE.md saved at CLAUDE.md.bak.1777298035 (epoch). Delete after a week if no regressions.