Install
Install with PiG
pig install npm:@hank-warren/pi-auto-nameInstall with Pi
pi install npm:@hank-warren/pi-auto-namePackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.4.0 (README.md). PiG does not review it.
@hank-warren/pi-auto-name
Names each Pi session after the work it is doing, so /resume, the terminal title, and anything that reads it (such as the agent list in Herdr or rodeo) show statusline cache fix instead of a blank or a directory name.
Install
pi install npm:@hank-warren/pi-auto-name
Try it for a single run without installing:
pi -e npm:@hank-warren/pi-auto-name
Do not install this standalone package on a host that also installs the aggregate hank-warren/pi-extensions Git package; that would load the extension twice.
Behaviour
- Automatic, and it keeps up. When the first turn settles, the extension asks for a 3-5 word title and sets it as the session name, then refreshes it after every second turn (turns 1, 3, 5, …), so the name follows a session that drifts. An unchanged title writes nothing. The count restarts when a session is resumed.
- Hand-set names stick. Automatic renames only replace a name the extension set itself (it records which, so this survives resume and fork). A name set with
/name, or one that predates the extension, is left alone. /renameregenerates the name from the conversation as it stands now, replacing whatever is there, and hands the name back to the automatic renames./name <text>still sets a name by hand.- Same model. The title comes from the session's current model, at the session's current thinking level. There is nothing to configure.
- Small input. The model sees a digest of the current branch: the project directory, the first request, the last few requests, and the latest reply, each truncated to a few hundred characters.
- Interactive only. The automatic name is skipped in print, JSON, and RPC modes, which covers subagent children.
Herdr, herdr-core and rodeo
The name is also reported as session_name, so a sidebar row can show just the name, without the π - … - <dir> decoration pi puts in the terminal title:
- In a Herdr TUI pane (
HERDR_ENV=1), as the pane tokensession_name. - In a herdr-core (
hc) terminal, which is what rodeo and the Herdr app run on, as the terminal labelsession_name.
Add it to the Agent rows in the config of the machine you view the sidebar from: the Herdr client's config with herdr --remote, or ~/.config/rodeo/config.toml on the machine running rodeo, including for agents on connected hc machines:
[ui.sidebar.agents]
rows = [
["workspace", "state_icon", { token = "state_text", dim = true }],
[{ token = "$session_name", dim = true }], # hidden while the session is unnamed
]
The token follows every name change — the automatic name, /rename, /name, a resumed or forked session — and is cleared when pi quits. Reports are single short socket writes to the pane's own Herdr server or hc core, bounded by a 500 ms timeout; failures are ignored. Outside both nothing is sent.
What it touches
Nothing in the conversation. The title request is a standalone model call: it is not added to the transcript, never enters the model's context, and uses no session id or prompt-cache retention, so it cannot disturb the session's cache. The only session writes are the name itself — the same session_info entry /name appends — and a small pi-auto-name custom entry recording which name the extension set. Pi sends neither to the model.
Because the call bypasses the session, its token usage is not recorded in the session's usage totals.
Licence
MIT