🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@piotr-oles/pi-title

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@piotr-oles/pi-title

Pi Agent extension: generate a short session title from the first user message

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

pi-title

Pi Agent extension that generates short session title from user messages.

On each agent turn, extension calls active model in background and sets concise, specific title (up to 40 characters) — no user action needed.

Usage

Install via pi config:

pi install npm:@piotr-oles/pi-title

Behavior

  • Hooks before_agent_start — fires every turn until title is locked in.
  • Title locks once total accumulated user prompt content (current + previous messages) reaches 40 chars.
  • Generates title in background — agent starts immediately, no added latency.
  • Uses same model and API key as active session.
  • Sets session name via pi.setSessionName().
  • If model unavailable, throws and shows notification.

/title command

Run /title anytime to regenerate title from recent prompts:

/title

Aborts any in-progress auto-generation, calls model with recent session context, and notifies when done.

Title generation

Prompt instructs model to produce single sentence-case title (max 40 chars, no quotes), specific to task, file, or topic. When session already has title, model refines it if newer prompts add context.

Examples:

First messageGenerated title
"Add dark mode toggle to the settings page"Add dark mode to settings page
"Why is the auth middleware throwing 401?"Debug 401 in auth middleware
"Refactor UserService to use repository pattern"Refactor UserService repository

Development

Test changes manually by passing source entry point to pi with -e flag:

pi -ne -e packages/pi-title/src/index.ts

Keywords

pi-package

FAQs

Package last updated on 30 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts