moesniper 🎯
Escape-proof precision file editor for LLM agents offering hex-encoded content, line-range splicing, and atomic writes.
See It In Action
# 1. Encode your text safely
HEX=
# 2. Splice lines 1-1 with the hex payload
Features
- Multi-Step Undo: Support for sequential rollbacks. Each
--undopops the stack. - Path Normalization: Uses canonicalized paths to ensure history consistency across relative/absolute path calls.
- Strict Hex Decoding: Errors on malformed or odd-length hex strings to prevent silent data corruption.
- Internal Encoding:
sniper encodesub-command for generating payloads without externalxxddependencies. - Metabolic Safety: Integrated with
llmosafev0.4.2 for adaptive back-pressure and load-aware throttling. - Newline Fidelity: Measures and preserves the original file's trailing newline state.
Quick Start
# Edit a file
# Roll back multiple steps
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
License
moesniper is released under the MIT License.
The Engine
Uses temporary files and atomic renaming. Edits are processed through memory, guarded by llmosafe's ResourceGuard. If system entropy is high, the tool applies dynamic back-pressure (sleep) before completing the write.
Context
Text editing is brittle for LLMs due to shell escaping and terminal corruption. moesniper replaces naive sed or cat patching with precision, deterministic splicing using hex-encoded payloads.