An extension for pi-code that auto-generates a concise 1-line AI summary as the session title.
- Auto-naming: Automatically generates a descriptive title after your first message is responded to, using the currently equipped model
- Overrides pi-web auto-naming: Detects and replaces pi-web's default short prompt fragment names
- Spinner feedback: Animated spinner in the footer status bar while generating
- PI WEB plugin: Adds "Regenerate session name with AI" action to the action palette
- Regenerate from first message: Use
/auto-nameto regenerate based on just the initial prompt - Regenerate from conversation: Use
/summarizeto regenerate based on the full conversation history - Respects manual names: Won't override a name you've already set manually via
/name
| Command | Description |
|---|---|
/auto-name |
Regenerate session name from the first user message |
/summarize |
Regenerate session name from the full conversation |
Create a config file to customize behavior:
Global (~/.pi/agent/session-name.json):
{
"model": "anthropic/claude-sonnet-4-20250514",
"autoFire": true,
"promptStyle": "Be witty and use pop culture references"
}Project-local (.pi/session-name.json):
{
"model": "openai/gpt-4.1-mini",
"autoFire": false,
"promptStyle": "Use technical jargon and abbreviations"
}| Option | Type | Default | Description |
|---|---|---|---|
model |
string | (current session model) | Model to use for name generation. Format: provider/model-id |
autoFire |
boolean | true |
Auto-generate name after first response |
promptStyle |
string | (none) | Custom style instructions for the LLM (e.g., "Be witty", "Use technical jargon") |
Project-local config overrides global config.
pi install git:github.com/<user>/pi-session-nameThis installs both the Pi extension (session daemon) and the PI WEB plugin (browser). PI WEB auto-discovers the plugin from the installed package — just reload the browser tab.
Pi extension (server-side):
mkdir -p ~/.pi/agent/extensions
cp -r extensions/session-name ~/.pi/agent/extensions/PI WEB plugin (browser-side, alternative to package install):
mkdir -p ~/.pi-web/plugins
cp -r pi-web-plugins/session-name ~/.pi-web/plugins/session-nameThen run /reload in pi and reload the PI WEB browser tab.
Pure utility functions are tested without any LLM API calls:
npm testTests cover extractText, getFirstUserMessage, buildConversationSummary, and cleanSessionTitle.
- User sends a message and the agent responds
- When the agent settles (
agent_settledevent), the extension checks if a name is already set - If not, it extracts the first user message from the session
- It calls the configured model (or current session model) to generate a 5-10 word descriptive title
- Sets the session name via
pi.setSessionName()
pi-web auto-names sessions by default (first few words of the prompt). The bundled PI WEB plugin adds a "Regenerate session name with AI" action to the action palette that inserts /auto-name into the prompt. The extension automatically overrides pi-web's auto-name with the AI-generated title after the first response.
User types: help me refactor the authentication module to use JWT tokens instead of session cookies
Session title becomes: Refactor auth module to use JWT tokens