From 3c3b479ae997d23f9e16ea12e02be3ec835c2ef7 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 1 Apr 2026 10:47:54 -0700 Subject: [PATCH 1/3] feat: add tmux-pane-namer plugin LLM-powered tmux pane auto-renaming using Claude CLI (haiku). - Smart naming based on running processes and working directories - State caching to avoid redundant LLM calls - Cron scheduling (every 2 minutes) - Cross-platform support (macOS/Linux) - Setup, run, and uninstall commands Signed-off-by: Tommy Nguyen --- .claude-plugin/marketplace.json | 4 + .../.claude-plugin/plugin.json | 9 ++ plugins/tmux-pane-namer/README.md | 42 +++++++++ plugins/tmux-pane-namer/commands/run.md | 12 +++ plugins/tmux-pane-namer/commands/setup.md | 32 +++++++ plugins/tmux-pane-namer/commands/uninstall.md | 23 +++++ .../tmux-pane-namer/scripts/rename-panes.sh | 94 +++++++++++++++++++ 7 files changed, 216 insertions(+) create mode 100644 plugins/tmux-pane-namer/.claude-plugin/plugin.json create mode 100644 plugins/tmux-pane-namer/README.md create mode 100644 plugins/tmux-pane-namer/commands/run.md create mode 100644 plugins/tmux-pane-namer/commands/setup.md create mode 100644 plugins/tmux-pane-namer/commands/uninstall.md create mode 100755 plugins/tmux-pane-namer/scripts/rename-panes.sh diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 4755824..00b812e 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -18,6 +18,10 @@ "name": "ralph-wiggum", "source": "./plugins/ralph-wiggum" }, + { + "name": "tmux-pane-namer", + "source": "./plugins/tmux-pane-namer" + }, { "name": "google-workspace", "description": "Comprehensive Google Workspace meta-skill covering all 47+ services (Calendar, Gmail, Drive, Docs, Sheets, Slides, Chat, Meet, Tasks, Forms, People, Workflows, and more)", diff --git a/plugins/tmux-pane-namer/.claude-plugin/plugin.json b/plugins/tmux-pane-namer/.claude-plugin/plugin.json new file mode 100644 index 0000000..65051b0 --- /dev/null +++ b/plugins/tmux-pane-namer/.claude-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "tmux-pane-namer", + "version": "0.1.0", + "description": "LLM-powered tmux pane auto-renaming. Uses Claude CLI to intelligently name panes based on running processes and working directories. Includes state caching and cron scheduling.", + "author": { + "name": "Tommy Nguyen", + "url": "https://github.com/tuannvm" + } +} diff --git a/plugins/tmux-pane-namer/README.md b/plugins/tmux-pane-namer/README.md new file mode 100644 index 0000000..327813a --- /dev/null +++ b/plugins/tmux-pane-namer/README.md @@ -0,0 +1,42 @@ +# tmux-pane-namer + +LLM-powered automatic tmux pane renaming. Uses Claude CLI (haiku) to intelligently name your tmux panes based on running processes, working directories, and child process trees. + +## Features + +- **Smart naming** — Uses an LLM to generate concise, emoji-prefixed pane labels based on context (running commands, working directory, child processes). +- **State caching** — Tracks pane state with a content hash; skips redundant LLM calls when nothing has changed. +- **Cron scheduling** — Automatically renames panes on a schedule (default: every 2 minutes). +- **Claude Code aware** — Skips panes running Claude Code to avoid interference. +- **Cross-platform** — Works on macOS and Linux, handles PATH differences for cron execution. +- **Safe concurrency** — Uses a lock directory to prevent overlapping runs. + +## Prerequisites + +- [tmux](https://github.com/tmux/tmux) (with `pane-border-status` support) +- [Claude CLI](https://docs.anthropic.com/en/docs/claude-cli) (`claude` command available in PATH) + +## What Gets Installed + +| Component | Location | +|---|---| +| Rename script | `~/.config/tmux/rename-panes.sh` | +| State cache | `~/.cache/tmux-pane-namer/` | +| Cron job | `*/2 * * * *` entry in user crontab | +| tmux config | `pane-border-status` and `pane-border-format` lines in `~/.tmux.conf` | + +## Commands + +| Command | Description | +|---|---| +| `/setup` | Install the script, configure tmux, and set up the cron job | +| `/run` | Manually trigger a pane rename | +| `/uninstall` | Remove the script, cron job, and tmux config additions | + +## How It Works + +1. Collects metadata for all tmux panes (current command, working directory, child processes). +2. Skips panes owned by Claude Code. +3. Hashes the collected state and compares against the cached hash. +4. If state changed, sends pane info to Claude (haiku) with a naming prompt. +5. Applies the returned labels via `tmux select-pane -T` and caches the result. diff --git a/plugins/tmux-pane-namer/commands/run.md b/plugins/tmux-pane-namer/commands/run.md new file mode 100644 index 0000000..4f27453 --- /dev/null +++ b/plugins/tmux-pane-namer/commands/run.md @@ -0,0 +1,12 @@ +--- +description: "Manually rename all tmux panes using LLM" +allowed-tools: ["Bash"] +--- + +Run the tmux pane rename script manually: + +```bash +bash "$HOME/.config/tmux/rename-panes.sh" +``` + +Report whether the script executed successfully. diff --git a/plugins/tmux-pane-namer/commands/setup.md b/plugins/tmux-pane-namer/commands/setup.md new file mode 100644 index 0000000..d0e2722 --- /dev/null +++ b/plugins/tmux-pane-namer/commands/setup.md @@ -0,0 +1,32 @@ +--- +description: "Set up LLM-powered tmux pane auto-renaming with cron scheduling" +allowed-tools: ["Bash", "Read", "Write", "Edit"] +--- + +Set up the tmux-pane-namer by performing these steps: + +1. **Install the rename script:** + - Copy the script from `${CLAUDE_PLUGIN_ROOT}/scripts/rename-panes.sh` to `$HOME/.config/tmux/rename-panes.sh` + - Create the directory if it doesn't exist: `mkdir -p "$HOME/.config/tmux"` + - Make it executable: `chmod +x "$HOME/.config/tmux/rename-panes.sh"` + +2. **Configure tmux pane borders:** + - Check if `~/.tmux.conf` already has `pane-border-status` configured + - If not, append these lines: + ``` + # tmux-pane-namer: show pane titles in borders + set -g pane-border-status top + set -g pane-border-format " #{pane_index}: #{pane_title} " + ``` + - Reload tmux config if tmux is running: `tmux source-file ~/.tmux.conf 2>/dev/null || true` + +3. **Set up cron job:** + - Check if a cron entry for `rename-panes.sh` already exists + - If not, add: `*/2 * * * * $HOME/.config/tmux/rename-panes.sh >/dev/null 2>&1` + - Use `(crontab -l 2>/dev/null; echo "*/2 * * * * $HOME/.config/tmux/rename-panes.sh >/dev/null 2>&1") | crontab -` + +4. **Test the script:** + - Run `$HOME/.config/tmux/rename-panes.sh` once to verify it works + - Report the result + +Print a summary of what was installed and configured. diff --git a/plugins/tmux-pane-namer/commands/uninstall.md b/plugins/tmux-pane-namer/commands/uninstall.md new file mode 100644 index 0000000..f3a954e --- /dev/null +++ b/plugins/tmux-pane-namer/commands/uninstall.md @@ -0,0 +1,23 @@ +--- +description: "Remove tmux pane auto-renaming (script, cron, config)" +allowed-tools: ["Bash", "Read", "Edit"] +--- + +Remove all tmux-pane-namer components: + +1. **Remove the cron job:** + - Remove the line containing `rename-panes.sh` from the user's crontab: + ```bash + crontab -l 2>/dev/null | grep -v 'rename-panes.sh' | crontab - + ``` + +2. **Remove the script:** + - Delete `$HOME/.config/tmux/rename-panes.sh` + +3. **Remove tmux config additions:** + - Read `~/.tmux.conf` and remove the `pane-border-status` and `pane-border-format` lines that were added by this plugin (look for the `# tmux-pane-namer` comment block) + +4. **Clean up cache:** + - Remove `$HOME/.cache/tmux-pane-namer/` directory + +Report what was removed. diff --git a/plugins/tmux-pane-namer/scripts/rename-panes.sh b/plugins/tmux-pane-namer/scripts/rename-panes.sh new file mode 100755 index 0000000..95b95f2 --- /dev/null +++ b/plugins/tmux-pane-namer/scripts/rename-panes.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +# tmux-pane-namer: Rename tmux panes using Claude CLI (haiku). +# Skips panes owned by Claude Code. Caches state to avoid redundant LLM calls. +# Works from cron (minimal PATH) on both macOS and Linux. + +set -euo pipefail + +# -- PATH: ensure tmux and claude are findable from cron ----------------------- +for p in "$HOME/.local/bin" /opt/homebrew/bin /usr/local/bin /run/current-system/sw/bin; do + [[ -d "$p" ]] && PATH="$p:$PATH" +done +export PATH + +# -- preflight: bail early if deps missing ------------------------------------ +command -v tmux >/dev/null 2>&1 || exit 0 +command -v claude >/dev/null 2>&1 || exit 0 +tmux list-sessions >/dev/null 2>&1 || exit 0 + +# -- lock: prevent overlapping runs ------------------------------------------- +LOCKDIR="/tmp/tmux-rename-panes.lock" +if ! mkdir "$LOCKDIR" 2>/dev/null; then + if [[ -n "$(find "$LOCKDIR" -maxdepth 0 -mmin +2 2>/dev/null)" ]]; then + rm -rf "$LOCKDIR" && mkdir "$LOCKDIR" + else + exit 0 + fi +fi +trap 'rm -rf "$LOCKDIR"' EXIT + +# -- collect pane metadata ---------------------------------------------------- +pane_data="" +pane_count=0 + +while IFS='|' read -r pane_id title cmd cwd pid; do + [[ "$title" == *"Claude Code"* ]] && continue + [[ "$cmd" =~ ^[0-9]+\.[0-9]+ ]] && continue + + procs=$(pgrep -P "$pid" 2>/dev/null | xargs -I{} ps -o comm= -p {} 2>/dev/null | grep -v "^$" | tr '\n' ',' | sed 's/,$//' || true) + + pane_data+="PANE=${pane_id} | cmd=${cmd} | cwd=${cwd} | procs=${procs:-$cmd}"$'\n' + pane_count=$((pane_count + 1)) +done < <(tmux list-panes -a -F '#{pane_id}|#{pane_title}|#{pane_current_command}|#{pane_current_path}|#{pane_pid}') + +[[ $pane_count -eq 0 ]] && exit 0 + +# -- state cache: skip LLM call if panes haven't changed ---------------------- +CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/tmux-pane-namer" +mkdir -p "$CACHE_DIR" +HASH_FILE="$CACHE_DIR/state.hash" +LABEL_CACHE="$CACHE_DIR/labels.cache" + +sha_cmd() { sha256sum 2>/dev/null || shasum -a 256 2>/dev/null; } +current_hash=$(printf '%s' "$pane_data" | sha_cmd | cut -d' ' -f1) +if [[ -f "$HASH_FILE" && -f "$LABEL_CACHE" ]]; then + prev_hash=$(cat "$HASH_FILE") + if [[ "$current_hash" == "$prev_hash" ]]; then + while IFS='|' read -r pane_id label || [[ -n "$pane_id" ]]; do + [[ -z "$pane_id" || -z "$label" ]] && continue + [[ "$pane_id" != %* ]] && continue + tmux select-pane -t "$pane_id" -T "$label" 2>/dev/null || true + done < "$LABEL_CACHE" + exit 0 + fi +fi + +# -- ask Claude to name panes ------------------------------------------------- +response=$(echo "$pane_data" | claude -p \ + --model haiku \ + "You are a tmux pane naming assistant. Given pane info, output EXACTLY one line per pane: +PANE_ID|short_label + +Rules: +- Labels must be ≤30 chars, no pipes +- Use a relevant emoji prefix +- For idle shells, derive a name from the cwd path (last 1-2 meaningful segments) +- For running commands, name by what the command does +- Be concise and descriptive +- Output ONLY the lines, nothing else" 2>/dev/null) || exit 0 + +[[ -z "$response" ]] && exit 0 + +# -- apply labels and update cache -------------------------------------------- +applied=0 +while IFS='|' read -r pane_id label || [[ -n "$pane_id" ]]; do + [[ -z "$pane_id" || -z "$label" ]] && continue + [[ "$pane_id" != %* ]] && continue + tmux select-pane -t "$pane_id" -T "$label" 2>/dev/null || true + applied=$((applied + 1)) +done <<< "$response" + +if [[ $applied -gt 0 ]]; then + echo "$current_hash" > "$HASH_FILE" + echo "$response" > "$LABEL_CACHE" +fi From eeae3d353655f596c3691be16fb0f5bd44cc5af8 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 1 Apr 2026 10:57:08 -0700 Subject: [PATCH 2/3] refactor(tmux-pane-namer): polish for public release - README: add Configuration, Troubleshooting sections; fix cron interval (5m not 2m); use qualified command names; add XDG_CACHE_HOME; mention graceful failure - setup.md: auto-detect tmux.conf location (~/.config/tmux/ or ~/); idempotent cron (grep -v before add); fix pane-border-format; show pane titles after test - uninstall.md: auto-detect tmux.conf; only remove marker-commented lines; clean up lock dir; reload tmux after removal Signed-off-by: Tommy Nguyen --- plugins/tmux-pane-namer/README.md | 79 ++++++++++++++----- plugins/tmux-pane-namer/commands/setup.md | 21 ++--- plugins/tmux-pane-namer/commands/uninstall.md | 17 ++-- 3 files changed, 83 insertions(+), 34 deletions(-) diff --git a/plugins/tmux-pane-namer/README.md b/plugins/tmux-pane-namer/README.md index 327813a..9636070 100644 --- a/plugins/tmux-pane-namer/README.md +++ b/plugins/tmux-pane-namer/README.md @@ -1,42 +1,81 @@ # tmux-pane-namer -LLM-powered automatic tmux pane renaming. Uses Claude CLI (haiku) to intelligently name your tmux panes based on running processes, working directories, and child process trees. +LLM-powered automatic tmux pane renaming. Uses Claude CLI to intelligently name your tmux panes based on running processes, working directories, and child process trees. ## Features -- **Smart naming** — Uses an LLM to generate concise, emoji-prefixed pane labels based on context (running commands, working directory, child processes). -- **State caching** — Tracks pane state with a content hash; skips redundant LLM calls when nothing has changed. -- **Cron scheduling** — Automatically renames panes on a schedule (default: every 2 minutes). -- **Claude Code aware** — Skips panes running Claude Code to avoid interference. -- **Cross-platform** — Works on macOS and Linux, handles PATH differences for cron execution. -- **Safe concurrency** — Uses a lock directory to prevent overlapping runs. +- **Smart naming** — Uses Claude (haiku) to generate concise, emoji-prefixed pane labels based on context +- **State caching** — Tracks pane state via content hashing; skips redundant LLM calls when nothing changes +- **Cron scheduling** — Automatically renames panes on a schedule (default: every 5 minutes) +- **Claude Code aware** — Skips panes running Claude Code to avoid overwriting their status titles +- **Cross-platform** — Works on macOS and Linux with portable PATH, process discovery, and hashing +- **Safe concurrency** — Uses atomic `mkdir`-based locking to prevent overlapping runs +- **Graceful failure** — Silently exits if tmux or Claude CLI is unavailable ## Prerequisites -- [tmux](https://github.com/tmux/tmux) (with `pane-border-status` support) -- [Claude CLI](https://docs.anthropic.com/en/docs/claude-cli) (`claude` command available in PATH) +- [tmux](https://github.com/tmux/tmux) 3.0+ (with `pane-border-status` support) +- [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) (`claude -p` must work non-interactively) ## What Gets Installed | Component | Location | |---|---| | Rename script | `~/.config/tmux/rename-panes.sh` | -| State cache | `~/.cache/tmux-pane-namer/` | -| Cron job | `*/2 * * * *` entry in user crontab | -| tmux config | `pane-border-status` and `pane-border-format` lines in `~/.tmux.conf` | +| State cache | `${XDG_CACHE_HOME:-~/.cache}/tmux-pane-namer/` | +| Cron job | `*/5 * * * *` entry in user crontab | +| tmux config | `pane-border-status` and `pane-border-format` added to your tmux.conf | ## Commands | Command | Description | |---|---| -| `/setup` | Install the script, configure tmux, and set up the cron job | -| `/run` | Manually trigger a pane rename | -| `/uninstall` | Remove the script, cron job, and tmux config additions | +| `/tmux-pane-namer:setup` | Install the script, configure tmux, and set up the cron job | +| `/tmux-pane-namer:run` | Manually trigger a pane rename | +| `/tmux-pane-namer:uninstall` | Remove the script, cron job, cache, and tmux config additions | ## How It Works -1. Collects metadata for all tmux panes (current command, working directory, child processes). -2. Skips panes owned by Claude Code. -3. Hashes the collected state and compares against the cached hash. -4. If state changed, sends pane info to Claude (haiku) with a naming prompt. -5. Applies the returned labels via `tmux select-pane -T` and caches the result. +1. Collects metadata for all tmux panes (current command, working directory, child processes) +2. Skips panes owned by Claude Code (detected by title or version-string command) +3. Hashes the collected state and compares against the last cached hash +4. If state changed, sends pane info to `claude -p --model haiku` with a naming prompt +5. Applies the returned labels via `tmux select-pane -T` and caches the result +6. On cache hit, re-applies cached labels instantly without calling the LLM + +## Configuration + +### Cron interval + +The default cron interval is every 5 minutes. To change it, edit your crontab (`crontab -e`) and adjust the schedule expression. + +### Pane border format + +The setup command adds a default `pane-border-format` to your tmux config. You can customize it: + +```tmux +# Default (plain) +set -g pane-border-format ' #{pane_title} ' + +# Themed (active pane highlighted) +set -g pane-border-format '#[fg=colour240] #{?#{==:#{pane_active},1},#[fg=colour42],#[fg=colour241]}#{pane_title} #[fg=colour240]' +``` + +### tmux.conf location + +The setup command auto-detects your tmux config at `~/.config/tmux/tmux.conf` or `~/.tmux.conf`. + +## Troubleshooting + +**Script runs but panes aren't renamed:** +- Verify Claude CLI works: `echo "test" | claude -p --model haiku "echo back"` +- Check the lock isn't stale: `rm -rf /tmp/tmux-rename-panes.lock` +- Clear the cache: `rm -rf ~/.cache/tmux-pane-namer/` + +**Cron job doesn't run:** +- Cron has minimal PATH. The script prepends common binary locations, but verify: `crontab -l` +- Check cron logs: `grep cron /var/log/syslog` (Linux) or `log show --predicate 'process == "cron"' --last 10m` (macOS) + +**Pane borders not showing:** +- Verify tmux config: `tmux show -g pane-border-status` should return `top` +- Reload config: `tmux source-file ~/.config/tmux/tmux.conf` or `tmux source-file ~/.tmux.conf` diff --git a/plugins/tmux-pane-namer/commands/setup.md b/plugins/tmux-pane-namer/commands/setup.md index d0e2722..eb66879 100644 --- a/plugins/tmux-pane-namer/commands/setup.md +++ b/plugins/tmux-pane-namer/commands/setup.md @@ -6,27 +6,30 @@ allowed-tools: ["Bash", "Read", "Write", "Edit"] Set up the tmux-pane-namer by performing these steps: 1. **Install the rename script:** + - Create the directory if needed: `mkdir -p "$HOME/.config/tmux"` - Copy the script from `${CLAUDE_PLUGIN_ROOT}/scripts/rename-panes.sh` to `$HOME/.config/tmux/rename-panes.sh` - - Create the directory if it doesn't exist: `mkdir -p "$HOME/.config/tmux"` - Make it executable: `chmod +x "$HOME/.config/tmux/rename-panes.sh"` 2. **Configure tmux pane borders:** - - Check if `~/.tmux.conf` already has `pane-border-status` configured + - Auto-detect tmux config location: check `$HOME/.config/tmux/tmux.conf` first, then `$HOME/.tmux.conf`. If neither exists, create `$HOME/.config/tmux/tmux.conf`. + - Check if `pane-border-status` is already configured in the tmux config - If not, append these lines: ``` # tmux-pane-namer: show pane titles in borders set -g pane-border-status top - set -g pane-border-format " #{pane_index}: #{pane_title} " + set -g pane-border-format ' #{pane_title} ' ``` - - Reload tmux config if tmux is running: `tmux source-file ~/.tmux.conf 2>/dev/null || true` + - If `pane-border-status` exists but `pane-border-format` doesn't, only add the format line + - Reload tmux config if tmux is running: `tmux source-file 2>/dev/null || true` -3. **Set up cron job:** - - Check if a cron entry for `rename-panes.sh` already exists - - If not, add: `*/2 * * * * $HOME/.config/tmux/rename-panes.sh >/dev/null 2>&1` - - Use `(crontab -l 2>/dev/null; echo "*/2 * * * * $HOME/.config/tmux/rename-panes.sh >/dev/null 2>&1") | crontab -` +3. **Set up cron job (idempotent):** + - First remove any existing `rename-panes.sh` cron entry, then add the new one: + ```bash + (crontab -l 2>/dev/null | grep -v 'rename-panes.sh'; echo '*/5 * * * * $HOME/.config/tmux/rename-panes.sh >/dev/null 2>&1') | crontab - + ``` 4. **Test the script:** - Run `$HOME/.config/tmux/rename-panes.sh` once to verify it works - - Report the result + - Show the resulting pane titles: `tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} | #{pane_title}' | head -20` Print a summary of what was installed and configured. diff --git a/plugins/tmux-pane-namer/commands/uninstall.md b/plugins/tmux-pane-namer/commands/uninstall.md index f3a954e..d3c7bf4 100644 --- a/plugins/tmux-pane-namer/commands/uninstall.md +++ b/plugins/tmux-pane-namer/commands/uninstall.md @@ -6,18 +6,25 @@ allowed-tools: ["Bash", "Read", "Edit"] Remove all tmux-pane-namer components: 1. **Remove the cron job:** - - Remove the line containing `rename-panes.sh` from the user's crontab: - ```bash - crontab -l 2>/dev/null | grep -v 'rename-panes.sh' | crontab - - ``` + ```bash + crontab -l 2>/dev/null | grep -v 'rename-panes.sh' | crontab - + ``` 2. **Remove the script:** - Delete `$HOME/.config/tmux/rename-panes.sh` 3. **Remove tmux config additions:** - - Read `~/.tmux.conf` and remove the `pane-border-status` and `pane-border-format` lines that were added by this plugin (look for the `# tmux-pane-namer` comment block) + - Auto-detect tmux config location: check `$HOME/.config/tmux/tmux.conf` first, then `$HOME/.tmux.conf` + - Remove the `# tmux-pane-namer` comment and the `pane-border-status` / `pane-border-format` lines that were added by this plugin + - Only remove lines that include the `# tmux-pane-namer` marker comment. If the user has their own `pane-border-status` without the marker, leave it alone. 4. **Clean up cache:** - Remove `$HOME/.cache/tmux-pane-namer/` directory +5. **Clean up lock (if present):** + - Remove `/tmp/tmux-rename-panes.lock` if it exists + +6. **Reload tmux config:** + - `tmux source-file 2>/dev/null || true` + Report what was removed. From 0f3165a357880fc7ff60cdbbf3205e32e589a151 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 1 Apr 2026 10:58:56 -0700 Subject: [PATCH 3/3] fix(tmux-pane-namer): address codex review findings - Fix cron /Users/tuannvm expansion (use double quotes so crontab gets real path) - Add --max-turns 1 to claude call for single-shot efficiency Signed-off-by: Tommy Nguyen --- plugins/tmux-pane-namer/commands/setup.md | 2 +- plugins/tmux-pane-namer/scripts/rename-panes.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tmux-pane-namer/commands/setup.md b/plugins/tmux-pane-namer/commands/setup.md index eb66879..cc08741 100644 --- a/plugins/tmux-pane-namer/commands/setup.md +++ b/plugins/tmux-pane-namer/commands/setup.md @@ -25,7 +25,7 @@ Set up the tmux-pane-namer by performing these steps: 3. **Set up cron job (idempotent):** - First remove any existing `rename-panes.sh` cron entry, then add the new one: ```bash - (crontab -l 2>/dev/null | grep -v 'rename-panes.sh'; echo '*/5 * * * * $HOME/.config/tmux/rename-panes.sh >/dev/null 2>&1') | crontab - + (crontab -l 2>/dev/null | grep -v 'rename-panes.sh'; echo "*/5 * * * * $HOME/.config/tmux/rename-panes.sh >/dev/null 2>&1") | crontab - ``` 4. **Test the script:** diff --git a/plugins/tmux-pane-namer/scripts/rename-panes.sh b/plugins/tmux-pane-namer/scripts/rename-panes.sh index 95b95f2..ff407fe 100755 --- a/plugins/tmux-pane-namer/scripts/rename-panes.sh +++ b/plugins/tmux-pane-namer/scripts/rename-panes.sh @@ -64,7 +64,7 @@ if [[ -f "$HASH_FILE" && -f "$LABEL_CACHE" ]]; then fi # -- ask Claude to name panes ------------------------------------------------- -response=$(echo "$pane_data" | claude -p \ +response=$(echo "$pane_data" | claude -p --max-turns 1 \ --model haiku \ "You are a tmux pane naming assistant. Given pane info, output EXACTLY one line per pane: PANE_ID|short_label