@pi-claudian/sync-title

Pi extension that syncs Claudian conversation titles and pi session names.

Packages

Package details

extension

Install @pi-claudian/sync-title from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@pi-claudian/sync-title
Package
@pi-claudian/sync-title
Version
0.1.7
Published
Aug 2, 2026
Downloads
640/mo · 640/wk
Author
licongy
License
MIT
Types
extension
Size
28.6 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@pi-claudian/sync-title

npm version License: MIT

English | 中文

A Pi extension that bridges Claudian and Pi: it does a two-way sync of the Claudian conversation title with the Pi session name, so the two stay in sync whether the title comes from Claudian's auto-generation or from a Pi /name command.

Why

Claudian stores per-conversation metadata under .claudian/sessions/conv-*.meta.json (including an auto-generated title) but never tells Pi about it, and Pi's /name command never tells Claudian. This extension closes that gap in both directions, with conflict resolution that never silently overwrites a name you set yourself.

Installation

pi install npm:@pi-claudian/sync-title

Usage

Automatic: after each agent turn the two titles are reconciled. No action required.

Manual: run the /sync-title command to reconcile on demand (it will schedule a retry if Claudian has not generated its title yet, and will prompt on conflict).

Behavior

The extension resolves the Pi session name against the Claudian title using a single decision table:

Pi name Claudian title Action
empty empty nothing (auto-retry if Claudian is still generating)
empty ready Claudian → Pi
ready empty Pi → Claudian (skipped while Claudian is still generating)
ready same no-op
ready different (automatic) notify only, keep Pi name
ready different (manual /name, /sync-title) prompt: Pi→Claudian / Claudian→Pi / keep both / cancel

Notes:

  • Matches the Claudian meta file by Pi session UUID first, falling back to the providerState.sessionFile path (compared through fs.realpath, so symlinked vaults match).
  • Vault resolution uses the session's own home directory (ctx.cwd, which pi sets to the resumed session's recorded cwd — not process.cwd()), walking upward to the nearest .claudian/sessions. So resuming a Claudian session from a sub-directory of the vault still syncs correctly.
  • Never silently overwrites a session you named yourself: automatic triggers (after a reply) only notify on a mismatch; interactive triggers let you choose to sync Pi→Claudian, Claudian→Pi, keep both unchanged, or cancel.
  • Clears: clearing the Pi name with /name (empty) does not erase the Claudian title.
  • Silent no-op outside of a Claudian-managed vault (e.g. plain TUI sessions).
  • Claudian title generation is asynchronous; while its status is pending, the extension waits rather than writing back a Pi name that would race the generator.
  • Writes back to Claudian are atomic (tmp file + rename) so Claudian never reads a half-written meta file.

The interactive conflict prompt — shown on /name or /sync-title when the two titles differ. Claudian is never overwritten without your say:

Interactive conflict-resolution prompt: sync Pi → Claudian, Claudian → Pi, keep both, or cancel

Debug

Trace matching, retries, and writes by enabling the shared @pi-claudian debug switch (output goes to stderr):

PI_CLAUDIAN_DEBUG=1 pi              # show debug output inline
PI_CLAUDIAN_DEBUG=1 pi 2>debug.log  # capture to a file

Look for [pi-claudian]-tagged lines such as writing session name from Claudian or conflict — prompting user.

License

MIT