Repository navigation
feat(cli): let a plugin hook refuse a file write on every host - #1370
Merged
Merged
Conversation
The shared hook interface gains `refuse(reason)` and a `PreToolUse` event whose files carry their path only. Claude Code's adapter reads the event and denies through hookSpecificOutput.permissionDecision, proven against a real session: the write did not land and the model received the reason. Every other adapter keeps reading no PreToolUse until its payload is captured. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each adapter reads the moment before a tool and denies it the way its host was seen delivering it to the model, from captured runs: codex and claude through hookSpecificOutput, copilot through permissionDecision, antigravity through decision deny, kiro through exit code 2. Antigravity and Kiro now relay PreToolUse, and agy's wrapper answers allow for a silent script, since an empty object denies there. Cursor stays a stated limit: no payload could be captured. The spec lock is proven against each captured payload. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rite-on-every-host
…rite-on-every-host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What & why
A plugin hook can now refuse a file write on every host through one neutral
host.refuse(reason)answer.plugins/aidd-pm/hooks/spec-lock.cjsrefuses on each covered host.🛠️ How it works
host.refuse(reason)is mapped per host, from real captures:hookSpecificOutput.permissionDecisiondeny with its reasonpermissionDecisiondeny withpermissionDecisionReason{decision: "deny", reason}{"decision":"allow"}for a silent PreToolUse script. Before this,{}denied every tool.🧪 How to verify
🔗 Linked issue
Refs #1342
✅ I certify
🤖 Generated with Claude Code