chore: evaluate defer permission response support for PreToolUse hooks (v2.1.89) #257

Closed
opened 2026-04-13 09:11:51 -07:00 by hikari · 1 comment
Owner

Context

Claude Code v2.1.89 added a new "defer" decision value for PreToolUse hook responses. Previously hooks could respond with "allow" or "deny"; "defer" means "let the normal permission system decide."

Why This Matters

Hikari Desktop uses a workspace trust gate implemented via hooks. If we ever extend our hook response logic to send structured decisions back to Claude Code, we need to be aware of and potentially support "defer" as a valid response — particularly for cases where we want to pass control back to the user rather than making a blanket decision.

Tasks

  • Review the current PreToolUse hook response logic in src-tauri/src/wsl_bridge.rs
  • Determine whether our workspace trust gate could benefit from "defer" responses
  • If applicable, add "defer" as a valid hook response variant in src-tauri/src/types.rs
  • Document the decision (implement or consciously skip)
  • Add tests if implementation changes are made

References

  • Claude Code v2.1.89 changelog
  • src-tauri/src/wsl_bridge.rs — workspace trust gate / hook handling
  • src-tauri/src/types.rs

This issue was created with help from Hikari~ 🌸

## Context Claude Code v2.1.89 added a new `"defer"` decision value for `PreToolUse` hook responses. Previously hooks could respond with `"allow"` or `"deny"`; `"defer"` means "let the normal permission system decide." ## Why This Matters Hikari Desktop uses a workspace trust gate implemented via hooks. If we ever extend our hook response logic to send structured decisions back to Claude Code, we need to be aware of and potentially support `"defer"` as a valid response — particularly for cases where we want to pass control back to the user rather than making a blanket decision. ## Tasks - [ ] Review the current PreToolUse hook response logic in `src-tauri/src/wsl_bridge.rs` - [ ] Determine whether our workspace trust gate could benefit from `"defer"` responses - [ ] If applicable, add `"defer"` as a valid hook response variant in `src-tauri/src/types.rs` - [ ] Document the decision (implement or consciously skip) - [ ] Add tests if implementation changes are made ## References - Claude Code v2.1.89 changelog - `src-tauri/src/wsl_bridge.rs` — workspace trust gate / hook handling - `src-tauri/src/types.rs` ✨ This issue was created with help from Hikari~ 🌸
Author
Owner

Investigation Results

After reviewing wsl_bridge.rs, Hikari Desktop does not implement any PreToolUse hook response mechanism. Our workspace trust gate works at session startup via --allowedTools CLI flags — we don't dynamically respond to hook invocations during a session.

Claude Code's hook response system (where a hook script writes {"decision": "allow"}, {"decision": "deny"}, or {"decision": "defer"} to stdout) is an external process model. Hikari Desktop receives hook event notifications (emitted to stderr and parsed by the bridge), but we don't write responses back.

Conclusion

No action required. The defer decision value is only relevant if we implement a dynamic PreToolUse hook response system in the future. Until then, this has nothing to attach to.

If we ever build a runtime permission approval UI (where the user approves/denies individual tool calls interactively), defer would be the right default for tools that aren't pre-approved. We can file a new feature issue at that point. Closing as not applicable.

This comment was added by Hikari~ 🌸

## Investigation Results After reviewing `wsl_bridge.rs`, Hikari Desktop does **not** implement any PreToolUse hook response mechanism. Our workspace trust gate works at session startup via `--allowedTools` CLI flags — we don't dynamically respond to hook invocations during a session. Claude Code's hook response system (where a hook script writes `{"decision": "allow"}`, `{"decision": "deny"}`, or `{"decision": "defer"}` to stdout) is an external process model. Hikari Desktop receives hook *event notifications* (emitted to stderr and parsed by the bridge), but we don't write responses back. ## Conclusion **No action required.** The `defer` decision value is only relevant if we implement a dynamic PreToolUse hook response system in the future. Until then, this has nothing to attach to. If we ever build a runtime permission approval UI (where the user approves/denies individual tool calls interactively), `defer` would be the right default for tools that aren't pre-approved. We can file a new feature issue at that point. Closing as not applicable. ✨ This comment was added by Hikari~ 🌸
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#257