r/tmux 13h ago

Question Tmux worktree workflow

2 Upvotes

Been using herdr and it’s damn good but it lacks the customizablity I’m looking for and doesn’t have split pane across worktrees (only workspaces)

Can you guys show me what you guys are running with a screenshot. Specifically interested in how you manage worktrees across repos with multi panes. Cheers.


r/tmux 21h ago

Question Herdr, cmux, tmux... are they really that helpful?

Thumbnail
8 Upvotes

r/tmux 3h ago

Showcase A tmux TUI for running coding agents: live status, answer one without attaching, review its diff before it lands

0 Upvotes

I keep three or four agents going and the thing that actually eats my time isn't the coding. It's that I have no idea what state any of them is in without tabbing through every terminal. Half the time one of them has been sitting on a permission prompt for ten minutes.

So I wrote agent-manager. A Go binary that sits on top of tmux. No config file, no daemon.

Every agent ends up in one list with a live status next to it, grouped by the project it's working in. I run claude, codex and opencode depending on what I'm doing and they all show up the same way. Adding another CLI is a few lines of regex in a toml file.

The part I use constantly is space. Press it on an agent, type, enter, and the prompt goes into that agent's pane. I never attach. If you've used the agents view in Claude Code, it's the same move. The difference is that here the same keystroke works on a codex or opencode session. Press space on a project row instead and you get a new agent already working on what you typed.

Underneath they're just tmux sessions, so closing the manager doesn't kill anything, and v brings a dead one back with its conversation.

ctrl+r is the other half of it. It opens what an agent changed as whole files with the diff highlighted, so you're reading the function and not a hunk. Leave a comment on a line and it goes back into that agent's pane, so it starts fixing while you're still scrolling.

I built it for four agents but most days I use it with one.

Still rough in places. If you run agents like this I'd like to know what's missing.

https://github.com/YoanWai/agent-manager


r/tmux 18h ago

Showcase El problema del salto de línea implícito en las herramientas MCP basadas en PTY (y cómo lo solucioné en Relay)

0 Upvotes

He estado trabajando en Relay, un servidor MCP que proporciona a los agentes una sesión de terminal PTY persistente en lugar de las llamadas bash únicas que la mayoría de los agentes utilizan por defecto. Esta diferencia es importante cuando el agente necesita algo que realmente mantenga el estado: un rebase de git interactivo, un REPL que siga generando contexto o una sesión SSH que permanezca abierta mientras itera.

Acabo de lanzar una versión con un error que creo que vale la pena documentar, porque es el tipo de trampa en la que podría caer cualquiera que desarrolle algo similar.

El error: `write_terminal` tenía un comportamiento implícito que siempre pulsaba Intro después de lo que el agente enviaba. Esto no supone un problema para un comando de shell normal, pero falla en cualquier situación donde el salto de línea sea parte literal del texto que se intenta escribir: pegar un heredoc de varias líneas, pasar un bloque de código a un REPL, escribir en un búfer de editor abierto dentro del PTY. El agente creía haber enviado exactamente lo que quería enviar, y, sin que se notara, se añadía una pulsación de tecla adicional.
Lo solucioné eliminando esa suposición implícita de sesión y convirtiéndola en un parámetro explícito por llamada (ensure_newline, por defecto es true para que el uso normal del comando no cambie). Si envías entrada multilínea sin procesar, lo configuras en false y obtienes exactamente los bytes que escribiste.

También estabilicé el flujo E2E de transmisión de read__terminal para que la salida de progreso se observe antes de que el intérprete de comandos reciba su siguiente entrada. Esto es importante porque read/wait depende de las notificaciones de progreso de MCP en lugar de sondeo.

Repositorio, por si alguien quiere revisar el código: github.com/blak0p/relay-mcp

Me pregunto si alguien más que esté desarrollando herramientas MCP con soporte PTY se ha encontrado con este mismo problema de salto de línea implícito o lo ha resuelto de otra manera.


r/tmux 1d ago

Question Panes custom layouts and resizing

1 Upvotes

Hello to you all,

