cmux

作者 craigsc已验证

cmux: tmux for Claude Code

598
Stars
35
Forks
Shell
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/craigsc/cmux

快速入门

使用 cmux 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

cmux — tmux for Claude Code

Run a fleet of Claude agents on the same repo — each in its own worktree, zero conflicts, one command each.

Claude Code works best when it has full ownership of the working directory. Want two agents working in parallel? They'll stomp on each other — conflicting edits, dirty state, broken builds. You need separate checkouts.

Git worktrees are the perfect primitive for this. They share the same .git database but give each agent its own directory tree — no cloning, no syncing, branches stay in lockstep. cmux wraps the entire worktree lifecycle into single commands so you can spin agents up, jump between them, and tear them down without thinking about it.

You wanna go fast without losing your goddamn mind. This is how.

Install

curl -fsSL https://github.com/craigsc/cmux/releases/latest/download/install.sh | sh

Then add .worktrees/ to your .gitignore:

echo '.worktrees/' >> .gitignore

Quick start

cmux new <your feature name>       # creates worktree + branch, runs setup hook, opens Claude

That's it. One command, one agent, fully isolated. See Workflow for the full loop.

Commands

CommandWhat it does
cmux new <branch> [--from <base>]Create new worktree + branch, run setup hook, launch Claude
cmux start <branch>Continue where you left off in an existing worktree
cmux cd [branch]cd into a worktree (no args = repo root)
cmux lsList active worktrees
cmux merge [branch] [--squash]Merge worktree branch into your primary checkout (no args = current worktree)
cmux rm [branch | --all]Remove a worktree and its branch (no args = current, --all = every worktree with confirmation)
cmux init [--replace]Generate .cmux/setup hook using Claude (--replace to regenerate)
cmux updateUpdate cmux to the latest version
cmux versionShow current version

Workflow

You're building a feature:

cmux new feature-auth        # agent starts working on auth

Bug comes in. No problem — spin up another agent without leaving the first one:

cmux new fix-payments        # second agent, isolated worktree, independent session

Merge the bugfix when it's done:

cmux merge fix-payments --squash
cmux rm fix-payments

Need a sub-feature off an existing branch? Use --from:

cmux new auth-oauth --from feature-auth   # branches from feature-auth instead of main

Come back tomorrow and pick up the feature work right where you left off:

cmux start feature-auth      # picks up right where you left off

The key distinction: new = new worktree, new session. start = existing worktree, continuing session.

Setup hook

When cmux new creates a worktree, it runs .cmux/setup if one exists. This handles project-specific init — symlinking secrets, installing deps, running codegen. If no setup hook exists, you'll be prompted to generate one.

The easy way — let Claude write it for you:

cmux init

Or create one manually:

#!/bin/bash
REPO_ROOT="$(git rev-parse --git-common-dir | xargs dirname)"
ln -sf "$REPO_ROOT/.env" .env
npm ci

See examples/ for more.

How it works

  • Worktrees live under .worktrees/<branch>/ in the repo root
  • Branch names are sanitized: feature/foo becomes feature-foo
  • cmux new branches from the repo's default branch (detected via remote HEAD, then main, then master). Use --from <branch> to branch from a different base
  • cmux new is idempotent on the worktree — if it already exists, it skips creation and setup, but still launches a new Claude session
  • cmux merge and cmux rm with no args detect the current worktree from $PWD
  • Pure bash — just git and the Claude CLI

Tab completion

You never have to remember branch names. Built-in completion for bash and zsh — automatically registered when you source cmux.sh, no extra setup.

  • cmux <TAB> — subcommands
  • cmux start <TAB> — existing worktree branches
  • cmux cd <TAB> — existing worktree branches
  • cmux rm <TAB> — worktree branches + --all
  • cmux merge <TAB> — worktree branches
  • cmux init <TAB>--replace

Community

ProjectDescription
claude-orchestration-in-cmuxClaude Code skill that turns one session into an orchestrator -- discovers panes, delegates tasks to other Claude sessions, monitors progress via screen polling, and manages the full commit-merge-rebase cycle with worktree isolation.

License

MIT

常见问题

What is cmux?

cmux is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by craigsc. cmux: tmux for Claude Code. It has 598 GitHub stars.

Is cmux safe to use?

Yes. cmux passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install cmux?

Clone the repository with "git clone https://github.com/craigsc/cmux" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is cmux written in?

cmux is primarily written in Shell. It is open-source under craigsc on GitHub, so you can review or fork the full source.

Are there alternatives to cmux?

Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh cmux against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ui-ux-pro-max-skill

by nextlevelbuilder

12

An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.

119,92012,870Python
CLI 工具ai-skillsantigravity
查看详情

happy

by slopus

Mobile and Web client for Codex and Claude Code, with realtime voice, encryption and fully featured

23,4501,980TypeScript
CLI 工具
查看详情

claudecodeui

by siteboon

Use Claude Code, OpenCode, Cursor CLI, and Codex on mobile and web with CloudCLI (aka Claude Code UI). CloudCLI is a free open source webui/GUI that helps you manage your Claude Code session and projects remotely.

13,3941,866TypeScript
CLI 工具
查看详情

CRS-自建Claude Code镜像,一站式开源中转服务,让 Claude、OpenAI、Gemini、Droid 订阅统一接入,支持拼车共享,更高效分摊成本,原生工具无缝使用。

12,5471,869JavaScript
CLI 工具
查看详情

ccstatusline

by sirmalloc

🚀 Beautiful highly customizable statusline for Claude Code CLI with powerline support, themes, and more.

12,508545TypeScript
CLI 工具
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情