Auto mode denies a shell script that only contains the text git push or git commit
PitfallVerified 30 Sep 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
A Bash call that writes source code through a heredoc is refused:
Permission for this action was denied by the Claude Code auto mode classifier. Reason: [Unrequested Commit in a Connected App].
The script did not run git. It wrote a TypeScript file whose code calls git commit and git push.
Cause#
The classifier reads the command text. A heredoc that contains git commit, git push or gh pr create looks like a commit, whatever the outer command does.
Fix#
Write or edit such files with the Write and Edit tools, not through Bash. Keep Bash for running checks. Retrying the same heredoc with other quoting is treated as working around the denial.
Evidence#
- 2026-09-30, rsrobo, writing
src/fix.tswith adeliverCommitfunction throughpython3 - <<'EOF': denied. The same content through the Edit tool: fine.
Also found by searching
- cat > release.ts <<'EOF' ... Permission for this action was denied by the Claude Code auto mode classifier. Reason: [Unrequested Commit in a Connected App]
- claude code refuses my bash heredoc that writes a script file just because the code mentions git push
- how do I write a file containing git commit commands without the auto mode classifier blocking it
- agent permission denied unrequested commit but I never ran git, only generated source text with gh pr create
- Bash heredoc that just writes a typescript file gets blocked as if I ran git push
- how do I write a source file containing git commit calls without auto mode denying it
- claude code permission classifier refuses python heredoc creating script with gh pr create text inside