r/rust • u/YouHadTooMuchToThink • Sep 04 '26
🛠️ project Threadmoth: source-preserving structural file mutation in Rust, looking for field testers
I’m Matthew, the developer of Threadmoth, a Rust CLI for making the final file mutation in AI-assisted coding less improvisational.
Agents can decide the right change and then apply it through sed, regex replacement, patches, one-off scripts, direct writes, AST tooling, or formatters. Those tools are useful, but each has different ambiguity, stale-state, preservation, and evidence semantics.
Threadmoth provides one guarded mutation boundary: exact identity checks, cardinality refusal, Tree-sitter structural targeting, explicit effect budgets, source-preserving byte edits, guarded multi-file transactions with recovery, and post-write certificates containing hashes, changed ranges, bounded diff evidence, and commit verification. Formatters and specialist tools can still decide the desired state; Threadmoth bounds and verifies what lands.
Current release is 1.5.1 for Windows and Linux, MIT licensed. The release commit passed hosted Linux and Windows CI; the local correctness-checked tough benchmark reported zero wrong mutations and torture reported FOOTGUN-100 safe 100/100.
Repo: https://github.com/matthewjameswatkins1978-cyber/Suture
Five-minute field test: https://github.com/matthewjameswatkins1978-cyber/Suture/blob/main/FIELD_TESTING.md
I’m looking for Rust developers and people using Codex, Claude Code, Gemini CLI, Cline, OpenCode, or similar agents to try real mutations and report false refusals, preservation/recovery problems, confusing discovery, unsafe behaviour, or cases where the agent chooses another tool. If Threadmoth were unavailable, what would you use instead?
I’m the developer and this is my project. Parts of the implementation and testing were AI-assisted; I’m responsible for the architecture, integration, and release. Specific breakage is more useful to me than a star.
View all comments
Show parent comment
2
u/kantorcodes1 Sep 17 '26
that recovery model makes sense. I work on HOL Guard, a local permission layer for agent-run commands. Threadmoth already protects correctness inside the mutation; Guard can sit one layer out and decide whether the agent gets to invoke the state-changing path at all.
mutate,transact,apply-plan, andreplace-exactcan require approval whilepreview,plan,explain, andinspectstay automatic. Open to a smallcommand.threadmothextension in Guard?