BEFORE manually calling cmux set-status or writing chpwd hooks for workspace coloring, use this skill. Manages workspace color rules that auto-apply based on directory patterns. Handles config creation, zsh hook installation, rule management, and on-demand workspace coloring via cmux set-status. Triggers on "cmux setup", "workspace colors", "color this workspace", "add color rule", "project colors", or any request to visually differentiate cmux workspaces.
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Manage cmux workspace visual configuration. Currently handles automatic workspace coloring based on directory-pattern rules.
apply, not config management)SKILL.md to ~/.claude/commands/cmux-setup.mdscripts/cmux-setup.js to ~/.local/bin/cmux-setup.js
and chmod +x itfind command in Script Locationif [[ -n "${CLAUDE_SKILL_DIR:-}" ]]; then
CMUX_SETUP="${CLAUDE_SKILL_DIR}/scripts/cmux-setup.js"
else
CMUX_SETUP="$(find ~/.claude -path "*/cmux-setup/scripts/cmux-setup.js" \
-type f 2>/dev/null | head -1)"
fi
if [[ -z "$CMUX_SETUP" || ! -f "$CMUX_SETUP" ]]; then
echo "Error: cmux-setup.js not found." >&2
fiStore in CMUX_SETUP and use for all commands below.
node "$CMUX_SETUP" apply [dir] # Apply matching rule to workspace (default: cwd)
node "$CMUX_SETUP" list # List all configured rules
node "$CMUX_SETUP" add --pattern <glob> --color <hex> --icon <sf.symbol> --label <text>
node "$CMUX_SETUP" remove --pattern <glob> # Remove rule by pattern
node "$CMUX_SETUP" match [dir] # Show which rule matches a directory
node "$CMUX_SETUP" install-hook # Install zsh chpwd hook in ~/.zshrc
node "$CMUX_SETUP" uninstall-hook # Remove zsh chpwd hook from ~/.zshrcUse when the user wants colors applied automatically on every directory change.
add with --pattern, --color, --icon, --label.install-hook to register the zsh chpwd hook.apply (no args) to color the current workspace immediately.source ~/.zshrc (or open a new terminal) so the hook
takes effect in the current session.Use when the user wants to color the current workspace once without persisting any config.
With existing config: Run apply and the best matching rule is used.
Ad-hoc (no config): Call cmux directly — no script needed:
cmux set-status project "Label" --color "#HEX" --icon "icon.name"This is ephemeral — the color is gone when the workspace closes or a new rule overwrites it.
Handle these conversational requests:
| Request | Action |
|---|---|
| "Add a rule for ~/work" | Ask for color, icon, label; run add |
| "Show my rules" | Run list |
| "Remove the ~/work rule" | Run remove --pattern ~/work |
| "What matches here?" | Run match (no args = cwd) |
| "What would match ~/repos/foo?" | Run match ~/repos/foo |
When adding a rule, ask for all four fields (--pattern, --color, --icon,
--label) in one prompt if not already provided. Don't ask one at a time.
Location: ~/.config/cmux-setup/rules.json
~ (expanded to $HOME at match time)/* is a recursive prefix match — ~/work/* matches any path
under ~/work//* are exact matchesExample:
{
"rules": [
{
"pattern": "~/repos/ai/*",
"color": "#7B2FBE",
"icon": "brain",
"label": "AI"
},
{
"pattern": "~/work/*",
"color": "#0066CC",
"icon": "briefcase",
"label": "Work"
}
]
}cmux-setup uses the status_key from config (default: "project") in
sidebar metadata. cmux-demo uses demo-specific keys. They coexist
without conflict.