Herdr: Agent multiplexer that lives in your terminal

4 months ago (github.com)

The utility is not obvious, but I've been using herdr for a few weeks after a friend recommended it, and it's been a great tool.

I had about a dozen different terminal windows, each one with multiple tabs, which was becoming a mess to manage; multiple agents and harnesses running that I could only inspect by remote access/VNC away from home.

With this, I can keep things more organized (project workspaces, tabs), because it's backed by a persistent process, I can ssh into the machine, with tailscale, run herdr and see all active sessions, do some debugging and one-off prompts.

Even better, I can do that from my phone and iPad using Prompt/Termius. It gives me the best part of 'xxclaw' harnesses with none of the complexity.

  • Couldn't you just use tmux for the remote access?

    • Short version, yes, but herdr is more mouse / touch friendly in my experience. I was using tmux for my mobile access before and after tweaking things it worked well, but herdr worked out of the box for me.

  • Does herdr with termius on android support touch/tap operation? I tried herdr on mac, it works really great. But i tried access it via termius from my android, I can't tap/interact with it. Am i missing something?

I switched from tmux to Zellij a while back, and lately added a stop hook that sends a terminal ping to the correct tab when the agent is done (and I'm not looking at the tab). It has been pretty convenient so far.

Added an example here:

https://johnny.chadda.se/zellij-stop-hook/

Will people really need a bunch of different agents? Even using two codex session for different project make me feel a bit overwhelmed, or may be i just old

  • Maybe not when answers will be almost instant, but the biggest gap to me now is latency, not capability. Having to wait for 5 minutes and more for an answer, I can switch to another project / feature / etc. and run work streams in parallel.

  • Same. I haven't been able to see how people let agent loops run without significant steering and produce good quality software. VS Code with one or two integrated terminals running is fine for me. Or a couple of VS Code instances if I'm working one a couple of projects concurrently. The advantage of VS Code is the code / diff visibility if you like to be hands on.

  • I often have many active. Bug investigations, writing code, reviewing, checking logs after deploys and so on.

  • I found that a good tool helps a lot once I switched to Github Copilot app. It solved the friction and mental tax for me. I easily manage 4 sessions in parallel on same or different projects while 2 was max in the past. The bottleneck now is only in review and decision making.

  • If you have more than one issue to work on, then you can open an agent for each one and go though them round-robin.

    Maybe very early on a greenfield project you only have one known issue (the next feature you're building), but other than that seems like short-changing yourself.

  • Nope, they need to signal, that they know what they are doing and chic, and very trendy. And agent cnt must be > 12, open windows cnt > 6 otherwise feels himself as a peasant.

  • yeah I also don't really see a use case for me, like do ppl really run that many agents in parallel that they cannot comfortably multiplex them using just a terminal emulator

    • I'm a power user and it's not an issue for me. I just use Kitty with multiple windows and panes. I can jump between using hotkeys with no problem.

Once you get it set up, Emacs is a pretty damn good "agent" multiplexer as well. I use agent-shell with Projectile on Doom Emacs as my main workflow these days, and it works very well even if I have 6 projects open or whatever.

Claude and Codex are also both quite good at working with Emacs as well. Depending on your isolation/sandboxing strategy, they can either run commands against your session via emacsclient (a bit scary) or dump elisp in the REPL for you to evaluate. Both are really efficient in terms of giving you a fast feedback loop.

  • If you like scary, there are also emacs based agents like gptel which support tools like "eval-elisp".

    A kitchen sink is almost indistinguishable from a sandbox, right?

    ... right?

    • Hahahaha. I think for the limited purpose of iterating on elisp code, using gptel or efrit to let an agent run wild and iterate in a live environment could be useful. I'd want to run that in a VM though, and not as my user or with access to personal data beyond reusable parts of my config.

Herdr is great, I've been using it for over a month now. Their API is awesome too - you can build tools around it.

  • Have you built anything around it? I was thinking it might be useful to potentially script based on space and tab name (like create dir named tab in space) and other little QOL workflow tweaks but haven't looked into it really.

Getting a lot of flack in all these comments, I really like this tool. Have been super easy to use and scale to multiple agents. I've had a ton of issues with tmux and copy and paste, this just works. I was using warp terminal, and even working on my own fork of it with it's recent open source status, but this has won me over.

I've been using this and it's been really nice for a specific use case: running agents locally alongside agents in a remote sandbox environment. Most apps managing this split seem to want to manage your sandbox for you, but we've already built out some nice tooling and infrastructure for that that meets our needs. I don't want to add a new vendor in the mix for our infra that may not exist in a year and that will be harder to integrate with. Combined with some additional tooling I made, herdr lets me easily connect to remote agent sessions, see their status in the sidebar and fluidly switch back to work on my local machine from one interface.

Multiplexing the agents is clearly the first obvious pain point, but the other one I keep encountering after this is visibility: with multiple agents running, it becomes difficult to see what each of them is doing, what program did they call, and where they are getting stuck until they complete or fail.

Is there any information from Herdr about what each agent is up to beyond the output? Or does it just concentrate on orchestration for the time being?

  • I’ve been using herdr for about a week. There is visibility into which terminals need attention and you can set up workspaces to organize it. I’ve enjoyed it so far though the key bindings are all over the place - likely due to it trying to avoid existing bindings.

One interesting thing that I couldn't find in these comments or in their docs (even in the https://herdr.dev/docs/preview/concepts/#mouse-ui section), is that Herdr supports native-feeling scroll. You can scroll with your mouse wheel. That to me is a killer feature over tmux

I started using this today and am really enjoying the notifications when agents are awaiting input, and the status indicators!

But it feels odd to have it outside of tmux. I've got everything else in tmux, but I have to switch to another terminal tab to get to my agents, and then back to my normal shortcuts. I find that a bit jarring... Is that what other folks are doing?

How do people use terminal multiplexers together with vim?

Ctrl+B is so hardwired in my fingers for scrolling back one screen that there's no way I'm remapping that one in vim itself. So then you have to remap that in your terminal multiplexer, while at the same time there's a bunch of people saying never change the leader key...

Curious what vim users especially do about this?

  • >Ctrl+B is so hardwired in my fingers for scrolling back one screen that there's no way I'm remapping that one in vim itself.

    Give it a month and whatever you remapped will be "hardwired" too.

    In any case, no reason to keep Ctrl-B in tmux either, you can remap that just as well.

  • As a vim user, I just remap C+B to C+A. It's much easier on the fingers too. Issue arises when I ssh somewhere that doesn't have the leader remapped but that's usually pretty rare when I have to vim in a tmux session on a remote host so not really an issue

  • I use tmux with vim and configure it to use Ctrl-a. Not for vim, but because I started with GNU screen that used this key. For the cases when I need actual Ctrl-a, tmux is configured to send it when I do “Ctrl-a a”.

does it support a setup where each agent can be in a different SSH session? or must they all run in the same place.

it seems to support running a remote herdr over SSH but unclear if it can add remote agents (each agent has its own sandbox where its installed and you first SSH into it and then start the agent there)

This is way to complex... Why don't just use some harness which manages all that and give u a good UI?

I started building my own version of this before I discovered herdr, and while its not quite the same it's improved my development workflow by an order of magnitude. https://jmux.build

I am going to give them a try side by side!

I finally switched to Zed + Terminal Thread + Tmux.

The terminal agent threads allow me to run in multiple projects. They always run in a project scoped tmux session so they are always on.

And of course Zed does remote via ssh so the agents can run without me needing to keep my laptop on.

Ideal would be that I have this graphical environment (cmux like) that is actually herdr behind the scenes, so that if I access remotely it "degrades" from GUI with proper tabs and projects to this Herdr TUI..

Damm, looks a lot like my almost abandoned "foreman", except the mine has a background "foreman" that watches for issues and corrects them.

has anybody figured out how to get this to open a fixed layout? I'm using tmuxp to do this easily with tmux but would switch to this pretty quickly if it was easy to get my layout over. It's really nice. It's like zellij without the bloat (but with different ai bloat that doesn't seem to drag down performance at all and isn't in your face unless you want it in your face)

Tried this for a couple days, but conductor.build is way better IME. Running _in_ the terminal is a flex, but doesn't actually bring any advantage.

Just use tmux no?