// Edit format

Reliable code edits with Hashline

Hashline replaces fragile fuzzy patches with edits anchored to numbered lines and verified against the file state the model actually saw.

Line addressedHash verifiedFewer tokensClean failure
01

Address the exact lines

The model refers to numbered source lines instead of reproducing large blocks of surrounding context just to identify an edit location.

02

Verify before writing

Each requested replacement includes a compact hash. If the source changed, PasClaw rejects the operation rather than applying it somewhere ambiguous.

03

Spend tokens on intent

Compact edit instructions leave more context for reasoning, code understanding, and validation instead of diff boilerplate.

04

Recover predictably

A rejected edit provides a clear signal to re-read the file and retry from current content, making agent recovery deterministic.

From the documentation

Technical details

Implementation notes drawn from the PasClaw repository documentation.

Read, anchor, verify

fs_read returns a path-and-hash header followed by line-numbered content. fs_edit_hashline uses that state to make a guarded edit.

  • The file header uses the documented ¶path#hash form.
  • An edit anchor is a bare line number such as 42: rather than echoed source text.
  • If the file hash no longer matches, the write aborts without changing the file.

Deterministic recovery

A stale patch is a request to re-read rather than an invitation to guess where an edit belongs.

  • fs_grep returns matches in the same line-oriented format.
  • Compact anchors reduce the surrounding context needed for an edit.
  • Precise errors make a re-read and retry workflow explicit.

Common questions

Frequently asked questions

Keep exploring

See how the rest of PasClaw fits together.

Undo and redo