@the-agency/pi-hashline-edit

Pi extension providing hashline-based file reading and editing with staleness-checked line addressing.

Package details

extension

Install @the-agency/pi-hashline-edit from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@the-agency/pi-hashline-edit
Package
@the-agency/pi-hashline-edit
Version
0.2.1
Published
Apr 16, 2026
Downloads
345/mo · 13/wk
Author
joshmock
License
MIT
Types
extension
Size
31.6 KB
Dependencies
0 dependencies · 3 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-hashline-edit

A Pi extension, to substitute for the built-in edit tool, which uses a hashline-based file editing strategy to improve the accuracy and efficiency of agents' file-editing abilities, reducing the likelihood of failed edits that require extra turns and tokens by the agent.

This editing strategy has improved the edit success rate of Gemini models by 8%, Claude Sonnet 4.5 by 14.4%, etc. and reduced overall token usage, without requiring any additional training to these models.

Heavily inspired by/borrowed from Can Bölük's oh-my-pi fork of Pi. I've simply extracted hashline editing from omp into a standalone extension, with some adjustments to ensure it can run in both Node and Bun. See Can's blog post, I Improved 15 LLMs at Coding in One Afternoon. Only the Harness Changed to understand how it works and how well it improves coding agent editing accuracy.

Install

pi install npm:@the-agency/pi-hashline-edit

This will enable the hashline_read and hashline_edit tools, and disable the built-in edit tool, to ensure models are not confused about which editing tool to use.