Skip to content

Instantly share code, notes, and snippets.

@happytomatoe
Last active July 3, 2026 11:26
Show Gist options
  • Select an option

  • Save happytomatoe/29cea6ad73a7e1cda606690ab33da343 to your computer and use it in GitHub Desktop.

Select an option

Save happytomatoe/29cea6ad73a7e1cda606690ab33da343 to your computer and use it in GitHub Desktop.
Registry of hashline plugins and extensions for pi-coding-agent

Hashline Plugins for pi-coding-agent

A registry of pi extensions that implement hash-anchored file editing (hashline) — replacing or augmenting the built-in read and edit tools.

What is Hashline?

Hashline is a diff format designed for LLM-driven file edits. Every line carries a short content-hash anchor (e.g., 8#VR:function hello()). Edits reference these anchors instead of raw text strings, so:

  • Stale-context edits are rejected before they corrupt code
  • "String not found" errors drop dramatically
  • Token usage drops (up to 61% in OMP benchmarks)

OMP's published benchmark:

Model Before (str_replace) After (hashline)
Grok Code Fast 1 6.7% 68.3% (10x)
Gemini 3 Flash baseline +5 pp
Grok 4 Fast baseline −61% tokens
MiniMax baseline 2.1× pass rate

Available Packages

Core Library

Package Version Description Install
@oh-my-pi/hashline 16.3.0 Core hashline library: patch language, applier, filesystem abstraction, snapshot store with 3-way-merge recovery npm install @oh-my-pi/hashline

Pi Extensions (Plug-and-Play)

Package Version Description Install
pi-hashline-edit 0.7.0 Hashline read/edit tool override for pi-coding-agent npm install pi-hashline-edit
pi-hashline-edit-pro 0.12.3 Strict hashline with 3-char, 18-bit perfect hashing npm install pi-hashline-edit-pro
pi-hashline-context-edit 0.11.0 Hashline read/edit tool override with context awareness npm install pi-hashline-context-edit
pi-hledit 1.0.8 Hash-anchored file editing (hledit format) npm install pi-hledit
pi-hashline-readmap 0.11.1 Unified hashline + code maps + AST-grep npm install pi-hashline-readmap
@the-agency/pi-hashline-edit 0.2.1 Hashline with staleness-checked line addressing npm install @the-agency/pi-hashline-edit
@jerryan/pi-hashline-edit 0.11.5 Fork with unified diff and safety guardrails npm install @jerryan/pi-hashline-edit

How Hashline Works

Read Phase

Every line returned by read carries a hash anchor:

 8#VR:function hello() {
 9#fF:    const greeting = "hi";
10#3a:    return greeting;
11#7b:}

Edit Phase

Edits reference the hash anchor instead of retyping the content:

[src/hello.ts#fF3a]
SWAP 9.=10:
+    const greeting = "hello";

Validation Phase

Before applying, hashline verifies the file content hash matches the snapshot taken during read. If the file was modified by another source, the edit is rejected or 3-way-merged.

Usage Example

import {
  Filesystem,
  InMemoryFilesystem,
  InMemorySnapshotStore,
  Patcher,
  Patch,
} from "@oh-my-pi/hashline";

const fs = new InMemoryFilesystem();
const snapshots = new InMemorySnapshotStore();
const before = `const greeting = "hi";\nexport { greeting };\n`;

await fs.writeText("hello.ts", before);
const tag = snapshots.record("hello.ts", before);

const patcher = new Patcher({ fs, snapshots });
const patch = Patch.parse(String.raw`[hello.ts#${tag}]
SWAP 1.=1:
+const greeting = "hello";`);

const result = await patcher.apply(patch);
// Stale-anchor rejected if file content diverged

Comparison Table

Plugin Hash Length Stale Protection Fuzzy Match Last Updated
pi-hashline-edit 2-char Yes No 2026-06-12
pi-hashline-edit-pro 3-char (18-bit) Yes (perfect) No 2026-07-01
pi-hashline-context-edit 2-char Yes Context-based 2026-06-24
pi-hledit 4-char Yes No 2026-07-01
pi-hashline-readmap 2-char Yes AST-grep 2026-06-19
@the-agency/pi-hashline-edit 2-char Yes No 2026-04-16
@jerryan/pi-hashline-edit 2-char Yes Unified diff 2026-06-25
@oh-my-pi/hashline 4-hex Yes + 3-way merge No 2026-07-02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment