Skip to content

fix(hook): use hookSpecificOutput format for self-validate shortcut - #15

Merged
grams merged 1 commit into
mainfrom
fix/hook-self-validate-format
May 28, 2026
Merged

grams merged 1 commit into
mainfrom
fix/hook-self-validate-format

Conversation

@grams

@grams grams commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

The agent-callable <args> shortcut path in plugins/agent-callable/hooks/audit-bash.sh still emitted the legacy hook payload {"decision":"allow","reason":"..."}. Under Claude Code's permissions.defaultMode = "auto", this format is no longer honored as a permission short-circuit — Claude Code falls back to the auto-mode classifier or user prompt, causing spurious re-prompts on self-validation paths.

This PR aligns the shortcut on the same hookSpecificOutput / permissionDecision payload already emitted by the binary (claudeAllow constant in cmd/agent-callable/main.go:86).

Test plan

  • make test — all green
  • shellcheck plugins/agent-callable/hooks/audit-bash.sh — clean
  • Smoke test: agent-callable shortcut → new format JSON
  • Smoke test: binary-delegated allow → same new format JSON
  • Smoke test: blocked command (e.g. git push origin main) → abstain (empty stdout)

The `agent-callable <args>` shortcut in audit-bash.sh emitted the legacy
{"decision":"allow",...} hook payload. Under permissions.defaultMode="auto"
this format is no longer honored as a permission short-circuit — Claude Code
falls back to the auto-mode classifier or user prompt, causing spurious
re-prompts on self-validation paths.

Align the shortcut on the same hookSpecificOutput/permissionDecision payload
as the binary's `claudeAllow` constant (cmd/agent-callable/main.go).
@grams
grams merged commit 271b98f into main May 28, 2026
2 checks passed
@grams
grams deleted the fix/hook-self-validate-format branch May 28, 2026 12:30
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.

1 participant