← Catalog

@d3ara1n/pi-session-namer

Session naming for pi — cheap side agent on first prompt, user-triggered regeneration, and a rename_session tool for agent-driven naming

Extension

Install

Install with PiG

pig install npm:@d3ara1n/pi-session-namer

Install with Pi

pi install npm:@d3ara1n/pi-session-namer
Review before installing

Packages 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": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.7.0 (README.md). PiG does not review it.

@d3ara1n/pi-session-namer

npm version npm downloads license

Session naming for pi with layered correction paths.

On the first user prompt of a new session, a lightweight side agent generates a concise title so the session is never "Untitled". When the initial name goes stale (the session drifted from its opening message), /namer:rename can regenerate from a conversation excerpt, and the rename_session tool lets the main agent name the session directly — the agent's full context is the best naming source. Optionally, generated titles can also be refreshed after completed turn 5 and every 10 turns after that (10, 20, 30, …).

Features

  • Zero-config: Works out of the box with pi-model-roles' utility role
  • First-turn naming: Names new sessions asynchronously on the opening prompt; later naming calls happen only if periodic renaming is enabled
  • Graceful fallback: If the side agent fails, truncates the user prompt as name
  • Manual rename: /namer:rename regenerates from a conversation excerpt — each turn pairs a user prompt with the assistant's closing reply (the user gives direction, the assistant carries the substance); up to 8 turns, windowed to the first 4 and last 4 (the opening defines why the session exists, the latest shows what it became) when the session is longer
  • Optional periodic rename: Uses the same excerpt as /namer:rename after completed turns 5, 10, 20, 30, … (turn 5, then every 10 turns); disabled by default. Explicitly set titles (via /name or rename_session) are never overwritten. Existing titles without plugin provenance are also left alone.
  • Agent rename: rename_session tool lets the main agent set the session name on the user's request, with the full conversation as its source

Configuration

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

{
  "sessionNamer": {
    "enabled": true,
    "periodicRename": false,
    "sideAgentRole": "utility",
    "maxLength": 50
  }
}
FieldDefaultDescription
enabledtrueGlobal on/off switch
periodicRenamefalseRefresh plugin-generated titles after completed turns 5, 10, 20, 30, …; set to true to enable
sideAgentRole"utility"pi-model-roles role for the naming side agent
maxLength50Maximum name length in characters; 0 means unlimited, and negative values are normalized to 0

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

Commands

CommandDescription
/namerShow status and config
/namer:enableEnable auto-naming for the current session
/namer:disableDisable auto-naming for the current session
/namer:renameRegenerate session name from the conversation excerpt

The enable/disable commands are intentionally session-only. For a persistent choice, set sessionNamer.enabled in settings.json; the extension does not rewrite user configuration files.

Dependencies

Installation

pi install npm:@d3ara1n/pi-model-roles
pi install npm:@d3ara1n/pi-session-namer

Or add to ~/.pi/agent/settings.json:

{
  "extensions": [
    "/absolute/path/to/pi-extensions/packages/pi-model-roles",
    "/absolute/path/to/pi-extensions/packages/pi-session-namer"
  ]
}