pi-session-name

pi extension package that auto-generates a concise session title from the first user prompt.

Package details

extension

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

$ pi install npm:pi-session-name
Package
pi-session-name
Version
0.1.0
Published
Apr 23, 2026
Downloads
131/mo · 131/wk
Author
ttttmr
License
MIT
Types
extension
Size
3.8 KB
Dependencies
0 dependencies · 0 peers
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-session-name

A tiny pi package that auto-generates a short session title from the first user prompt.

What it does

  • captures the first user input in the session and freezes it as the title source
  • generates a concise title in the user's language with the active pi model
  • retries up to 3 times using that same first input only
  • never overwrites an existing session name
  • updates the terminal title to π - <session name> - <cwd>

Behavior details

The extension starts working on the first input event:

  1. If the session already has a name, it does nothing.
  2. Otherwise, it stores the first user input in memory.
  3. It then tries up to 3 times to generate a title from that captured input.
  4. Later user messages are ignored for naming purposes.

This means a failed first request will not cause the extension to switch to a later prompt.

If no model is selected, no API key is available, or all 3 attempts fail, the session simply stays unnamed.

Install

Install globally:

pi install npm:pi-session-name

Install from a local checkout:

pi install /absolute/path/to/pi-session-name

Try it once without installing:

pi -e /absolute/path/to/pi-session-name

Use -l with pi install if you want to add it to the current project's .pi/settings.json instead of your global settings.

Publish

npm publish