---
name: tmux-naming
description: Rename the current tmux session and window per the workspace convention. Session name is derived from the active repo (hydra*→hydra, nims*/nimsforest org→nimsforest, else the GitHub org). Window name is the work topic in kebab-case, derived from the conversation. Auto-invoke at session start and whenever the user opens (or cd's into) a different repo. Don't ask — derive both names from cwd and the user's message.
user_invocable: true
---

# tmux-naming

Assume Claude is always running inside tmux. Run `tmux display-message -p '#S:#W:#I'` first to see the current state, then re-derive both names and rename if they don't match.

## Session name

First match wins:

1. Local repo directory name starts with `hydra` → session `hydra`. (All hydra-ecosystem repos sit under the `cederikdotcom` GitHub org, so the repo-name prefix is the reliable signal — not the org.)
2. GitHub `origin` org is `nimsforest`, OR repo name starts with `nims`/`nimsforest` → session `nimsforest`.
3. Otherwise: the GitHub org from `origin` (e.g. `cederikdotcom` for `iamneo`).

Get the org with:

```sh
git -C <repo> remote get-url origin | sed -E 's#.*[:/]([^/]+)/[^/]+(\.git)?$#\1#'
```

If the current session name doesn't match, rename:

```sh
tmux rename-session <name>
```

If a session with that name already exists, prefer `tmux move-window -s <current>:<idx> -t <name>:` to consolidate into it instead of creating a duplicate.

## Window name

Short kebab-case label describing the work topic — examples: `issue-116-body-selection`, `rupelmonde-stream-debug`, `landregistry-deploy`. Derive it from the user's first message and ongoing conversation. If the current window name is just an index (`0`, `1`) or a generic shell name (`bash`, `claude`), rename:

```sh
tmux rename-window <topic>
```

Re-derive and rename if the topic shifts substantially mid-session. **Don't ask the user** — pick a reasonable label.

## Panes

Never rename panes — they don't matter for navigation.

## Why

The user runs many parallel Claude sessions across orgs and topics; correct session/window labels are how they navigate between them. Without them, switching is impossible.
