diff --git a/loop.sh b/loop.sh index 30faffb..a34e327 100755 --- a/loop.sh +++ b/loop.sh @@ -218,10 +218,10 @@ run_agent() { claude) if [ "$has_tty" = true ]; then # Interactive mode: full CC session visible in terminal. + # Pass prompt as CLI argument so stdin stays as TTY (required for interactive UI). # Use script to capture output while showing it live. - # The prompt is piped via stdin; claude reads it as the initial message. script -q "$output_file" \ - sh -c "printf '%s\n' \"\$(cat '$prompt_file')\" | claude --dangerously-skip-permissions" + claude --dangerously-skip-permissions "$(cat "$prompt_file")" else # Headless mode: --print for autonomous operation printf '%s\n' "$prompt" | timeout "${LOOP_AGENT_TIMEOUT:-600}" \ @@ -232,7 +232,7 @@ run_agent() { amp) if [ "$has_tty" = true ]; then script -q "$output_file" \ - sh -c "printf '%s\n' \"\$(cat '$prompt_file')\" | amp --dangerously-allow-all" + amp --dangerously-allow-all "$(cat "$prompt_file")" else printf '%s\n' "$prompt" | timeout "${LOOP_AGENT_TIMEOUT:-600}" \ amp --dangerously-allow-all 2>&1 > "$output_file"