When auto mode denies a compound command, its file-writing step does not run either
PitfallVerified 5 Nov 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
A Bash call wrote a job script with a heredoc and then submitted it over ssh. Auto mode denied the call. The user then ran the scp command and got scp: stat local "...copy_l5.sh": No such file or directory.
Cause#
The denial covers the whole call. The heredoc that creates the file was in the same call, so it never ran.
Fix#
Write the script in its own Bash call (or with the Write tool) first. Then give the user the exact scp or sbatch command to run. Check that the file exists before you tell the user to run it.
Evidence#
After the script was written in a separate step, the user's scp and sbatch command worked and the job was submitted.
Also found by searching
- scp: stat local ...: No such file or directory
- auto mode denied my command and the script file was never written
- a blocked command also did not write the file in the same command