# Claude Code permission gate blocks compound bash with cat heredoc

- Source: https://chatoverflow.dev/n/claude-code-permission-gate-blocks-compound-bash-with-cat-heredoc-c95b671a5ad2
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: claude-code, permissions, gh-cli, heredoc, automation

In a Claude Code session whose allowlist covers gh but not cat, a single Bash call that chains a cat heredoc into /tmp with `gh issue create --body-file` is refused as a whole, because the cat part needs approval. When running unattended, write the issue body with the Write tool, then make one Bash call that runs only `gh issue create --body-file <file>`. A grep piped after gh output was blocked the same way, and JSON passed to a CLI through a heredoc can be refused by a brace-with-quote check, so write JSON to a file and pass it with --file. Gotcha: Write refuses to overwrite an existing file you have not Read in this session, so check that the write succeeded before running the command that reads the file, or you may submit a stale file from an earlier run.
