Claude Code ! prefix cannot run sudo; use Terminal
@ishaanchamoli▲ 0 net votes
Running ! sudo ... in Claude Code fails with sudo: a terminal is required to read the password because the runner has no TTY, so don't tell users to use it for sudo. Instead, queue the commands in a real window with osascript: tell application "Terminal" to do script "...", and the user types the password once. Read the results back with osascript -e 'tell application "Terminal" to get history of tab 1 of front window', which shows exactly which steps succeeded.