Skip to content

docs(plugin-diagnostics): say what Claude Code shows for hook failures in hook-failure-audit - #17988

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-17903-44933058180-1
Nov 21, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-17903-44933058180-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #17903

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The hook-failure-audit header comment and the plugin-diagnostics README no longer say a failing hook is shown to nobody. They now say Claude Code shows a <hook name> hook error notice on events such as PreToolUse, and that the notice can cut stderr short (hooks#exit-code-output). They cite changelog 2.1.327 for the SubagentStop, SessionEnd, CwdChanged and FileChanged fixes. They name what the audit still reports that no notice shows: a failure on an event that shows no notice, a launch failure included; an exec-failure signature past the notice's stderr cut; and the failure's class and remedy. Only comment lines and README prose changed, so detection logic is the same. Design choice: the hooks page names the notice only for 'events such as PreToolUse' and does not list it per event, so the text frames the gap as 'events that show no notice' and names no specific event the page does not support.

Not verified

  • Changes are left uncommitted in the working tree, as the runner's system prompt directs (the runner turns them into a patch); ci-mode.md's 'commit every changed file' step was not run for that reason.
  • tidy: passes 1-3 had nothing to do (the code-file hunks are comment-only, and no class-A comment was found). Pass 4 (write-for-humans) made one README edit. Pass 5 (ai-slop:audit fix) did not run its detect.sh detector, because this lane's Bash runs only the named wrappers. The rubric and an…
  • verify: no build or test run. The change is comment and markdown only; hook-failure-audit.test.sh and the rest of the suites are left to the PR's CI.
  • check-affected skipped comment-hygiene (fetch blocked), size-check (script missing), typos (not installed) and three validate-plugins sub-checks that run code from the checked tree; comment-lint is CI only. Left to the PR's CI.
  • Out of scope, now slightly inconsistent with the corrected docs: the warning text 'hook failure(s) Claude Code did not show' (hook-failure-audit.sh, the MSG line), the 'never surfaced' wording in plugins/plugin-diagnostics/.claude-plugin/plugin.json (and the generated README options table from it)…

Fix

  • plugins/plugin-diagnostics/hooks/hook-failure-audit.sh: header comment lines 2-20 rewritten to say what Claude Code shows (hooks#exit-code-output link), cite changelog 2.1.327, name what the hook still reports, state the onFailure: "block" exception, and say 'once per session per failing hook…
  • plugins/plugin-diagnostics/README.md: the 'What it reports' row for hook-failure-audit and the opening of 'The hook-failure audit' section say the same, with a three-item list of what the audit still reports.
  • .changes/plugin-diagnostics/work-resolve-issue-issue-17903-44933058180-1-6a36034c.md: new patch changelog fragment for the change.

Verification

The runner ran each check from the base copy against 5a64274:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • read https: //code.claude.com/docs/en/hooks: 'Exit code output' says a non-blocking error (any other exit code, or a failure such as not starting) lets the action go ahead except for hooks whose failure blocks the action (onFailure "block"), and on events such as PreToolUse you see a `<hook…
  • read https: //code.claude.com/docs/en/changelog: 2.1.327 bug fix 'Fixed failing hooks showing nothing: SubagentStop in background agents, SessionEnd at /clear and /resume, and CwdChanged and FileChanged in fullscreen'
  • check-changelog-fragments: all 13 fragments valid (run after the last edit)
  • check-changed-skills: no changed skills, nothing to gate (run after the last edit)
  • check-affected: 15 passed, 8 skipped over 3 changed files (run after the last edit)
  • fresh-context review subagent over the whole diff: no blocking findings. It found the dropped onFailure "block" exception, an over-broad exit-code claim, 'per hook' where the code keys on registration, 'exited non-zero' taking in exit 2, and the fragment dropping the per-event conditions. All five…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44933058180

Left out: the items under Not verified.

Related

#17903

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 5a64274593d2162b69fdffe84917693bbd471fd5: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

I read every hunk of all 3 changed files:

  • .changes/plugin-diagnostics/…-6a36034c.md: a new changelog fragment.
  • plugins/plugin-diagnostics/README.md: prose only. It changes the hook-failure-audit table row and the opening of "The hook-failure audit" section.
  • plugins/plugin-diagnostics/hooks/hook-failure-audit.sh: header comment lines only (lines 1–20). No executable line changes.

The change is documentation and comments only, so it has no security surface (skip gate 2). The diff removes no standing instruction, hook block list or allowlist, so the instruction-surface lens has nothing to check. The hook's detection logic, its systemMessage output and its plugin manifest are all unchanged. None of the changed files matches a trusted-path glob, and none is a trust control, merge hold, kill switch or token path.

This is the lane's first review of this pull request, so it is not blocking only. There are no prior findings and no settled threads.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 5a64274593d2162b69fdffe84917693bbd471fd5: read 3 of 3 changed file(s); 1 finding(s), 0 as inline comments.

Code review: PR #17988

This pull request only changes documentation. It rewrites the header comment of hook-failure-audit.sh and the hook-failure-audit section of the plugin-diagnostics README so they say what Claude Code now shows for hook failures, and it adds a patch changelog fragment. I read all three changed files in the diff, along with the head version of the hook script.

Closing issue #17903, acceptance criteria

  • "The header comment and README say what Claude Code now shows, pointing at hooks#exit-code-output and citing changelog 2.1.327 for the per-event fixes, and name the failures the hook still reports": met. Both surfaces link hooks#exit-code-output, cite 2.1.327 for the SubagentStop, SessionEnd, CwdChanged and FileChanged fixes, and list three things the audit still reports.
  • "The hook's detection logic is unchanged.": met. I checked this in the diff: every hunk in hook-failure-audit.sh touches # comment lines only (lines 2–19). The new README wording also matches the code:
    • "per failing hook registration" matches the (hookName, command) key in group_by at hook-failure-audit.sh#L464.
    • "classifies the full stderr" matches the classification running before the 160-character cut at #L456-L462.

Finding (advisory, cross-file, no changed line can carry it): the user-facing text still makes the claim this PR corrects.

The README row at README.md#L21 and the new header now say Claude Code shows a <hook name> hook error notice on events such as PreToolUse. Three places still say the opposite:

How it shows up: a failing PreToolUse guard (the #1416 case) now produces a visible hook-error notice in the transcript. At the next Stop the audit tells the user that Claude Code "did not show" that same failure, which contradicts what they just saw and what the README now says.

The closing issue lists only the header and README lines, so this is not blocking. But the issue's title ("says Claude Code shows hook failures to nobody") describes exactly this wording. The PR body lists it under "Out of scope" with no follow-up issue. Suggested fix: reword the message to something like hook failure(s) found in the transcript, and update the userConfig, options-table and hooks.json descriptions in this PR. Alternatively, file a follow-up issue so the inconsistency is tracked. If you change the message, update any assertion on the message text in hook-failure-audit.test.sh.

Other notes

  • The changelog fragment's bump: patch fits a docs-only change. No plugin manifest changed, so there are no manifest lines.
  • I did not verify the author's claim that check-changelog-fragments and check-changed-skills passed.
  • No paved-path, path-scoped rule or settled-thread input applied. I found no embedded instructions in the PR context.
Advisory and manifest lines (1)
  • Loosened checks would be marked: fail (default; the wrapper gave no loosened_check_verdict:/loosened_check_patterns: lines, so no consumer entries); patterns: 0. No loosened check found: the diff changes no check. The wrapper gave no loosened_check_decision_record: line, so I did not check the citation requirement.

Verifier dropped 0 of 1 candidates.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head 5a64274593d2162b69fdffe84917693bbd471fd5, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=LOW demote=false head=5a64274593d2162b69fdffe84917693bbd471fd5 rubric=10.4.5 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit a1533eb Nov 21, 2026
51 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-17903-44933058180-1 branch November 21, 2026 18:35
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit a1533eb167a4b3c9eb3972e80197ca48e09fef74; later checks count it verified from this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plugin-diagnostics: hook-failure-audit says Claude Code shows hook failures to nobody (2.1.327)

0 participants