pi-read-delta

A Pi extension that returns file changes since the latest comparable read.

Packages

Package details

extension

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

$ pi install npm:pi-read-delta
Package
pi-read-delta
Version
0.1.1
Published
Oct 9, 2026
Downloads
470/mo · 470/wk
Author
dardt
License
MIT
Types
extension
Size
10.8 KB
Dependencies
0 dependencies · 2 peers
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-read-delta

A Pi package that adds read_delta, a tool that shows how a file changed since its latest comparable read call.

Install

After publishing to npm:

pi install npm:pi-read-delta

read_delta

read_delta({ path })

The tool deliberately accepts only path. It finds the newest successful read of the same resolved file on the active session branch and automatically reuses that call's offset and limit values. It then returns a unified diff between that previously read range and the current range at the same location; hunk locations use the original file's line numbers.

Call read first. An offset- or limit-based read is a valid baseline. If the prior read was cut by Pi's 2,000-line/50 KiB output cap, read an image, or was made before this extension was loaded, read_delta returns an explanation instead of an unreliable diff.

The extension stores baseline text in the prior read result's details. It is not sent to the model as an additional message, and follows Pi session branches and resumes.

Diffs are limited to 2,000 lines or 50 KiB. If the change is larger, use read for the relevant range.