One-command setup for persistent tmux sessions — designed for AI coding CLIs like Claude Code, OpenAI Codex, and similar tools.
AI coding CLIs run in your terminal. If the terminal closes, you lose your session. cc-tmux fixes this with two shell commands:
| Command | What it does |
|---|---|
cc |
Jump into a default tmux session named claude (creates it if needed) |
ccl |
Interactive picker (via fzf) — attach to an existing session or create a new one |
It also configures tmux with sensible defaults: mouse scrolling and 200k line history.
curl -fsSL https://raw.githubusercontent.com/JingxuanKang/cc-tmux/main/setup.sh | bashOr clone and run locally:
git clone https://github.com/JingxuanKang/cc-tmux.git
cd cc-tmux
bash setup.shThen reload your shell:
source ~/.zshrc # or ~/.bashrc- Installs
tmuxandfzf(via Homebrew on macOS, apt on Linux) - Writes a minimal
~/.tmux.conf(mouse on, 200k history) - Adds
ccandcclshell functions to your rc file (~/.zshrcor~/.bashrc)
You can also use this as a Claude Code skill. Clone this repo and the skill is available via /cc-tmux in Claude Code:
git clone https://github.com/JingxuanKang/cc-tmux.git
cd cc-tmux
claude # start Claude Code in this directory
# then type: /cc-tmuxOr install it globally so it works in any project:
mkdir -p ~/.claude/skills/cc-tmux
curl -fsSL https://raw.githubusercontent.com/JingxuanKang/cc-tmux/main/.claude/skills/cc-tmux/SKILL.md \
-o ~/.claude/skills/cc-tmux/SKILL.md- macOS (Homebrew)
- Linux (apt-based: Ubuntu, Debian, etc.)
Remove the managed block from your shell rc file (between # >>> tmux-cc-ccl >>> and # <<< tmux-cc-ccl <<<), then optionally delete ~/.tmux.conf.
MIT