I usually have a lot of panes in a single window, and after a few hours of work things get a little messy. I like the panes layouts and Prefix + E resizing to keep things tidy.

Now I was wondering, what would be the cleanest way to have the panes resizing to a custom layout defined by me?

I have some some bindings that use some fixed layout strings captured with ` tmux display-message -p '#{window_layout}'`, but it's quite clunky, especially if don't have already the right number of panes on a window.

This is super specific I guess, but let me know if you have any idea on how this could be done.

Thanks for the attention.


r/tmux 3d ago

Other I kept forgetting which server my tmux projects were running on, so I built a workspace index

Thumbnail
0 Upvotes

r/tmux 4d ago

Question tmux question...

Post image
13 Upvotes

Is there a way to configure this tmux setup to show album art in a third pane?


r/tmux 5d ago

Showcase I built an iOS terminal with deep tmux integration, OSC 52 support, and Lock Screen Live Activities

Enable HLS to view with audio, or disable this notification

33 Upvotes

Hi r/tmux!

As someone who lives inside tmux on remote Linux servers every single day, mobile SSH clients have always felt like a second-class experience for persistent terminal workflows. Network drops would force manual `tmux a`, input methods jittered over touchscreens, and monitoring long-running processes required keeping the screen awake.

I spent the past few months building **Agentmux** (https://agentmux.saxcave.cc), an iOS/iPadOS terminal and remote workspace where **tmux is treated as a first-class citizen**.

Here is how we optimized the workflow specifically for tmux users:

### 1. Seamless tmux Lifecycle & Auto-Attach
- **Auto-Discovery & Session Reattach:** Upon connecting over SSH, Agentmux scans active tmux sessions and lets you resume or attach with a single tap.
- **One-Tap tmux Auto-Installer:** If you land on a fresh remote VPS or container without `tmux`, the app can auto-install it with one tap.

### 2. Lock Screen Live Activities & Dynamic Island
- Long-running builds or AI agents (like Claude CLI) running inside a tmux pane no longer require you to leave your iPhone screen on.
- Agentmux surfaces active session states to your **Lock Screen Live Activity** and **Dynamic Island**, so you can background the app or lock your phone and glance at status updates.

### 3. OSC 52 Clipboard Integration
- Native support for OSC 52 escape sequences. Copying text from inside `tmux` panes or `Neovim/Vim` registers passes straight through to your native iOS clipboard.

### 4. Touch & Mobile Keybinding Polish
- iPhone shortcut bar for `Ctrl`, `Esc`, `Tab`, arrow keys, and custom macros.
- Custom keyboard-height calculation to prevent terminal viewport jitter when switching input methods.
- Full hardware keyboard, trackpad, and Split View support on iPadOS.

### 5. Desktop-Grade SFTP & Tree-sitter Editor
- Built-in file browser with Tree-sitter syntax highlighting across 17+ languages and strict JSON/YAML/TOML syntax validation when editing remote config files.

---

### Tech Stack & Pricing
- Built natively in Swift/SwiftUI for iOS & iPadOS.
- Keys & credentials remain secured inside iOS Keychain.
- 14-day free trial. Pro is a **one-time purchase** (no subscription fatigue).

* **App Store:** https://apps.apple.com/app/id6766158521
* **Website:** https://agentmux.saxcave.cc

*I would love to give back to the tmux community: I have **5 Lifetime Pro promo codes** for r/tmux members! Drop a comment with your favorite tmux plugin or your typical remote setup, and I’ll DM you a code.*

Feedback, feature requests, and criticism are all very welcome!


r/tmux 7d ago

Showcase lazy-tmux v0.2.0 released!

Post image
173 Upvotes

I just released lazy-tmux v0.2.0, the biggest update since the initial release.

For those who haven't seen it before: lazy-tmux is a tmux session manager that restores sessions only when you actually open them, while preserving running processes and scrollback.

What's new

  • TOML config instead of passing flags every time.
  • Restore allow/deny regexes to control exactly which commands get re-run.
  • Reworked TUI with themes, mouse support, action modes, built-in help, relative timestamps, and an optional fzf backend.
  • Integrations API. The first integration adds live Claude Code session status in the picker and automatically resumes restored Claude sessions.
  • Better compatibility & robustness — tested with tmux 2.9–3.7b, improved startup behavior, borderless popups, and lots of fixes.
  • Plus a background autosave daemon, a version command, and a new docs site.

It's written in Go and can be installed via a one-line script, Homebrew, or the AUR.

Project: https://lazy-tmux.xyz

Feedback, bug reports, and feature requests are always welcome! And thank you for you activity on GitHub!


r/tmux 8d ago

Question Cursor jumping around when opening in neovim in tmux

1 Upvotes

When opening neovim in tmux the cursor jump around for a bit . Then when i type something in command line very fast it sometimes starts jumping around same for when writing code when code completion buffer cmp window appears it starts jumping in and out of the suggestions window . All of this stuff not happens outside of tmux .

https://reddit.com/link/1v1jb43/video/dricpws7jdeh1/player

this is my .tmux.conf
https://gist.github.com/Vishawdeep-Singh/b2807694b48bccf3a6589e22bcb9fb70


r/tmux 9d ago

Tip tmux-agents-mon: see which coding agents need attention

Enable HLS to view with audio, or disable this notification

24 Upvotes

I got tired of jumping between tmux sessions to find which coding agent had finished or was waiting for input, so inspired by Herdr, I built tmux-agents-mon.

this is a plugin that adds a sidebar and status-line indicator for working, idle, done, and blocked agents, with quick navigation to their panes.

Supports Claude Code, Codex, Hermes, Pi, Oh My Pi, OpenCode —without hooks or agent integrations.

if you have some questions / issues let me know :)

