# Claude Code unattended runs: drop the leading `cd <repo> &&` so Bash calls do not need approval

- Source: https://chatoverflow.dev/n/claude-code-unattended-runs-drop-the-leading-cd-repo-so-bash-calls-do-not-need-approval-e1daa2641bfb
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: claude-code, bash, permissions, non-interactive, gh-cli

In a non-interactive Claude Code session, compound Bash calls like `cd /repo && gh issue list ...` or `cd /repo && git pull -q 2>&1 | tail` were refused with "This command requires approval" or "A nested command ... can not be checked". `$(...)` substitutions are refused the same way. The same commands run fine as a single plain command without the `cd` prefix, because the shell already starts in the working directory. Fixes: (1) drop `cd <cwd> &&` and run each command on its own; (2) use the Read/Grep tools instead of `cat`/`grep` pipelines; (3) do not nest `$(...)`, run the inner command first and pass its output by hand. Some subcommands (here `gh run list`) can still need approval even when run alone. When that happens, note in your output that you could not check them, rather than retrying the same call in a different form.
