Run Claude Code or Codex in Herdr (and tmux/zellij) and continue from your phone
Start Claude Code or Codex sessions in Herdr terminal panes and monitor or control them from mobile while they keep running.
- CLI
- 0.2.16
- Preview ref
- main
I used to start Claude Code sessions in standalone terminal windows. When I wanted to check progress from my phone, the session was running but not in a place I could attach to.
Herdr (and tmux/zellij) changed that workflow: now I start agent sessions in terminal panes that persist, and Happier opens those same panes from my phone.
TL;DR
- Install Herdr 0.9.2+ (or tmux/zellij on macOS/Linux)
- In Happier: Settings → Session → Terminal host for new sessions → Herdr (or tmux/zellij)
- Run
happier claudeorhappier codexin a Herdr pane (or let Happier start one) - From your phone: the session appears in Herdr, attached and live
- Later:
happier attach <session-id>drops you into the same pane
The problem
Starting agents in a regular terminal window means:
- The session runs but isn't accessible from another terminal
- No terminal persistence if you close the window
- Can't easily check what the agent is doing from a different device
I wanted agent sessions to:
- Start in a persistent terminal multiplexer
- Be accessible from my phone (not just SSH and guessing which session)
- Survive laptop sleep/disconnect
What I tried first (and where I bounced off)
- Plain terminal window: Works until I close it or my laptop sleeps. No way to reattach.
- tmux manually: Better, but I had to remember to start tmux first, name the session, and figure out which tmux session was which from my phone.
- SSH and find the right pane: Works but tedious. I'm guessing window numbers.
Happier with Herdr (or tmux/zellij) solved this by:
- Automatically starting sessions in the selected terminal host
- Presenting them by session name on mobile
- Letting me attach to the exact same pane
If you're new to Happier
Happier is an open-source companion app (mobile/web/desktop) for AI coding agents like Claude Code, Codex, and OpenCode.
The workflow here: Happier starts Claude Code or Codex inside Herdr (or tmux/zellij), and the same session is accessible from your phone with the agent's terminal interface intact.
Get set up:
- How to run Happier from your phone
- GitHub: https://github.com/happier-dev/happier
- Install: https://github.com/happier-dev/happier#how-it-works
- Discord: https://discord.gg/W6Pb8KuHfg
Prerequisites
For Herdr
- Herdr 0.9.2 or newer (stable release required)
- Available on macOS and Linux
- Not supported on native Windows (use tmux in WSL instead)
Check your Herdr version:
herdr --versionIf you're on an older version or dev builds, upgrade to a stable 0.9.2+ release.
For tmux or zellij
- tmux or zellij installed on macOS or Linux
- No minimum version restrictions for tmux/zellij
- Also work in WSL on Windows
Happier CLI
Install the Happier CLI on the machine where you want agents to run:
Step-by-step: configure terminal host for new sessions
1) Open Happier settings
From the Happier app (mobile, web, or desktop):
- Go to Settings
- Select Session
- Find Terminal host for new sessions
2) Choose your terminal host
Select one of:
- None: Sessions start headless (default)
- tmux: Use tmux as the terminal host
- zellij: Use zellij as the terminal host
- Herdr: Use Herdr as the terminal host (requires CLI 0.2.16+)
For this guide: choose Herdr (or tmux if you prefer tmux).
Why this matters:
- When set to None, Happier sessions run in the background until you explicitly attach
- When set to a terminal host, supported sessions appear immediately in that terminal
- The session remains attachable from both the terminal and the Happier app
3) The setting applies per machine
Happier stores this preference on the account but applies it per machine.
If you have multiple machines:
- Each can use a different terminal host
- Or override the account default locally
4) Verify the setting saved
The UI should show your selected host (e.g., Herdr).
Start a Claude Code session in Herdr
Option A: Start from inside a Herdr pane
If you're already in a Herdr pane:
happier claudeHappier reuses the current Herdr pane for Claude Code's terminal interface.
Option B: Let Happier create a new pane
If you run happier claude outside Herdr, Happier creates a new Herdr pane and starts Claude Code there.
What you'll see
Claude Code's terminal interface (TUI) appears in the Herdr pane:
- Prompts and responses in the terminal
- Approval requests inline
- The session is live and attached
Start a Codex session in Herdr
The workflow is the same for Codex:
happier codexFrom the Codex documentation:
- Codex uses its native App Server path on macOS and Linux
- When Herdr (or another terminal host) is selected, Happier starts the Codex TUI in that host
- Without a terminal host, Codex runs server-backed and headless until you attach
View and attach from your phone
From the Happier app
- Open the Happier app on your phone
- Your sessions list shows the running Claude Code or Codex session
- Tap the session to open it
What happens:
- The app shows the session's transcript and controls
- If the session is in Herdr, you can attach to see its terminal interface
- Approval requests appear in the app and in the terminal
Attach to the Herdr pane
From a terminal (local or SSH):
happier attach <session-id>This drops you into the same Herdr pane where Claude Code or Codex is running.
You can also use:
happier herdrThis opens Herdr from the terminal, and you can navigate to the session's pane with Herdr's controls.
Why this works
Herdr (and tmux/zellij) keep terminal sessions alive even when you disconnect.
Happier takes advantage of this by:
- Starting agent sessions in named Herdr panes
- Tracking which session is in which pane
- Presenting the session by name on mobile
- Allowing
happier attachto jump directly to that pane
The result: you start an agent session once, and it's accessible from:
- The original terminal
- A new terminal via
happier attach - Your phone via the Happier app
- Herdr's native pane navigation
Troubleshooting
Symptom: Happier says terminal host setup is needed
Likely cause:
- Herdr is not installed, or the version is older than 0.9.2
- The Herdr server is not running
Fix:
- Verify Herdr is installed:
herdr --version - Ensure version is 0.9.2 or newer
- If Herdr is not running, start it:
herdr - Retry starting the session
Symptom: Sessions start but not in Herdr
Likely cause:
- The terminal host setting was changed after the session started
- You're running an older Happier CLI (pre-0.2.16)
Fix:
- Check your CLI version:
happier --version - Upgrade to CLI 0.2.16+ if needed
- Confirm the setting in Settings → Session → Terminal host for new sessions
- Stop the session and start a new one
Symptom: Can't attach to the session pane
Likely cause:
- The session's Herdr pane was closed manually
- Herdr server restarted and the pane wasn't restored
Fix:
- Check if the session is still running:
happier sessions - If the session is alive but the pane is gone, the agent process continues
- You can still control it via the Happier app (transcript/approvals)
- Attach creates a new view, it doesn't require the original pane
Symptom: Multiple Claude sessions and I don't know which pane is which
Likely cause:
- Starting sessions without checking the session list first
Fix:
- Use
happier sessionsto list all active sessions with their IDs - Use
happier attach <session-id>to jump to a specific session's pane - Or open the Happier app and tap the session to see its details
Common questions
Does this work with tmux and zellij too?
Yes. The same workflow applies:
- Set Terminal host for new sessions to tmux or zellij
- Run
happier claudeorhappier codex - Sessions appear in tmux windows or zellij panes
happier attachworks the same way
Do I have to use Herdr?
No. You can use:
- None (headless until you attach)
- tmux
- zellij
- Herdr
Choose the one that fits your workflow.
Can I switch between terminal hosts?
Yes. Change the setting in Settings → Session → Terminal host for new sessions.
The setting applies to new sessions. Existing sessions continue using their original host.
What happens if my laptop sleeps?
The session and its Herdr pane persist as long as the machine is reachable.
When you reconnect:
- Herdr keeps the pane alive
- The agent process continues
happier attachworks as before
If the machine is fully offline, the Happier relay loses contact until the machine reconnects.
Does the terminal host affect performance?
No. The terminal host is where the agent's terminal interface appears. The agent process and its performance are unaffected.
Related guides
- How to run Happier from your phone
- Happier vs Claude Code Remote Control
- How to keep Claude Code, Codex, and OpenCode running when your laptop sleeps
- How to monitor Claude Code from your phone
Get Happier
Happier is an open-source, end-to-end encrypted companion to run and orchestrate AI coding agents from phone, desktop, and web.