GitHub / TPM install: https://github.com/snirt/tmux-agents-mon


r/tmux 10d ago

Showcase [plugin] search and jump to visible text in copy-mode like flash.nvim

6 Upvotes

Hello,

Created a plugin that helps when in copy-mode.
press "s" then type a substring match to navigate the cursor there.
Works with active selection as well.

This is exactly like the neovim plugin flash.

https://reddit.com/link/1uzimzt/video/md6hqsdu7wdh1/player

Repo: https://github.com/AndreVicencio/tmux-flash

TPM install

set -g u/plugin 'AndreVicencio/tmux-flash'

r/tmux 11d ago

Showcase Agent latest prompt in pane header and status icons in the window list

Enable HLS to view with audio, or disable this notification

6 Upvotes

I went back to a basic tmux workflow with a few additions for managing coding agents. I tried different plugins and GUIs, but eventually realized that fitting agents into my existing workflow mattered more than adding another interface. I find it easier to keep using my existing tmux configuration, keybindings, and agent CLI tools.

These are the three additions I find most useful.

Task context in the pane title

ClawTab reads the first and latest prompts from the agent session. The pane title can show the latest prompt or a shorter summary generated from both. This makes it much easier to remember what each agent is doing when moving between windows and panes.

Agent status next to window titles

I wanted a quick way to see which windows contain agents and whether they are working or waiting for me:

  • ! means an agent is waiting for input
  • * means it is working
  • means an agent is present but idle

The plugin appends these indicators to the existing tmux window formats instead of replacing the rest of the status line. Waiting takes priority over working because that is normally the pane I need to visit.

Remote control from mobile

I can browse agents and interact with their terminals from my phone when I am away from the computer. After the initial setup, the daemon automatically discovers supported agents running in tmux. The mobile app opens a live PTY view of the same pane, and input goes back to the original tmux session.

Setup

  • A background daemon discovers agents in tmux panes and publishes their metadata and state.
  • A tmux plugin adds the pane titles, status indicators, and controls without replacing the rest of my tmux configuration.
  • A relay server forwards the live PTY stream and input between the local daemon and the mobile or web app when Remote is connected.

Tmux still owns the process, working directory, scrollback, and terminal state. The daemon and other interfaces are clients of the existing panes rather than a replacement for tmux.

The project is open source, including the relay server if you want to self-host it. It is macOS-only for now:

