@brianm0330/pi-naming

Automatic Pi session names with first-class Rex pane/tab sync, Herdr support, and Ctrl+R overrides.

Packages

Package details

extension

Install @brianm0330/pi-naming from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@brianm0330/pi-naming
Package
@brianm0330/pi-naming
Version
0.1.0
Published
Nov 3, 2026
Downloads
281/mo · 281/wk
Author
brianm0330
License
MIT
Types
extension
Size
19.9 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

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

README

pi-naming

Automatic Pi session names, with first-class Rex pane/tab sync and Herdr support. A small, opinionated fork of @normful/pi-auto-name 2.1.0.

Install

pi install npm:@brianm0330/pi-naming

Requires Pi 1.5.0+ and Node 24+. Publication status is not implied by this command; maintainers must complete the release below first.

For the dotfiles checkout, bootstrap/link-ai.sh links ai/pi/extensions/pi-naming (a relative symlink to this package). Do not also install the npm copy on that machine. One extension, one writer. Run /reload after installation.

Behavior

  • After the first non-command prompt you type, generate one title in the background. Your main model continues immediately and is never switched.
  • Primary: opencode-go/deepseek-v4.1-flash, high reasoning.
  • Fallback: anthropic/claude-haiku-5-5, provider-default reasoning.
  • Use Pi's existing model registry and credentials. Missing model/auth, invalid output, errors, or a 20-second deadline trigger fallback. No provider retries. If both fail, leave the session unnamed.
  • Never regenerate an existing name. Attempts survive reload/resume; failed attempts are not automatically retried. No periodic renaming.
  • Ctrl+R, /rename <literal name>, and native /name <name> override the generated name and sync the terminals. /rename alone shows the current name.
  • On /new, resume, or reload, sync the current session's name (or reset extension-owned labels for an unnamed session).
  • Print, JSON, and RPC sessions do nothing. Subagents cannot rename the parent's terminal.

Rex comes first

Use only inherited REX_SESSION and REX_BLOCK, confirmed by inspection—never whichever pane happens to have focus.

  • Rename the Pi pane.
  • Rename its tab only when that tab has exactly one pane.
  • Never rename the overall Rex session/workspace.
  • Preserve custom labels. Extension-owned terminal labels begin with π , e.g. π Fix login redirect. Remove this prefix when manually naming a pane/tab in Rex to keep that label fixed.
  • A later split leaves the existing tab label alone; subsequent changes affect only the Pi pane.

Herdr support is best-effort (mock-tested, not verified against a live Herdr). It uses the exact HERDR_PANE_ID and its containing tab. It follows the same default/π label ownership rule. Neither CLI is required outside its multiplexer; failures are non-fatal.

Privacy and cost

Naming is an additional model request (and potentially a second fallback request). It sends at most 2,000 characters of your typed prompt to OpenCode Go, or Anthropic on fallback. It does not send files read by the agent, tool results, attachments, or the transcript. Common credential strings are redacted, but arbitrary secrets cannot be reliably detected. Generated names are limited to 60 characters; terminal escapes, controls, and bidi formatting are removed. Model-call errors and prompt text are not logged.

Naming spend is separate from Pi's main conversation total. High reasoning is intentional. The primary has an 8,192-token cap to accommodate hidden reasoning; the fallback has a 512-token cap.

Disable automatic generation while retaining manual naming and terminal sync:

PI_NAMING_DISABLED=1 pi

Development

npm ci --ignore-scripts --legacy-peer-deps
npm test
npm run typecheck
npm run smoke:rex  # creates and removes its own throwaway Rex session
npm pack --dry-run

The old dotfiles pi-rename-manual.ts is now an inert compatibility stub. All manual shortcuts and surface writes live here. A private pre-migration backup is under ~/.pi/agent/run/pi-naming/ on the installation machine.

Release / Pi gallery

The public npm name is @brianm0330/pi-naming; the unscoped pi-naming name belongs to someone else. pi-package in keywords and pi.extensions make the published package eligible for the Pi package gallery; indexing is not immediate and is controlled by Pi.

From this directory:

npm login                         # npm user: brianm0330
npm whoami
npm publish --access public       # runs typecheck and tests first
npm view @brianm0330/pi-naming version

This publishes only the explicit package files allowlist—not the rest of the private dotfiles repository. Do not change the dotfiles repository's visibility to publish this package. npm publish may require interactive 2FA. Do not store npm tokens in this repo.