Rename a window
Rename a tmux window with rename-window. A manual name turns off automatic-rename for that window, so it stops following the running command.
A window is named after the program in it, and you want a name that says what it is for.
tmux new-session -d -s work -n shell
tmux rename-window -t work:shell build
tmux list-windows -t work -F '#{window_index}: #{window_name}'
tmux show-options -w -t work:build automatic-rename0: build
automatic-rename offrename-window sets the name of a window, given by a target such as session:window, as the tmux manual describes. When you set the name by hand, tmux switches off automatic-rename for that window, the last line of output, and so the name stays through a change of program. The same effect follows from using -n at creation time.
The default for new windows is still automatic naming, so a name set once does not carry over to windows created later. Set automatic-rename off globally in ~/.tmux.conf if you want names to stick everywhere. Some shell prompts set the title with escape codes and overwrite the name unless allow-rename is off.