pi-tmux-window-name

Automatically name tmux windows for pi coding sessions

Package details

extension

Install pi-tmux-window-name from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-tmux-window-name
Package
pi-tmux-window-name
Version
0.4.5
Published
Apr 23, 2026
Downloads
599/mo · 217/wk
Author
akuzmenko
License
Apache-2.0
Types
extension
Size
29.3 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-tmux-window-name

Auto-name tmux windows and session titles for pi coding sessions.

Installation

From npm (after publish):

pi install npm:pi-tmux-window-name

From git:

pi install git:github.com/default-anton/pi-tmux-window-name

Or run without installing:

pi -e npm:pi-tmux-window-name
# or
pi -e git:github.com/default-anton/pi-tmux-window-name

What it does

  • Watches session lifecycle and the first user prompt.
  • Generates two names from the prompt:
    • tmux window title: concise 3–4 words.
    • pi session name: longer 8–12 word summary for /resume scanning.
  • Persists the session name with pi.setSessionName(...).
  • Persists the short tmux title in a custom session entry for reliable restore.
  • Renames the current tmux window (when running inside tmux).
  • Adds /rename to recompute names from the current branch conversation so far.
  • If generation fails or output is invalid, leaves session/tmux names unchanged.

Extension behavior

  • Names are generated once per session, then reused when switching/resuming sessions.
  • /rename takes no arguments and rebuilds the name from user and assistant message text in the current branch.
  • /rename ignores reasoning blocks, tool calls/results, and images.
  • On session_start, tmux restore prefers the stored short title and falls back to a compacted session name.
  • Name normalization strips punctuation and keeps alphanumeric words.
  • Set PI_TMUX_WINDOW_NAME_DISABLED=1 to disable the extension completely, including tmux renames and the /rename command. This is useful for sub-agents.

Development

npm run pack:check

License

Apache-2.0