# Install herdr (terminal edition) on this machine

You are installing **herdr**, the terminal multiplexer for AI coding agents. Target: the terminal app (binary `herdr`), not the desktop app. Docs: https://herdr.dev/agent-guide.md and https://herdr.dev/docs/

From: https://intlo.com/news/herdr-stop-polling-your-agents

## Rules

1. Read https://herdr.dev/agent-guide.md before running anything. Do not invent herdr flags, config keys or keybindings. If unsure, run `herdr --help` or `herdr <command> --help`.
2. herdr is not tmux. Do not apply tmux commands or `.tmux.conf` syntax to it.
3. Do not touch any running tmux session, and do not move, stop or restart any agent that is already running.
4. Never launch `herdr` (the interactive UI) from inside this session. You have no TTY, and herdr blocks nested instances (`HERDR_ENV=1`). The human launches it in step 6.
5. Back up every existing file before you change it. Print no secrets, tokens or keys.
6. Stop and report if any step fails twice. Do not improvise a workaround.

## Step 1: Preflight (read-only)

```bash
uname -sm
command -v brew && brew --version | head -1
command -v herdr && herdr --version
tmux ls 2>/dev/null || true
ls -la ~/.config/herdr 2>/dev/null || true
```

Report what you found. If herdr is already installed, skip to step 3.

## Step 2: Install

```bash
brew install herdr
herdr --version
```

If Homebrew is missing or the formula fails, stop and say so. The fallback is the official script (`curl -fsSL https://herdr.dev/install.sh | sh`), which needs the human's go-ahead.

A Homebrew install updates with `brew upgrade herdr`, not `herdr update`.

## Step 3: Config

Only if `~/.config/herdr/config.toml` does not exist:

```bash
mkdir -p ~/.config/herdr
herdr --default-config > ~/.config/herdr/config.toml
```

Then read the file and set `delivery = "system"` under `[ui.toast]`, using the key exactly as it appears in the default config, so the OS notifies when an agent finishes or is blocked. Leave `[keys]` at defaults.

## Step 4: Agent integrations

These may write into agent config (for example `~/.claude/settings.json`). Back up first, then diff.

```bash
cp ~/.claude/settings.json ~/.claude/settings.json.pre-herdr.bak 2>/dev/null || true
cp ~/.codex/config.toml ~/.codex/config.toml.pre-herdr.bak 2>/dev/null || true
herdr integration install claude
herdr integration install codex
herdr integration status
diff ~/.claude/settings.json.pre-herdr.bak ~/.claude/settings.json || true
diff ~/.codex/config.toml.pre-herdr.bak ~/.codex/config.toml || true
```

Skip the agent you do not use. If the diff shows any existing hook removed or reordered, restore the backup and stop.

## Step 5: herdr skill for agents

Lets agents in a herdr pane split panes, prompt each other and wait on each other.

```bash
npx skills add herdrdev/herdr --skill herdr -g
```

If the skills CLI is unavailable, report it and skip. Do not hand-copy the skill.

## Step 6: Hand off (the one manual step)

Tell the human, in one line, to open a **new terminal window that is not inside tmux**, `cd` into a project, and run `herdr`. Then start `claude` or `codex` in the first pane. Running herdr outside tmux avoids the `ctrl+b` prefix clash.

## Step 7: Verify (after the human confirms herdr is open)

```bash
herdr status
herdr agent list
```

Confirm the agent pane is detected and shows a state. If the state looks wrong, run `herdr agent explain <target> --json` and include the output.

## Step 8: Report

- herdr version installed and install method
- every file created or changed, with backup paths
- integration status and the settings diff
- whether the skill installed
- rollback: `brew uninstall herdr`, restore the `.pre-herdr.bak` files, `rm -rf ~/.config/herdr`

## Out of scope

Do not migrate existing tmux sessions, add remote machines, install the desktop app, install plugins, or change keybindings.
