Claude Code meta commands (/clear, /compact, /model, /loop, …) normally need a human finger on the prompt bar. ccmeta hands that keyboard to Claude itself — a tiny tmux-powered Bash tool that lets the agent drive its own session.
Claude Code gates these commands behind a human keystroke by default; ccmeta removes that gate. Use at your own risk.
Both ship as matching Agent Skills. The ccmeta skill nudges Claude to reach for session-management commands proactively; the ccmeta-dangerous skill teaches it to reserve high-impact commands for tasks that genuinely need them, and to confirm before anything destructive.
I wanted to experiment with fully autonomous execution, for this you need primitives like /clear, /model, /effort, etc.
Prereqs: tmux, Claude Code running inside a tmux pane.
As an Agent Skill (recommended):
npx skills add Alfredvc/ccmetaNow you can ask claude to /clear itself, change its model, etc.
Claude ──Bash──▶ ccmeta.sh / ccmeta-dangerous.sh ──tmux send-keys──▶ Claude's own prompt bar
- Claude calls
ccmeta /clear -- start the next taskvia its Bash tool. - The script finds the tmux pane (via
$TMUX_PANE, fallback: PPID tty lookup). - It backgrounds a subshell, waits 0.5 s for the current Bash call to return, then types the command and Enter into the pane.
- Claude sees a fresh prompt and executes it like a human typed it.
Both scripts share ccmeta-core.sh for all logic. The only difference is which commands each exposes.
No API, no daemon, no hooks. Just tmux.
ccmeta <cmd> [args...] [-- prompt]
ccmeta-dangerous <cmd> [args...] [-- prompt]
ccmeta -h | --help
- Tokens before
--→ the meta command and its arguments (joined with spaces). - Tokens after
--→ a separate follow-up prompt, sent as a new user turn after the command fires.
Commands that take a prompt-like argument (/compact [instructions], /loop [interval] [prompt], /plan [description], …) want it as args, not after --. Use -- when you want to chain a fresh prompt after a no-arg command like /clear.
# Low-risk (ccmeta)
ccmeta /clear
ccmeta /clear -- take the next task and complete it
ccmeta /model opus
ccmeta /effort max
ccmeta /fast on
ccmeta /rename nightly refactor run
ccmeta /compact focus on the API layer
# Requires ccmeta-dangerous
ccmeta-dangerous /loop keep fixing failing tests until green
ccmeta-dangerous /loop 5m check if the deploy finished
ccmeta-dangerous /remote-control
ccmeta-dangerous /batch migrate all React class components to hooksThese commands manage context, sessions, and model settings. Narrower scope than ccmeta-dangerous — no unattended pushes, no cloud calls, no auth changes.
| Command | Arity | Keywords | Notes |
|---|---|---|---|
/clear |
0 |
— | start a new conversation with empty context |
/compact |
* |
— | optional focus instructions for compaction |
/debug |
* |
— | optional description of the issue to focus on |
/desktop |
0 |
— | continue session in the Desktop app (macOS/Windows) |
/effort |
0-1 |
low medium high xhigh max auto |
max is session-only; available levels depend on the model |
/exit |
0 |
— | quit the CLI |
/export |
0-1 |
— | optional filename; otherwise opens a dialog |
/fast |
0-1 |
on off |
toggle fast mode |
/model |
0-1 |
— | model name; no arg opens a picker |
/plan |
* |
— | optional task description to start plan mode with |
/recap |
0 |
— | one-line summary of the current session |
/reload-plugins |
0 |
— | reload active plugins without restarting |
/rename |
* |
— | session name (tokens joined); no arg auto-generates one |
/resume |
0-1 |
— | session id or name; no arg opens picker |
/review |
0-1 |
— | optional PR ref; local review |
/security-review |
0 |
— | analyze pending changes for security issues |
These commands can execute autonomously, make persistent changes, incur cloud costs, or affect external systems. Think before granting ccmeta-dangerous in your Bash permissions.
| Command | Arity | Notes |
|---|---|---|
/autofix-pr |
* |
pushes code to remote unattended; optional instructions |
/batch |
1+ |
bulk parallel code changes across the repo; opens multiple PRs |
/heapdump |
0 |
writes a JS heap snapshot to ~/Desktop; may contain session data |
/logout |
0 |
signs out; session dies |
/loop |
* |
unbounded autonomous execution; [interval] [prompt] |
/remote-control |
0 |
opens session to external access from claude.ai |
/remote-env |
0 |
configures default remote environment; persists across sessions |
/schedule |
* |
creates persistent unattended scheduled tasks |
/simplify |
* |
multi-agent code rewrites across multiple files |
/ultraplan |
1+ |
cloud session; can trigger downstream code execution |
/ultrareview |
0-1 |
deep cloud review; sends diff externally; costs money |
ccmeta-dangerous also includes every command in the smaller-blast-radius set above.
Arity legend
| Symbol | Meaning |
|---|---|
0 |
no args |
0-1 |
optional single arg |
1+ |
one or more args (joined with spaces) |
* |
zero or more args (joined with spaces) |
Each SPEC heredoc is the single source of truth for its script's allowed commands. --help and validation both derive from it — add a row, both update.
ccmeta types into the running Claude Code session — any command on the allowlist will execute without you pressing Enter. That gate exists by default for a reason; removing it is a trade-off you're making.
- Two tiers by design. Give Claude
ccmetaby default. Only addccmeta-dangerousto the Bash allowlist when you explicitly want autonomous, cloud, or auth commands available. The split narrows blast radius; it is not a safety claim. - The allowlist exists so a hallucinated
/rm-rf-everythingfails loudly instead of running. --separator stops a malicious prompt from injecting extra flags into the command.- Installing any Agent Skill (this one included) drops code into your agent's skill dir. Read all three scripts before adding. They're ~200 lines combined.
- Keep Claude Code's Bash permissions strict if you run third-party skills.
Do not install skills you have not read. Your agent will. Use at your own risk.
ccmeta-core.sh is duplicated into each skill dir so every skill stays self-contained (Agent Skill installs don't guarantee files outside a skill dir ship). The canonical copy lives in shared/; the ones under skills/*/ are generated mirrors.
Always edit shared/ccmeta-core.sh, never the copies — any direct edit to a copy is clobbered on next sync.
After cloning, point git at the checked-in hook once:
git config core.hooksPath hooksNow every commit runs scripts/sync-shared.sh and stages any regenerated copies automatically. To re-sync without committing, just run the script:
./scripts/sync-shared.shTo share another file across skills, drop it in shared/ and add one line to SYNC_MAP in scripts/sync-shared.sh:
"my-shared.sh:ccmeta,ccmeta-dangerous"
Format: <filename-in-shared>:<comma-separated-skill-dirs>.
