feat(plugins): add edit-verifier plugin for post-edit verification#32755
feat(plugins): add edit-verifier plugin for post-edit verification#32755mvanhorn wants to merge 1 commit intoanthropics:mainfrom
Conversation
Adds a PostToolUse hook plugin that reads files back after Edit operations to verify the new content is present. If the expected text is not found, sends a systemMessage warning Claude to re-read the file. Non-blocking (warns only, never denies). Addresses anthropics#32658 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hey @mvanhorn -- great plugin, we've been running a similar hook in our project. Here's a merged version of What's added1. Configurable minimum threshold ( Your version hardcodes 2. Old-string-gone check (catches wrong-occurrence replacements) Your hook checks that 3. False-alarm reduction The old-string check only fires when 4. Configurable mode (
5. Encoding fallback chain Tries Other cleanup
The merged fileFull
|
|
@VoxCore84 These are solid improvements. The old-string-gone check with false-alarm reduction is clever - catching wrong-occurrence edits without noisy false positives from legitimate duplicates. The encoding fallback and configurable mode are practical additions too. Happy to incorporate these. I'll update the PR with your merged version and add the Configuration section to the README. Will credit you in the commit. |
|
Any update on this? @mvanhorn wrote a working edit-verifier plugin back on March 10 in response to #32658 — it's been 17 days with no review. This is exactly the kind of community contribution that should get fast feedback. The core issue (Edit tool doesn't verify its own output) is still unfixed and still reproducing daily. |
|
Yeah, waiting on maintainer review here too. Nothing actionable on our end. |
Summary
Addresses #32658
When Claude uses the Edit tool, it assumes the edit succeeded without verifying. If the target text wasn't found (whitespace mismatch, code already modified), the edit silently fails and Claude proceeds with incorrect assumptions.
This plugin adds a PostToolUse hook that reads the file back after each Edit operation and checks that the
new_stringis present. If not found, it warns Claude viasystemMessageto re-read the file.Design
Plugin structure
Test plan
new_stringthat doesn't match (e.g., wrong whitespace) - warning should appearThis contribution was developed with AI assistance (Claude Code).