Repository navigation
refactor(aidd-context): generate each host's native project hook from one cited mapping - #1383
Merged
Merged
Conversation
… one cited mapping The hook generator no longer copies one script across hosts or wraps it in a gateway. Each host gets its own handler in its documented format. write-hook.cjs holds the only per-host mapping, each fact cited to the host's doc or a capture of the same route, and --describe exposes it to the skill. Kiro is written natively. The user states a need instead of picking from a fixed intent list. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
…ds the right tool A small-model trial wrote one handler guessing the shell tool across hosts, and it missed Antigravity's run_command. Each host now states its shell tool, the captured names pinned by a test, and the skill writes one handler per host. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
blafourcade
marked this pull request as ready for review
November 26, 2026 07:52
This was referenced Nov 26, 2026
Closed
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
aidd-context:08-hook-generatebecomes a general project-hook generator. It no longer follows the framework's own hook model.hosts.mdand again inwrite-hook.cjs, driftingwrite-hook.cjs, each fact citing the host's doc or a capture of the same route, exposed by--describe.kiro/hooks/<name>.jsonhosts.mdkeeps detection only. Kimi Code CLI has no project hooks, so it is stated as not offered.hook-authoring.mdholds the moments, the effects and six rules; the framework-only rule is gone.docs/COMPATIBILITY.mdnow points to--describeinstead ofhosts.md.Behaviour change: the writer accepts each host's six moment events only. Extra events such as Claude's
Notificationand Cursor'sbeforeShellExecutionare refused; a matcher on the tool event covers them.Facts corrected from the vendor docs:
preToolUseandpostToolUse, and blocks withpermissionDecision: "deny"as well as exit 2.chat.message,tool.execute.after,session.createdandsession.idle.Supersedes the framing of #1346: facts come from each host's own docs, not from what the CLI carries.
Verify
node --test scripts/__tests__/hook-generation.test.js: 25 pass. 23 failed before the code.tool_inputturns only the moment test red, and changing Kiro's block exit code turns only the effect test red.validate-skill.cjson the skill: exit 0.run.cjs: exit 0.node --test scripts/__tests__/hook-generation.test.js: 26 pass. Each host names its shell tool, and every name that cites a capture is checked against what the host really sent.Real trials on every host
Haiku ran the skill on a copy of the plugin, in a project holding all 8 host markers, asked to "block any shell command containing rm -rf, on every host installed here". It wrote one handler per host, each with that host's payload, shell tool and answer, so 15 files.
Each host then ran one real session in a copy of that project, asked to run
echo 'rm -rf is just text here' > ran.txt.ran.txt--trust --dangerously-bypass-hook-trust, in a throwawayCODEX_HOME); an untrusted project loads no project hook, as Codex documentsexecute_bash3 times; the model then rewrote the line as'r'-'m -'-'rf', which the literal match lets through. The hook works, but a literal match does not stop a model that evades itran.txtran.txtShellpayloadThe first trial round found a defect, fixed in 8667237: haiku wrote one handler for all hosts, guessing the shell tool by name, and that handler missed Antigravity's
run_command. Each host's description now names its shell tool, and the authoring rules ask for one handler per host. Copilot's tool name on its own route is not documented, so it isnull.Every session and temporary folder of the trials is deleted.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf