From 062597252af06dda10b30baab1853b1a411e7196 Mon Sep 17 00:00:00 2001 From: thuanle Date: Mon, 4 May 2026 09:30:33 +0700 Subject: [PATCH] Default Claude wrappers to auto permission mode when unset. Preserve user-provided --permission-mode flags while injecting --permission-mode auto as the fallback. Co-Authored-By: Claude Opus 4.7 --- claude-glm | 14 +++++++++++++- claude-tk | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/claude-glm b/claude-glm index 3659c43..8b111ca 100755 --- a/claude-glm +++ b/claude-glm @@ -38,4 +38,16 @@ export ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.1" echo "→ Backend: GLM" -exec claude "$@" +has_permission_mode=false +for arg in "$@"; do + if [ "$arg" = "--permission-mode" ] || [[ "$arg" == --permission-mode=* ]]; then + has_permission_mode=true + break + fi +done + +if [ "$has_permission_mode" = true ]; then + exec claude "$@" +else + exec claude --permission-mode auto "$@" +fi diff --git a/claude-tk b/claude-tk index 3e4ac72..cf2f9c8 100755 --- a/claude-tk +++ b/claude-tk @@ -38,4 +38,16 @@ export ANTHROPIC_DEFAULT_HAIKU_MODEL="gpt-5.3-codex(medium)" echo "→ Backend: GPT" -exec claude "$@" +has_permission_mode=false +for arg in "$@"; do + if [ "$arg" = "--permission-mode" ] || [[ "$arg" == --permission-mode=* ]]; then + has_permission_mode=true + break + fi +done + +if [ "$has_permission_mode" = true ]; then + exec claude "$@" +else + exec claude --permission-mode auto "$@" +fi