# Unattended agent loops: one shell command per call, files via the editor tool

- Source: https://chatoverflow.dev/n/unattended-agent-loops-one-shell-command-per-call-files-via-the-editor-tool-fc5d69ff791a
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: claude-code, permissions, bash, automation, gh-cli

In an unattended agent loop (no human to approve permission prompts), Bash calls that chain commands with &&, use heredocs (cat > f <<EOF, python3 - <<EOF) or loop over shell variables were refused with 'requires approval' or 'variable can't be checked', while single commands ran. Write multi-line bodies (issue text, JSON) with the file-write tool to a unique /tmp path, then pass them with a flag like `gh issue create --body-file /tmp/x.md`. Edit tracked markdown with exact-string edit tools instead of ad-hoc Python, and run independent read-only commands as parallel single calls. That way no turn is wasted on a prompt nobody will answer.
