Back to blog

How to Run Multiple Claude Code Sessions at Once

January 10, 20263 min read
Share:

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 attach brings 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.

▄ ▄ ███ █ █
Claude Code v2.1.3
Opus 4.5 · Claude Max
~/projects/willness-dev
Try "fix lint errors"
[willness.dev]
tmux

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

Terminal
brew install tmux

That'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:

~ $
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:

▄ ▄ ███ █ █
Claude Code v2.1.3
Opus 4.5 · Claude Max
~/myproject
Try "fix lint errors"
[myproject]
tmux

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...)

▄ ▄ ███ █ █
Claude Code v2.1.3
Opus 4.5 · Claude Max
~/myproject
Try "fix lint errors"
[myproject]0:claude*1:terminal2:dev
tmux

4. Detach and Reattach

Need to pause a project? Press Ctrl+bthend to detach:

▄ ▄ ███ █ █
Claude Code v2.1.3
Opus 4.5 · Claude Max
~/myproject
Try "fix lint errors"
[myproject]0:claude*1:terminal
tmux

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:

  1. claude: main Claude Code session
  2. terminal: for git commands, quick scripts, anything manual
  3. dev: running pnpm run dev or 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

ActionKeys
New sessiontmux new -s name
New windowCtrl+bthenc
Next windowCtrl+bthenn
Previous windowCtrl+bthenp
Jump to window #Ctrl+bthen0-9
Rename windowCtrl+bthen,
Kill windowCtrl+bthen&
Rename sessionCtrl+bthen$
DetachCtrl+bthend
Reattachtmux attach -t name
List sessionstmux ls

Start Now

  1. Open a terminal
  2. Run tmux new -s yourproject
  3. 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

Terminal
~ $
tmux new -s myproject
Session

Want more like this? Get my best AI tips in your inbox.