dsh-better-edit
Hash-anchored read/edit/batch_edit/undo_last_edit tools for DeepSeek Harness (dsh). Every line gets a unique 3-char hash (A-Za-z0-9) that stays stable across edits; stale or ambiguous anchors are rejected, never fuzzy-matched. Undo persists across restarts.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Rianico/dsh-better-edit说明文档
阅读完整 README ↗dsh-better-edit
Hash-anchored read / edit / batch_edit / undo_last_edit tools for
DeepSeek Harness (dsh).
Every line of a file gets a unique 3-character hash, and you edit by hash. No
line numbers, no fuzzy matching, no edits landing on the wrong line.
This is a dsh port of pi-hashline-edit-lsz (itself a self-maintained fork of pi-hashline-edit / pi-hashline-edit-pro by RimuruW and Yugimob). The hashline core is ported byte-for-byte; the tool layer is rewritten on dsh's plugin API.
What you get
- Read with anchors. Every line comes back as
HASH│content. The hash is the line's address. - Edit by hash.
edittargets a range of hashes (remove_from/remove_to), so edits always land on the lines you meant. - Anchors that stay put. Edit one part of a file and the hashes of the rest stay the same. Read once, keep editing.
- Fresh anchors, automatically. After every
writeyou get the new anchors (auto-read). After everyedityou get the diff with the new hashes. - Undo when you need it. The last edit on a file can be reverted, even after a restart.
- Safe writes. Permissions, line endings, BOMs, symlinks, and hard links
survive every edit (writes go through
ctx.fs, honoring sandboxed/remote backends). - Reject-and-serve. A stale or never-served range is hard-rejected with
fresh
HASH│contentrows so the retry needs noread.
How it replaces the built-in tools
dsh's tool registry resolves per scope: an agent sees agent → preset → global, and its own layer always wins. The built-in read/edit live on
the agent-preset layer, so a plain global registration cannot replace them.
This plugin:
- Mounts as a host-plane Cordis plugin via its
cordis.patch.ymlbundle patch. - On , registers the hashline tools the / prompt sections on the agent's own scope layer — they shadow the preset's built-ins for that agent and unwind automatically when the agent is disposed.