AIToday
AI Safety & AlignmentAI Coding AssistantsZenn AI/MLPublished: Nov 9, 2026, 19:01 JST

Bash(git -C * push*) added to stop alternate-form git push in unattended Claude Code runs

Send on LINE
Bash(git -C * push*) added to stop alternate-form git push in unattended Claude Code runs

3 Key Points

  1. What happened

    Sample settings deny push in three forms — Bash(git push *), Bash(git -C * push*) and Bash(git -c *) — and set defaultMode to dontAsk so anything not on the allow list is refused without asking.

  2. Why it matters

    The official guide's own table shows deny rules match command strings, so rewriting a push with git -C or git -c slips past a single Bash(git push *) line — and untouched calls simply hang when no one is watching, so a broad allow list is the tempting alternative.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

By signing up you agree to the Terms of Service and Privacy Policy.

Context & Analysis

A gap exists between what a permissions line looks like it does and what it actually matches. According to the official guide's table, Bash(git push *) blocks the ordinary spelling but not git -C . push origin main, git -c push.default=current push origin main, or git 'push' origin main — the rule inspects the command string, so a different way of invoking the same program goes straight through. That is why the sample settings place Bash(git -C * push*) next to Bash(git push *), with no trailing space, because a line with two asterisks does not catch the form that has nothing after push.

The allow side has a mirror-image trap. The guide recommends putting the asterisk after the subcommand, so Bash(git log *) matches only git log while Bash(git *) permits every git command, and the space before the asterisk is part of the rule — Bash(ls *) does not match lsof, but Bash(ls*) does. The settings also set defaultMode to dontAsk, which refuses anything not on the allow list without prompting; that is the safety net for spellings the deny list misses, such as calling curl by its full path.

This is one layer of two. The 'company' it describes also runs a hook that checks each tool call against a declared set of permissions, and the sample allow line Bash(git -C *) would be far too broad on its own — the hook narrows it. It also notes that what a blocked Claude does next is not set by configuration: the guide says rules are enforced by Claude Code, not the model, and prompts or CLAUDE.md only shape what Claude tries. Blocked work is meant to be logged and left pending, and starting from a near-empty allow list and adding lines only for tasks that got stuck is recommended.

FAQ
Why doesn't one deny line for git push cover everything?
The official guide's table says Bash(git push *) does not stop git -C . push origin main, git -c push.default=current push origin main or git 'push' origin main, because the rule matches the command string rather than the program.
What does dontAsk do in these settings?
It refuses calls that would otherwise prompt, without asking, while lines written in allow still run. Using bypassPermissions instead for unattended runs is warned against.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleIerabu Group sets November 26–27 seminar on Google Maps and AI traffic