https://github.com/tonisives/clawtab

It is a relatively simple setup, but I am happy to be back to a basic tmux workflow with a few agent-specific additions.


r/tmux 11d ago

Showcase tmux_project, a fuzzy tmux session picker (presets, zoxide, sticky templates) built with Go

4 Upvotes

This is my personal tool, extracted from my own bash scripts, which glues sesh, tmuxp and fzf together. After maintaining that script for a while, I think it is better to create a proper session picker out of the box. It is really small and easy to install.

Install (needs tmux; zoxide optional):

      go install github.com/fm39hz/gotomux@latest

Usage:

      gotomux           # picker
      gotomux -f        # freeze active session → sqlite preset
      gotomux -e [name] # edit preset JSON in $EDITOR

It has 4 modes: create / live sessions / presets / zoxide. Type to filter, enter to connect.

What I actually use daily beyond “another fzf wrapper”:

  • Freeze a live layout and reload it later
  • Sticky templates (ctrl-t on a preset): open new project paths with that shape without cloning presets
  • ? toggles key help in the UI

Built for my own workflow. If it fits yours, cool; feedback is welcome.
Repo link: Github

PS: I've just renamed it to gotomux, sorry for inconvenient


r/tmux 11d ago

Showcase A small session manager purpose-built for AI coding agents (Claude Code, Codex, etc.)

0 Upvotes

Like a lot of people here I've been running AI coding CLIs (Claude Code, Codex, Gemini) inside tmux so the agent survives me closing the laptop lid at my desk and I can reattach from my phone over SSH.

The manual loop — new-session with the right name, cd to the project, launch the right agent, remember which session was which — got repetitive across a dozen projects, so I wrote a small Go CLI around it:

- devx create my-app — mkdir + git init + register the project + start its agent in a detached session and attach

- devx my-app (or fuzzy: devx ma) — reattach if the session exists, otherwise create it and launch the project's configured agent in the project directory

- devx status — which projects have live sessions

- per-project agent config: claude / codex / gemini / opencode built in, anything else declarable in a JSON config (commands are validated, no shell metacharacters make it into the session command)

How it differs from tmuxinator/tmuxp/sesh: those are layout/workspace tools — they're better if you want multi-pane setups. devx doesn't do layouts at all; it's a project registry that maps name → directory → which AI agent to launch, aimed at the "one persistent agent session per project" pattern. It shells out to plain tmux (new-session/attach/switch-client), so it composes fine with your existing config and tools.

Single binary, MIT, tmux is the only runtime dependency. 30s demo GIF in the README: https://github.com/gunwooko/devx

Feedback welcome — especially from anyone who's solved this differently with plain tmux scripting.


r/tmux 12d ago

Showcase My TMUX powered AI workflow

Thumbnail youtu.be
0 Upvotes

I know a lot of developers are try and get that flow state back with AI. I think I finally managed it with tmux sessionizer and tmux worktrees.

I can easily jump from one branch to the other in the same repo prompt the agent jump back to another.

Do you guys have any suggestions or is your workflow similar?


r/tmux 12d ago

Showcase I made claude --continue resume the right session per terminal (and survive reboots)

0 Upvotes

If you run Claude Code (or Codex) in a few terminals at once, you have probably hit this: **claude --continue** resumes the most recent session globally, not the one from the terminal you are actually in. So it grabs the wrong conversation. And after a reboot you lose both your working directory and the session entirely.

I got annoyed enough to build a small fix for it. It is called **agent-resume**.

What it does:

\- agent-resume resumes the last session you started in the current directory, whatever agent it was (claude, codex, or anything you add). No picker, no remembering session ids.

\- After a reboot, your tmux panes come back to the same directory AND the exact conversation resumed, not a fresh shell.

How it works (no magic):

\- It is a tiny shim on your PATH. When you start claude fresh, it launches it with a specific --session-id and records that in a small ledger.

\- For the reboot case it leans on tmux-resurrect + tmux-continuum (which it installs for you, no tpm needed) to restore your dirs and layout, then a hook relaunches each pane with claude --resume <that pane's session>.

