How to Run Multiple Claude Code Sessions at Once
I use Claude Code for all my projects. Since requests can take 5+ minutes, I started running sessions in parallel.
Things got messy fast. Each project needed a Claude session, a dev server, and a terminal for git commands. Multiply that across projects and my laptop was drowning in terminal tabs.
So I got organized. Here's how I run 5+ Claude Code sessions at once without getting lost.
What is tmux?
tmux lets you run multiple terminals inside one tab. Close the tab, reopen it later, and everything is still running.
Key concepts:
- Session: A container that holds your terminal windows. It keeps running in the background, even if you close your terminal.
- Window: A single terminal screen. Sessions can have multiple windows, like browser tabs.
- Detach: Disconnect from a session. Like minimizing a window. It's still running, just hidden.
- Attach: Reconnect to a session to see it again.
Why tmux for Claude Code?
Claude Code sessions are long-running. You start a task, Claude works on it, and you might not need to look at it for 10 minutes. Meanwhile, you want to run git commands, check logs, or start another Claude session for a different task.
tmux makes this seamless:
- Parallel work: Claude is implementing a feature in window 1 while you run tests in window 2. No waiting.
- Persistent sessions: Close your laptop, reopen it tomorrow, and
tmux attachbrings everything back. Claude's output, your terminal history, all of it. - Mental clarity: Each project lives in one place. Switch projects by switching terminal tabs. Switch tasks within a project by switching tmux windows.
The Setup: One Tab Per Project
The solution is simple:
- One terminal tab per project
- One tmux session inside each tab
- Multiple tmux windows inside each session (Claude Code, terminal, dev server, etc.)
Your terminal tabs stay organized. One tab = one project. Inside that tab, tmux handles everything else.
Click the project tabs at the top to switch projects. Click the tmux windows at the bottom to switch between Claude, terminal, and dev server. No more hunting. Everything for a project lives in one place.
Customize for your setup
Install tmux
brew install tmuxThat's it. You're ready.
The 4 Commands You Need
1. Create a Session
Open a new terminal tab for your project, then run tmux new -s myproject:
Replace myproject with your project name. You're now inside a tmux session.
2. Create a Window
Inside your session, press Ctrl+bthenc to create windows:
Create one for Claude Code, one for your terminal, one for your dev server.
3. Switch Between Windows
Ctrl+bthennnext window
Ctrl+bthenpprevious window
Ctrl+bthen0jump to window 0 (or 1, 2, 3...)
4. Detach and Reattach
Need to pause a project? Press Ctrl+bthend to detach:
Your session keeps running in the background. Claude Code stays active. Run tmux attach -t myproject to come back.
My Typical Setup
For most projects, I have 3 windows:
- claude: main Claude Code session
- terminal: for git commands, quick scripts, anything manual
- dev: running
pnpm run devor whatever starts my dev server
For bigger features, I add a 4th window with a second Claude Code session running in a git worktree. Two Claude instances working on the same project, different branches.
Cheat Sheet
| Action | Keys |
|---|---|
| New session | tmux new -s name |
| New window | Ctrl+bthenc |
| Next window | Ctrl+bthenn |
| Previous window | Ctrl+bthenp |
| Jump to window # | Ctrl+bthen0-9 |
| Rename window | Ctrl+bthen, |
| Kill window | Ctrl+bthen& |
| Rename session | Ctrl+bthen$ |
| Detach | Ctrl+bthend |
| Reattach | tmux attach -t name |
| List sessions | tmux ls |
Start Now
- Open a terminal
- Run
tmux new -s yourproject - Run
claude
When you need another terminal for this project, press Ctrl+bthenc to create a new window.
Playground
Try it yourself. Create sessions, add windows, switch around, detach and reattach.
tmux Playground
Want more like this? Get my best AI tips in your inbox.