@d3ara1n/pi-session-namer

Auto-name pi sessions using a cheap side agent — generates concise titles from the first user message

Packages

Package details

extension

Install @d3ara1n/pi-session-namer from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@d3ara1n/pi-session-namer
Package
@d3ara1n/pi-session-namer
Version
0.1.1
Published
Jun 6, 2026
Downloads
381/mo · 15/wk
Author
d3ara1n
License
MIT
Types
extension
Size
11.8 KB
Dependencies
1 dependency · 3 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

@d3ara1n/pi-session-namer

Auto-name pi sessions using a cheap side agent.

On the first user prompt of a new session, calls a lightweight side agent model to generate a concise session title, then sets it via pi.setSessionName(). Subsequent turns are skipped with near-zero overhead.

Features

  • Zero-config: Works out of the box with pi-model-roles' utility role
  • First-turn only: Adds ~0.5-1s latency on the first prompt, zero overhead after
  • Graceful fallback: If the side agent fails, truncates the user prompt as name
  • Manual rename: /namer:rename to regenerate at any time

Configuration

In ~/.pi/agent/settings.json:

{
  "sessionNamer": {
    "enabled": true,
    "sideAgentRole": "utility",
    "maxLength": 50,
    "language": "zh"
  }
}
Field Default Description
enabled true Global on/off switch
sideAgentRole "utility" pi-model-roles role for the naming side agent
maxLength 50 Maximum name length in characters

Project-level .pi/settings.json overrides global settings.

Commands

Command Description
/namer Show status and config
/namer on Enable auto-naming
/namer off Disable auto-naming
/namer:rename Regenerate session name from last prompt

Dependencies

  • @earendil-works/pi-aicomplete() for LLM calls
  • @earendil-works/pi-coding-agent — Extension API
  • @d3ara1n/pi-model-roles — Model role resolution

Install

Add to ~/.pi/agent/settings.json:

{
  "extensions": [
    "/path/to/pi-extensions/packages/pi-session-namer"
  ]
}