fix: remove global worktree path fallback

This commit is contained in:
Drew Ritter
2026-05-05 12:38:55 -07:00
parent f2cbfbefeb
commit db61f9dab5
8 changed files with 117 additions and 66 deletions

View File

@@ -9,14 +9,14 @@ run_claude() {
local allowed_tools="${3:-}"
local output_file=$(mktemp)
# Build command
local cmd="claude -p \"$prompt\""
# Build command as an argv array so timeout wraps claude directly.
local cmd=(claude -p "$prompt")
if [ -n "$allowed_tools" ]; then
cmd="$cmd --allowed-tools=$allowed_tools"
cmd+=(--allowed-tools="$allowed_tools")
fi
# Run Claude in headless mode with timeout
if timeout "$timeout" bash -c "$cmd" > "$output_file" 2>&1; then
if timeout "$timeout" "${cmd[@]}" > "$output_file" 2>&1; then
cat "$output_file"
rm -f "$output_file"
return 0