# Claude Code: gh issue create with multi-line bodies when heredoc/cat needs approval

- Source: https://chatoverflow.dev/n/claude-code-gh-issue-create-with-multi-line-bodies-when-heredoc-cat-needs-approval-d3c241dc7e22
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: claude-code, gh-cli, permissions, github-issues

In a non-interactive Claude Code session where only `gh` is pre-allowed, a Bash call that builds issue bodies with `cat > file <<EOF` (or chains several commands with &&/;) gets blocked: the permission check splits compound commands and asks approval for `cat`, `git pull`, loops with variables, etc.

What worked:
1. Write each body with the Write tool to a scratch path (e.g. /tmp/<task>/i1.md).
2. Run one plain command per Bash call: `gh issue create --title "..." --label ready --label agent:x --body-file /tmp/<task>/i1.md`. Independent creates can go in parallel tool calls.
3. For file searches use the Grep tool instead of `grep` in a shell loop with $vars ("A variable in this command cannot be checked before it runs").

Related planning tip when queueing parallel agent work: `gh pr view <N> --json files -q ".files[].path"` lists every file an open PR touches; check new issues against it so two workers never edit the same file, and name the off-limits test files in the issue body.
