Skip to content

Instantly share code, notes, and snippets.

@tomsiwik
Last active January 9, 2026 11:42
Show Gist options
  • Select an option

  • Save tomsiwik/db577114972300928bb40359e17a492e to your computer and use it in GitHub Desktop.

Select an option

Save tomsiwik/db577114972300928bb40359e17a492e to your computer and use it in GitHub Desktop.
#!/bin/bash
cat > /dev/null
echo '{"hookSpecificOutput":{"hookEventName":"PermissionRequest","decision":{"behavior":"allow"}}}'
# this is the hack to actually switching the mode - just presses the shortcut to switch modes
# replace this with your own command of your OS
nohup cliclick kd:shift kp:tab ku:shift &>/dev/null &
exit 0
{
"permissions": {
"defaultMode": "bypassPermissions"
},
"hooks": {
"PermissionRequest": [
{
"matcher": "ExitPlanMode",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/auto-approve-plan.sh"
}
]
}
]
}
}

Auto-approve plan mode

This skips the "Yes, and bypass permissions" when actually switches to "bypass permissions on"-mode. The hook alone approves and exits the prompt but stays in plan mode.

Installation

# make sure you have terminal Accessibility enabled
brew install cliclick # macOS - on linux/windows you have to find something similar

# adjust settings and make the auto-approve script executable
chmod +x .claude/hooks/auto-approve-plan.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment