Borrowing it
Nothing to install: this file belongs to disler/learning-cmux-with-agents. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/disler/learning-cmux-with-agents/main/.claude/commands/cmux-fresh.mdgit clone --depth 1 https://github.com/disler/learning-cmux-with-agentsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/disler/learning-cmux-with-agents/cmux-fresh)<a href="https://agentmods.dev/commands/disler/learning-cmux-with-agents/cmux-fresh"><img src="https://agentmods.dev/badge/commands/disler/learning-cmux-with-agents/cmux-fresh/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/disler/learning-cmux-with-agents/cmux-fresh"><img src="https://agentmods.dev/badge/commands/disler/learning-cmux-with-agents/cmux-fresh.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00045 | $0.01011 |
| Opus 5 | $0.00023 | $0.00505 |
| Sonnet 5 | $0.00009 | $0.00202 |
| Haiku 4.5 | $0.00005 | $0.00101 |
Grade A, and why
cmux-fresh scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.
cmux Fresh
Purpose
Wipe cmux's saved session so it boots with fresh, blank windows next time — no restored workspaces or panes. cmux replays its window/workspace/pane tree from a session JSON on launch and rewrites it on quit; this command empties that tree (after backing it up) so there's nothing to restore.
Variables
Static configuration
STATE_DIR: ~/Library/Application Support/cmux SESSION: $STATE_DIR/session-com.cmuxterm.app.json PREVIOUS: $STATE_DIR/session-com.cmuxterm.app-previous.json
Instructions
- Quit cmux first — automatically. While cmux runs it owns the session file and
rewrites it, so a clear won't stick. If it's up,
pkillit and wait for it to exit before backing up/clearing. cmux flushes its session on a clean quit, so kill it, then operate on the file it leaves behind. Report whether you had to kill it. - Back up before clearing. Copy each session file to
<file>.bak-<epoch>before touching it, so the prior layout can be restored. - Clear by setting the top-level
windowsarray to[]— keep the rest of the JSON (version,createdAt) intact. Do not delete the file outright. - Handle the
-previous.jsonsibling too; it's cmux's one-step-back snapshot. - If a file doesn't exist, skip it quietly — that's fine, not an error.
- This is a destructive-to-layout op on the user's machine; only clear these two session files, nothing else under STATE_DIR.
Workflow
- If cmux is running, quit it and wait for it to fully exit (so the clear sticks).
Try a graceful quit first, then force-kill if it lingers:
If it still reports running after the force-kill, stop and tell the user — don't clear, since cmux would just overwrite it.if pgrep -xi cmux >/dev/null; then echo "was RUNNING — quitting" osascript -e 'quit app "cmux"' 2>/dev/null || pkill -xi cmux for i in $(seq 1 20); do pgrep -xi cmux >/dev/null || break; sleep 0.5; done pgrep -xi cmux >/dev/null && { pkill -9 -xi cmux; sleep 1; } pgrep -xi cmux >/dev/null && echo "STILL RUNNING — abort" || echo "quit OK" else echo "not running" fi - Back up and clear both session files (epoch suffix; skip missing ones):
STATE="$HOME/Library/Application Support/cmux"; TS=$(date +%s) for f in "$STATE/session-com.cmuxterm.app.json" "$STATE/session-com.cmuxterm.app-previous.json"; do [ -f "$f" ] || { echo "skip (absent): $f"; continue; } cp "$f" "$f.bak-$TS" tmp="$f.tmp.$TS" jq '.windows = []' "$f" > "$tmp" && mv "$tmp" "$f" \ && echo "cleared: $f (backup: $f.bak-$TS)" \ || echo "FAILED: $f" done - Confirm each cleared file now has an empty
windowsarray:STATE="$HOME/Library/Application Support/cmux" for f in "$STATE/session-com.cmuxterm.app.json" "$STATE/session-com.cmuxterm.app-previous.json"; do [ -f "$f" ] && echo "$f -> windows: $(jq '.windows | length' "$f")" done - Now follow the
Reportsection.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 87 lines · 45 tokens per session scan A 91db1cb314a0
cmux-fresh is a command published in the GitHub repository disler/learning-cmux-with-agents (109 stars, last pushed 2mo ago), licensed MIT. It adds 45 tokens to every session and 1,011 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
cancel-ralph
Cancel active Ralph Loop.
obsidian-recap
Summarize a time period from the vault - today, week, or month.
setup-pm-skills
Onboard a new user — find out what they do, recommend the right bundles & top skills, and set up a project CONTEXT.md so every skill is tailored to them.
statusbar-style
Switch the status-bar style (classic / capsule / hairline).
engage.actions
Execute Phase 7 - Actions on Objectives and Goal Achievement.
superpowers-execute
Execute the current GSD phase plan with Superpowers instead of gsd-execute-phase.