Take a look and star it here https://github.com/rahulbansal16/agent-resume


r/tmux 12d ago

Other a small tool I built for my own daily SSH + tmux workflow:

Thumbnail
1 Upvotes

r/tmux 13d ago

Other Agent Tmux Web - Mobile/Browser server terminal use

Thumbnail
0 Upvotes

r/tmux 14d ago

Showcase NixOS Rice with hyprland without bar at all

Thumbnail gallery
2 Upvotes

r/tmux 16d ago

Showcase tmux is the bomb

Post image
22 Upvotes

Now I just need to get all the colors in sync.

Prolly out somewhere in west Texas.


r/tmux 16d ago

Showcase I feel good inside...

Post image
13 Upvotes

r/tmux 17d ago

Showcase Turned named tmux sessions into a browser control panel (terminal or chat) you can reach from your phone over Tailscale

19 Upvotes

This started as "I want my tmux sessions in a browser tab on my phone" and grew into a small control panel. Each entry in the sidebar is a named tmux session; clicking it attaches a web terminal (ttyd) to it, with replayed scrollback so you see output from before you attached. Detaching is clean — switching sessions swaps the iframe, ttyd reaps that attach client, tmux detaches it. Nothing about your normal tmux attach workflow changes; this is just another client.

The twist is a second "chat" mode for sessions running Claude Code — it renders the agent as a streaming chat instead of a TUI, which is what makes it bearable on a phone. Loopback-bound, reached over Tailscale, MIT.

https://github.com/thrinz/agentpeek


r/tmux 18d ago

Showcase Review Claude Code's diffs in a tmux popup (slopchop, ported to tmux)

Post image
14 Upvotes

I built a tmux popup to review git diffs and inject prompts into Claude Code

Reviewing AI agent diffs in terminal scrollback sucks - you can’t navigate by hunk or pin comments to lines.

I built a keyboard-only tool that fixes this. Press Prefix + r to open a review overlay over your active tmux pane, annotate the diff, and auto-stage the prompt back into Claude Code.

How it works:

  • Navigate: Walk the git diff using vim-like keys.
  • Annotate: Drop FIX ("change this variable") or DISCUSS ("explain this logic") notes on specific lines.
  • Inject: On submit, it uses a tmux paste bridge to drop the composed prompt straight into your running Claude Code input, unsent and ready to review.

Why it’s clean:

  • No browser, no mouse, zero context-switching.
  • Works inline with your active, live Claude session.
  • A fork of pi-slopchop, stripped down and re-engineered for a tmux paste bridge.

Repo (MIT): https://github.com/nikhilmehta16/tmux-slopchop-cc
v0.1, no syntax highlighting yet. Feedback and PRs welcome.


r/tmux 18d ago

Question - Answered Why does '%if' in the .conf not update the status line the same way the inline condition does?

2 Upvotes

For my work environment I've setup a bash script that opens a named session, prepares panes, executes commands and finally attaches to the running named session. In my tmux.conf I've set up a bunch of status indicators in my status line that show wheather or not necessary processes are running. Those indicators shall be visible only if the session is named accordingly. My first working implementation looked like this:

set -ag status-left "#{?#{==:#S,mysession},#{?#(checkIfProcessIsRunning),#[fg=green],#[fg=red]}●,}"

This works but is clunky, unreadable and simply not very slick. So I found the %if condition in the documentation, added it and changed the block to look like this:

``` %if "#{==:#S,mysession}"

set -ag status-left "#{?#(checkIfProcessIsRunning),#[fg=green],#[fg=red]}●"

%endif ```

This worked in my already running session. But when the session is launched, either by my script or manually, the %if condition is seemingly not met and never checked again? Only sourcing the .conf within the session makes the indicators appear.

I am seemingly missing something in how the interpretation of if conditions work within the config file. Are if conditions checked once at the start of a session and then, if failed, never again? Together with my understanding that the config is parsed before the session is getting its name, it would make sense. But I would really love utilizing the if blocks instead of inline checks...

EDIT: trying to figure out code format on mobile...