Repository navigation
Conversation
zedoraps
force-pushed
the
fix/claude-hook-approval-requests
branch
from
November 27, 2026 18:13
9085d25 to
3a51292
Compare
Claude Code sends no decision to PreToolUse: permissionDecision is a field of the hook's output, so the adapter's default recorded every call as `decision:ask`. The reason is now `hook:PreToolUse`, plus `permission_mode:<mode>` when the harness reports one. A mode that is not a plain identifier becomes `unknown`, so it cannot add fields to the reason. A caller that sends permissionDecision keeps the old form. Every Notification became an approval request without a tool, which no call could answer, so the session end recorded it as an inferred denial. Only a Notification of type `permission_prompt` is recorded now, and ingest does not infer an answer for it. Notifications that ask nothing, such as `idle_prompt` or `auth_success`, are not recorded. Claude Code renamed its subagent tool from Task to Agent, so `subagent_start` never fired on current versions. Both names count.
blitzcrieg1
force-pushed
the
fix/claude-hook-approval-requests
branch
from
November 27, 2026 18:25
3a51292 to
480ec1a
Compare
Owner
|
Reopening as #515 from a same-repo branch: first-time-contributor fork PRs need workflow approval here, and the branch was rebased onto current master anyway (README count fix). Same commits, author preserved. Closing this one. |
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 and why
Three fixes in the Claude Code hook adapter, found while mapping Agentmetry events to OCSF for the Tenzir package.
PreToolUse(permissionDecisionis a field of the hook's output), so the adapter's default recorded every call asdecision:ask. The reason is nowhook:PreToolUse, pluspermission_mode:<mode>when the harness reports one. A caller that sendspermissionDecisionkeeps the old form.notification_type: permission_promptis recorded now, and ingest no longer infers an answer for it. On one machine over a week, 1,360 of 3,026 inferred Claude denials came from notifications.TasktoAgent, sosubagent_startnever fired andsubagent-swarm-burstcould not match. Both names count now.Checks
python -m pytest -qandpython -m ruff check agentmetry testspass (fromapps/orchestrator)agentmetry benchmarkstill reports 0 missed and 0 false positives, if detection, hooks or ingest changed.env, or real trail data in the diff## Testing in the Agent
claude --permission-mode defaultThe detection ruleset is under a freeze:
rules.py,traits.py,engine.py,mitre.pyandpolicies/detection/manifest.yamlare hashed into a published fingerprint. A change to any ofthem is welcome as an issue first; CONTRIBUTING.md says why.