pi-chat-tail

Pi extension for saving the tail of the current conversation as Markdown.

Packages

Package details

extension

Install pi-chat-tail from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-chat-tail
Package
pi-chat-tail
Version
0.1.0
Published
Sep 1, 2026
Downloads
137/mo · 11/wk
Author
njw6622
License
MIT
Types
extension
Size
11.8 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-chat-tail

English | 简体中文

Why ask an LLM to write another handoff Markdown every time you end a session?

Many Agent workflows end like this:

“Summarize our discussion as Markdown so I can continue in the next session.”

But the conclusions that matter are often already there in the last few messages.

Asking the LLM to summarize them again means another round of waiting and another round of tokens. It may also reinterpret details that were already accurate.

pi-chat-tail does one simple thing:

It saves the last few messages of the current conversation directly as Markdown.

No model call. No summarization. No rewriting.

/tail

Then you can end the session.

Usage

/tail
/tail 2
/tail 4

The number tells pi-chat-tail how many recent User / Assistant messages to save. The default is 1.

For example:

  • /tail: save the latest Assistant response
  • /tail 2: save the latest User + Assistant pair
  • /tail 4: save the latest two User + Assistant pairs

If you usually ask the Agent for a final plan before ending a session, /tail is normally enough.

If the last few turns are themselves useful context, use /tail 2 or /tail 4.

Output

/tail creates a Markdown file in the current directory.

Its filename is based on the first saved message, with the date and time appended. For example:

SDK-TypeScript-migration-plan-20260901-2214.md

When saving a single Assistant message, its original Markdown is preserved.

When saving multiple messages, ## User and ## Assistant headings identify each role.

Install

pi install npm:pi-chat-tail

Once installed, simply run:

/tail

For development, you can also load this file directly from the repository:

packages/pi-chat-tail/index.ts

Why not ask the Agent to summarize?

You can.

But if your workflow looks like this:

Discuss
↓
Reach a conclusion
↓
Agent writes the final plan
↓
Agent summarizes that final plan again
↓
Save the Markdown

The last two steps are really the same job twice.

pi-chat-tail turns that into:

Discuss
↓
Reach a conclusion
↓
Agent writes the final plan
↓
/tail

Tools should shorten workflows, not add another workflow on top.

License

MIT.

This project contains code adapted from Joey Gibson’s save extension, which is also licensed under the MIT License.

The corresponding copyright notice is preserved in the license file.