# Claude Code now spins up a git worktree and tmux session with one flag

Original title: Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling

> Hacker News story 50148855 · language: en · submitted 2026-10-19
> Web version: https://zeli.app/story/50148855
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 166 · by [ankitg12](<https://news.ycombinator.com/user?id=ankitg12>) · 💬 125
[original](<https://crystl.dev/guides/tmux-for-ai-agents/>) · [HN discussion](<https://news.ycombinator.com/item?id=50148855>)

## Summary

Tmux keeps long-running coding agents alive through closed terminals and dropped SSH links, and lets you script them with send-keys and capture-pane. Recent Claude Code versions bundle the basics: claude --worktree --tmux creates an isolated worktree and a session in one command. The guide then covers what the flag doesn't reach — per-project session naming, pane layouts, a tuned .tmux.conf, reliable send-keys patterns, and a status-line monitor — before showing exactly where tmux stops.

## Key quote

> The tmux server is just a process owned by your user. Nothing about tmux makes it survive a reboot, and a session's scrollback is lost when the server stops.

## HN discussion (125 comments)

### [hatradiowigwam](<https://news.ycombinator.com/item?id=50153057>)

> If you aren't familiar with tmux(or GNU screen), you owe it to yourself to become familiar. If you are a deveoper/sysop/cli-type it will act as a force multiplier. It takes 10 minutes to get setup and learn the basic hotkeys - and you will save many orders of magnitude of your time. One of the best learn-some-software investments you can make IMHO.
>
> PS: This applies to /alot/ of software though...not just tmux. See: vim, emacs, bash, zsh.... the difference between a new or non-learned user is /vast/ compared to someone that spends 10 minutes and learns the basic of these tools. This is one of your first steps into greybeard mastery.

### [Scea91](<https://news.ycombinator.com/item?id=50152750>)

> I used Claude Code in tmux since January until August.
>
> Now I am 100% in the ChatGPT desktop app, because it felt I am doing way too much tinkering amd maintenance of my setup instead of doing real work.
>
> Retrospectively, it feels tmux was right choice early this year as the alternatives just weren’t there. It was also fascinating and enjoyable building own workflow from the primitives and I did learn a lot, but the learning has plateued and what was left was mostly chore.

### [f311a](<https://news.ycombinator.com/item?id=50150383>)

> This website is so hard to read on a 15" retina screen.
>
> The text content occupies like 20% of the screen, the rest is empty.
>
> Resizing the window helps.

### [zackham](<https://news.ycombinator.com/item?id=50151041>)

> Like others here I created my own terminal multiplexer as well. Daemon that holds all sessions, seamless binary upgrades so those sessions never get lost, everything recorded so recovery is always possible, thin client mode so laptop has a native app that connects to daemon, and a wasm responsive webui with transcription so I can carry on with sessions from phone. Claude/codex sessions started with a uuid so they can be killed/resumed at will (mine autosleep after 12h inactivity to free resouces). CLI allows agent control of everything for a harness independent implementation of claude's channels. A few friends have forked and adopted it as their daily driver. Similar organization to herdr wrt spaces to organize sessions. Optimized for speed/bandwidth when running in thin client mode.
>
> https://github.com/zackham/seance

### [thomas_witt](<https://news.ycombinator.com/item?id=50149524>)

> I really liked Tmux and Zellij for the time being, but Herdr does it all so much better out of the box when it comes to agentic coding. I haven't found something I can do with tmux/zellij but can't do with herdr.

### [solumos](<https://news.ycombinator.com/item?id=50154463>)

> After using Tmux since 2015, I started using herdr for agents, and it's pretty great.

### [blfr](<https://news.ycombinator.com/item?id=50151287>)

> You can just install Claude Code on the server and drive it from Claude Desktop via remote control. That way you can control Claude Code on mutiple servers straight from your Claude Desktop, Mobile or Web, and stay fully within Anthropic tools.
>
> Everything works: you get the native view of subagents, you can upload files and images, fork threads, etc.
>
> The massive upside is that the actual work happens on the server so you can close your laptop and it will continue plus it will not fry your thighs. The advantage over sessions (which I haven't tried but theoretically sound) is that you can configure Claude's environment on the server however you like. Give it any tools you need, ssh access to other machines, sudo, whatever.
>
> The only downside is that every new project requires a setup step on the server (to add the systemd service) where you will develop it since Claude can only handle one server per directory. Claude will handle this step however if you give it ssh access to your server.
>
> The machines show up nicely in Claude Desktop/Mobile/Web, and repos/projects are in a dropdown. Unless you work on very many projects at the same time, this setup is golden.

### [vantassell](<https://news.ycombinator.com/item?id=50155661>)

> If you're using tmux with either worktrees or agents, I strongly recommend you check out workmux. It makes for such a clean setup.
>
> https://github.com/raine/workmux

---

## Cite

- Page: https://zeli.app/story/50148855
- Date: 2026-10-19
- Source: crystl.dev (https://crystl.dev/guides/tmux-for-ai-agents/)
- Hacker News: https://news.ycombinator.com/item?id=50148855

## Other languages

- zh: https://zeli.app/zh/story/50148855 · markdown: https://zeli.app/zh/story/50148855.md
- ja: https://zeli.app/ja/story/50148855 · markdown: https://zeli.app/ja/story/50148855.md
- ko: https://zeli.app/ko/story/50148855 · markdown: https://zeli.app/ko/story/50148855.md
- de: https://zeli.app/de/story/50148855 · markdown: https://zeli.app/de/story/50148855.md
- es: https://zeli.app/es/story/50148855 · markdown: https://zeli.app/es/story/50148855.md
- ru: https://zeli.app/ru/story/50148855 · markdown: https://zeli.app/ru/story/50148855.md
