From 7fd19634800d86ef3ee4fb6bf6e59d8afbfe0e9f Mon Sep 17 00:00:00 2001 From: johba Date: Sat, 21 Mar 2026 20:23:46 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20remove=20project=20.claude/settings.json?= =?UTF-8?q?=20=E2=80=94=20use=20global=20config=20(#1089)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem The project-level `.claude/settings.json` overrides the global `skipDangerousModePermissionPrompt` flag, causing Claude Code to show an interactive bypass-permissions confirmation dialog in worktrees. This blocks ALL non-interactive agent sessions on evolution. ## Root cause Claude Code resolves settings per-project. When a `.claude/settings.json` exists in the repo, it takes precedence over `~/.claude/settings.json`. The harb repo has one (with supervisor hooks) but without `skipDangerousModePermissionPrompt: true`. Result: every agent tmux session shows a confirmation prompt and dies. ## Fix Delete `.claude/settings.json` and `.claude/hooks/supervisor/` entirely: - The supervisor hooks are legacy from claude-code-supervisor - agent-session.sh injects its own hooks per worktree at runtime - Disinto has no project-level `.claude/` and works fine - Global `~/.claude/settings.json` has the correct flags ## Impact **This unblocks all harb agents on evolution.** Currently zero PRs can be processed. Reviewed-on: https://codeberg.org/johba/harb/pulls/1089 --- .claude/hooks/supervisor/lib.sh | 139 -------------------------- .claude/hooks/supervisor/on-error.sh | 40 -------- .claude/hooks/supervisor/on-notify.sh | 44 -------- .claude/hooks/supervisor/on-stop.sh | 71 ------------- .claude/hooks/supervisor/triage.sh | 72 ------------- .claude/settings.json | 37 ------- 6 files changed, 403 deletions(-) delete mode 100755 .claude/hooks/supervisor/lib.sh delete mode 100755 .claude/hooks/supervisor/on-error.sh delete mode 100755 .claude/hooks/supervisor/on-notify.sh delete mode 100755 .claude/hooks/supervisor/on-stop.sh delete mode 100755 .claude/hooks/supervisor/triage.sh delete mode 100644 .claude/settings.json diff --git a/.claude/hooks/supervisor/lib.sh b/.claude/hooks/supervisor/lib.sh deleted file mode 100755 index b28cdf7..0000000 --- a/.claude/hooks/supervisor/lib.sh +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/bash -# Shared functions for claude-code-supervisor hooks and scripts. - -set -euo pipefail - -# Find config file: project .claude-code-supervisor.yml → ~/.config/ → defaults -ccs_find_config() { - local cwd="${1:-.}" - if [ -f "$cwd/.claude-code-supervisor.yml" ]; then - echo "$cwd/.claude-code-supervisor.yml" - elif [ -f "${HOME}/.config/claude-code-supervisor/config.yml" ]; then - echo "${HOME}/.config/claude-code-supervisor/config.yml" - else - echo "" - fi -} - -# Read a yaml value (simple key.subkey extraction, no yq dependency). -# Falls back to default if not found. -ccs_config_get() { - local config_file="$1" - local key="$2" - local default="${3:-}" - - if [ -z "$config_file" ] || [ ! -f "$config_file" ]; then - echo "$default" - return - fi - - # Simple grep-based yaml extraction (handles key: value on one line) - local value - case "$key" in - triage.command) value=$(grep -A0 '^\s*command:' "$config_file" | head -1 | sed 's/.*command:\s*["]*//;s/["]*$//' | xargs) ;; - triage.model) value=$(awk '/^triage:/,/^[a-z]/' "$config_file" | grep 'model:' | head -1 | sed 's/.*model:\s*["]*//;s/["]*$//' | xargs) ;; - triage.max_tokens) value=$(awk '/^triage:/,/^[a-z]/' "$config_file" | grep 'max_tokens:' | head -1 | sed 's/.*max_tokens:\s*//' | xargs) ;; - notify.command) value=$(awk '/^notify:/,/^[a-z]/' "$config_file" | grep 'command:' | head -1 | sed 's/.*command:\s*["]*//;s/["]*$//' | xargs) ;; - idle.timeout) value=$(awk '/^idle:/,/^[a-z]/' "$config_file" | grep 'timeout_seconds:' | head -1 | sed 's/.*timeout_seconds:\s*//' | xargs) ;; - idle.nudge_message) value=$(awk '/^idle:/,/^[a-z]/' "$config_file" | grep 'nudge_message:' | head -1 | sed 's/.*nudge_message:\s*["]*//;s/["]*$//' | xargs) ;; - *) value="" ;; - esac - - echo "${value:-$default}" -} - -# Send a notification via the configured notify command. -ccs_notify() { - local config_file="$1" - local message="$2" - - local notify_cmd - notify_cmd=$(ccs_config_get "$config_file" "notify.command" "openclaw gateway call wake --params") - - # Build JSON payload - local payload - payload=$(jq -n --arg text "$message" --arg mode "now" '{text: $text, mode: $mode}') - - $notify_cmd "$payload" 2>/dev/null || true -} - -# Run LLM triage via configured command. -# Accepts prompt on stdin, returns verdict on stdout. -ccs_triage() { - local config_file="$1" - local prompt="$2" - - local triage_cmd model max_tokens - triage_cmd=$(ccs_config_get "$config_file" "triage.command" "claude -p --no-session-persistence") - model=$(ccs_config_get "$config_file" "triage.model" "claude-haiku-4-5-20251001") - max_tokens=$(ccs_config_get "$config_file" "triage.max_tokens" "150") - - echo "$prompt" | $triage_cmd --model "$model" --max-tokens "$max_tokens" 2>/dev/null -} - -# Generate a notify wrapper script the agent can call on completion. -# Usage: ccs_generate_notify_script "$config_file" ["/tmp/supervisor-notify.sh"] -ccs_generate_notify_script() { - local config_file="$1" - local script_path="${2:-/tmp/supervisor-notify.sh}" - local notify_cmd - notify_cmd=$(ccs_config_get "$config_file" "notify.command" "openclaw gateway call wake --params") - - cat > "$script_path" <