Claude Code permission rules: Bash(git push:*) stopped 8 of 14 ways to push, and 5 reached the remote
With a single deny rule, Bash(git push:*) , in a throwaway repo's .claude/settings.json , we asked Claude Code 2.1.278 to run 14 different spellings of "push to origin", one per claude -p run. The rule blocked 8 of them. 5 pushed to the remote ( git -c ... push , git 'push' , sh -c "git push" , eval on a variable, and a shell script), and 1 slipped past the rule but failed in the shell for…
Claude Code 2.1.278 was instructed to attempt 14 variations of pushing to a remote repository using the git push command. A deny rule, Bash(git push:*) was implemented in the settings.json file to prevent this action. The rule successfully blocked 8 out of the 14 attempts, while 5 attempts successfully pushed to the remote repository.
One attempt passed the rule but failed in the shell for unrelated reasons. The blocked attempts included variations such as git push origin main, git push, git push with variables, and a shell script. The single attempt that succeeded used the command git -c user.name=x push origin main. The shell returned an exit code 127 with the error message (eval):1: command not found: git push, indicating the rule did not successfully halt this attempt.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.