English ยท ํ๊ตญ์ด ยท ็ฎไฝไธญๆ ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท Espaรฑol ยท Deutsch ยท Franรงais ยท Portuguรชs ยท ะ ัััะบะธะน
Your Mac chokes โ Claude names the exact process eating it โ one click kills it. Nothing happens until you click โ so there's no risk to your Mac.
Every hour, your Mac's load goes to Claude. It ranks what's actually hogging your CPU/RAM, writes the exact fix, and drops it in your menu bar โ worst-first, color-coded, one click away. And before anything runs, a second Claude pass has to clear the command as SAFE.
Mac Optimizing Looper is a macOS menu-bar app (no Dock icon) that runs a continuous observe โ ask the model โ advise โ (optionally) act loop on top of your local LLM CLI.
โฌ Install ยท See it work โ
Activity Monitor shows you 200 rows and zero answers. This shows you the one command that fixes it โ and why.
One cycle:
โฑ timer fires (default: every 1h, slider 10m โฆ 36h)
โ collect: CPU/MEM + mac-optimizer snapshot (+ optional sustained sample)
โ claude -p (analysis pass, --effort max)
โ claude -p (format pass โ ranked JSON suggestions)
The menu bar shows the count. The dropdown is ranked worst-first: ๐ด critical โ ๐ก warning โ ๐ข hygiene. Each row expands into Copy ยท Show in Terminal ยท Review with Claude ยท Run Command Now.
"Run Command Now" is the only path that executes anything, and it's gated end to end:
click โธ Run Command Now ($ kill 8123)
โ claude -p classifies โ RISK: SAFE
โ background run (sudo โ GUI password prompt, because there's no TTY)
โ โ
notification โ click โ full stdout/stderr window
โ suggestion marked โ done
Anything not classified SAFE (including unknown) pops a confirmation dialog defaulting to Cancel. The advice itself is inert data; the model can never make the app run a thing. Enforced by GuardrailTests.
| Activity Monitor | "Cleaner" apps | Mac Optimizing Looper | |
|---|---|---|---|
| Finds the actual culprit | you read 200 rows | guesses | ๐ข Claude ranks worst-first |
| Tells you why it's slow | โ | โ | ๐ข plain-language reason |
| Gives the exact fix | โ | generic "clean" | ๐ข the real kill / unload command |
| Acts on its own | โ | ๐ด yes, on a schedule | ๐ข never โ only on your click |
| Safety-gated before running | โ | โ | ๐ข second Claude pass clears it SAFE |
| Where your data goes | local | varies | only to your own Claude CLI |
Needs the claude CLI on your PATH. macOS 13+.
brew install --cask kargnas/tap/mac-optimizing-looperThe cask + DMG go live after the first signed release. The pipeline is wired and waiting on signing secrets โ see docs/release-setup.md. Until then, build from source:
git clone https://github.com/kargnas/mac-optimizing-looper
cd mac-optimizing-looper
bash script/build_and_run.sh run # builds the .app, codesigns ad-hoc, launchesRun the bundle, not the bare binary โ UNUserNotificationCenter needs a real bundle id (as.kargn.MacOptimizingLooper).
Switch Provider / Model / Effort right from the menu bar โ no need to open Settings. Each has a Default option that auto-picks for you: Claude as the backend, a balanced model, and one notch below the top reasoning level. A fresh install just works, and you can still pin an exact value any time. While an analysis runs, the menu bar shows which backend is working. claude is the default backend; codex is also supported (one schema-constrained pass, no separate format step). Settings holds the rest โ Fast Mode, analysis interval, terminal app, and Language (which sets both the UI and the language the model analyzes in). Models and reasoning levels are read live from each CLI.
Does it ever run anything by itself?
No. Advice is inert data. The single execution path is the "Run Command Now" button, on your click โ enforced by GuardrailTests.
Is it safe to hit "Run"?
Every command goes through a second Claude pass. Anything not clearly SAFE (including unknown) pops a confirm dialog defaulting to Cancel. sudo routes through the macOS GUI password prompt.
Does my data leave my Mac?
Only the live metrics + process table, sent to Anthropic via your own claude CLI (or OpenAI via codex). The app adds zero telemetry.
What does it cost?
Nothing beyond your existing claude / codex CLI usage. The app is free and MIT-licensed.
No claude CLI installed?
Then no advice โ it surfaces the error instead of guessing.
Under the hood โ system prompt, full cycle, decision flow, config, limits
You are a macOS performance analyst.
Given live metrics + a process table, identify the ACTUAL remediation
command (kill / killall / unload) for each real problem โ never an
inspection command (no pgrep / ps / top).
MUST: rank by severity; prefer graceful `kill <pid>` over `kill -9`.
MUST: return a null command when no command-line action applies.
MUST NOT: claim anything was executed โ the app never auto-runs.
| Step | Tool | Side effect |
|---|---|---|
| Collect | MetricsCollector, mac-optimizer.sh |
read-only |
| Analyze | claude -p (effort = max) |
network, read-only |
| Format | claude -p (effort = low) |
ranked JSON |
| Risk-check | claude -p |
network, read-only |
| Run | CommandExecutor |
runs the command (user-initiated only) |
| Review | configured terminal + interactive claude |
opens a terminal |
timer โ collect โ claude analyze โ rank suggestions
โ
user picks an action โโผโ Copy / Show in Terminal โ no execution
โโ Review with Claude โ interactive claude session
โโ Run Command Now
โ claude risk-check
โโ SAFE โ run โ notify โ โ
โโ else โ confirm (default Cancel)
Config lives at ~/.config/mac-optimizing-looper/config.json (copy config.example.json): provider, model, thinking level, monitor seconds, interval, terminal, language. It's read once at launch โ restart after hand-editing.
- Never acts on its own. Only "Run Command Now" executes, and only on your click.
- Unknown risk = treated as dangerous. Fail-safe; you confirm.
sudoโ GUI password prompt. A background run has no TTY, so root commands route throughosascript โฆ with administrator privileges.- No
claudeCLI = no advice. It surfaces the error instead of guessing. - Notifications need the app bundle; a bare binary falls back to opening the result window.
MIT licensed. Built for people who'd rather know why their Mac is slow than reboot and hope.

