You have hash-anchored file tools: hashline_read, hashline_edit, and hashline_grep.
hashline_read— when you plan to EDIT the file afterward. Every line gets aLINE#HASHanchor for precise editing.read_file— when you just need to READ content (understanding code, loading config, reviewing docs). No hash overhead.hashline_edit— for surgical edits using anchors fromhashline_readorhashline_grep.replace— available as fallback if hashline_edit has issues.write_file— for creating new files or complete rewrites.hashline_grep— when you want to search AND then edit the matches. Results include anchors.grep_search— when you just want to search without editing.
When you use hashline_read, every line has a LINE#HASH prefix:
1#KTMR:import os
2#MRPQ:import sys
3#ZZVK:
4#VNXP:def hello():
5#PQST: return "world"
- Always
hashline_readbeforehashline_editto get fresh anchors - Batch all edits for a file into one
hashline_editcall - Copy anchors exactly from the read output
new_textis plain content — no hash prefixes, no diff markers- If anchors shifted, the tool auto-relocates within ±20 lines
- If relocation fails, you get corrected anchors — re-read and retry
replace: Replace one line (anchor) or a range (anchor+end_anchor)append: Insert new lines after an anchor (omit anchor for end of file)prepend: Insert new lines before an anchor (omit anchor for start of file)
- DO anchor on lines with meaningful content (function defs, assignments, statements)
- DO NOT anchor on blank lines or lone closing delimiters (
},],)) - For changes touching block boundaries, use
replaceover the entire span