|
33 | 33 |
|
34 | 34 | set -euo pipefail |
35 | 35 |
|
| 36 | + |
36 | 37 | # --------------------------------------------------------------------------- |
37 | 38 | # Locate and source common.sh |
38 | 39 | # --------------------------------------------------------------------------- |
@@ -481,22 +482,27 @@ if [ "$ORDERED_COUNT" -gt 0 ]; then |
481 | 482 | done |
482 | 483 | fi |
483 | 484 |
|
484 | | -# --- 7. Mode-based auto-allow shortcut ------------------------------------- |
485 | | -# Only consult the permission-mode fast path if no ask[] rule matched. An |
486 | | -# ask-rule always wins over mode-based auto-allow because the user declared |
487 | | -# an explicit "prompt me on this" intent. |
| 485 | +# --- 7. Internal tool pass-through ----------------------------------------- |
| 486 | +# Some tools are Claude Code internals (schema loading, task management, etc.) |
| 487 | +# that should never trigger the overlay. Pass them through unconditionally. |
488 | 488 | if [ "$MATCHED" != "ask" ]; then |
489 | | - if permission_mode_auto_allows "$PERMISSION_MODE" "$TOOL_NAME" "$TOOL_INPUT" "$CC_CWD" 2>/dev/null; then |
490 | | - # CC itself would auto-allow this call. Emit passthrough and record |
491 | | - # the decision under source="passthru-mode" so the audit log can |
492 | | - # distinguish mode-driven allow from rule-driven allow. |
493 | | - audit_write_line "passthrough" "$TOOL_NAME" "mode:${PERMISSION_MODE:-default}" "" "" "$TOOL_USE_ID" "passthru-mode" |
494 | | - emit_passthrough |
495 | | - exit 0 |
496 | | - fi |
| 489 | + case "$TOOL_NAME" in |
| 490 | + ToolSearch|TaskCreate|TaskUpdate|TaskGet|TaskList|TaskOutput|TaskStop|\ |
| 491 | + AskUserQuestion|SendMessage|EnterPlanMode|ExitPlanMode|ScheduleWakeup|\ |
| 492 | + CronCreate|CronDelete|CronList|Monitor|LSP|RemoteTrigger|\ |
| 493 | + EnterWorktree|ExitWorktree|TeamCreate|TeamDelete) |
| 494 | + emit_passthrough |
| 495 | + exit 0 |
| 496 | + ;; |
| 497 | + esac |
497 | 498 | fi |
498 | 499 |
|
499 | 500 | # --- 8. Overlay path ------------------------------------------------------- |
| 501 | +# Passthru handles ALL non-internal tool calls. There is no mode-based |
| 502 | +# auto-allow shortcut. Every unmatched call goes to the overlay so the user |
| 503 | +# always sees a prompt. CC's native dialog only fires as a fallback when the |
| 504 | +# user explicitly cancels the overlay (Esc) or the overlay is unavailable. |
| 505 | +# |
500 | 506 | # Reached when either: |
501 | 507 | # * an ask[] rule matched, or |
502 | 508 | # * no rule matched AND mode did NOT auto-allow. |
|
0 commit comments