Dynamic Tmux Window Naming with Claude Code
Описание и применение
Автоматическое переименование окон tmux в соответствии с текущей задачей Claude Code, улучшая контекстную осведомленность в терминале.
Задача
Automatically rename tmux windows to reflect current Claude Code task without manual intervention.
Результат
Tmux status bar now displays concise, task‑specific window names such as "claude-fix-auth" or "claude-code", improving context awareness across sessions.
Рабочий процесс
- Create ~/.claude/instructions.md with window‑management rules
- Create ~/.claude/approve-tmux.py to auto‑approve tmux rename-window commands
- Make the script executable
- Add a PreToolUse hook in ~/.claude/settings.json that runs the approval script
- Start Claude Code; it reads instructions and monitors task changes
- When a significant topic change is detected, Claude Code runs tmux rename-window
- The hook auto‑approves the command, renaming the window silently
Доказательства
First, I created a custom instructions file that Claude Code reads on startup
Create ~/.claude/approve-tmux.py
Add a PreToolUse hook in ~/.claude/settings.json that runs the approval script
- Дата записи: 2026-10-26T11:26:23.549Z