Rianico/dsh-better-edit
dsh-better-edit
Hash-anchored read/edit/undo_last_edit tools for DeepSeek Harness (dsh), fewer token consumption, lower cost.
Install
npx @deepseek-ai/dsh plugin --profile web add github:Rianico/dsh-better-editRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-better-edit)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from Rianico/dsh-better-edit, cleaned of badges and images.
<a href="#why-you-need-it">Why You Need It</a> • <a href="#core-pillars">Core Pillars</a> • <a href="#quick-start">Quick Start</a> • <a href="#tools">Tools</a> • <a href="#benchmark">Benchmark</a> • <a href="#how-anchors-work">How Anchors Work</a> • <a href="#development">Development</a>
What is
dsh-better-edit? A high-precision file editing plugin for DeepSeek Harness (dsh) that replaces volatile line numbers and token-wasting code echoes with immutable, content-addressed 3-character line hashes (szJ│code).Core Philosophy: Local compute is free; the model's context window is the most precious resource. By shifting verification, snapshotting, and alignment to the host,
dsh-better-editslashes output tokens by 40–60%, auto-rebases external file drift (e.g., Prettier, Git), and eliminates silent miswrites without forcing full-file re-reads.
Why You Need It
The 3 Fatal Editing Traps of Autonomous Coding Agents
File editing is the #1 point of failure for autonomous agents. Traditional tools break down in three distinct ways:
| Fatal Trap in Traditional Tools | Why It Breaks Agents | How dsh-better-edit Solves It |
|---|---|---|
str_replace Token Bleed | Must re-type 30+ lines of unchanged code just to change 1 line ($O(S+R)$), burning expensive output tokens (billed ~5–6× input). | $O(R)$ Payloads: Sends only two 3-char hashes (anchor_from, anchor_to) + replacement. Cuts output tokens by 40–60%. |
| Line-Number Coordinate Rot | Inserting 1 line shifts all line numbers below it. Agents suffer off-by-one errors or must repeatedly re-read the file. | Position-Independent Anchors: Line hashes follow content, not line coordinates. Exterior shifts auto-rebase cleanly. |
| Silent Miswrites & Drift | Duplicate lines match the wrong function; external formatters (Prettier) or git updates cause blind overwrites or fatal errors. | Content-Addressed Line Verification: Unique anchors via coprime probing; format-tolerant whitespace hashing; fail-closed reject-and-serve. |
Core Pillars
1. 🪙 Token Economics (40–60% Context Savings)
…
