fix: inject skipDangerousModePermissionPrompt into worktree settings
Project-level .claude/settings.json overrides global ~/.claude/settings.json. When agent-session.sh creates settings with hooks but without the skip flag, Claude shows an interactive bypass-permissions confirmation dialog that blocks all non-interactive tmux agent sessions. Fixes #514.
This commit is contained in:
parent
725c4d7334
commit
bc6fe1beee
1 changed files with 11 additions and 0 deletions
|
|
@ -59,6 +59,17 @@ create_agent_session() {
|
|||
mkdir -p "${workdir}/.claude"
|
||||
local settings="${workdir}/.claude/settings.json"
|
||||
|
||||
# Ensure bypass-permissions prompt is skipped in non-interactive sessions.
|
||||
# Project-level settings override global ~/.claude/settings.json, so we must
|
||||
# inject the flag here. Without it, Claude shows an interactive confirmation
|
||||
# dialog that blocks all tmux-based agent sessions.
|
||||
if [ -f "$settings" ]; then
|
||||
jq '. + {skipDangerousModePermissionPrompt: true, permissions: {defaultMode: "bypassPermissions"}}' \
|
||||
"$settings" > "${settings}.tmp" && mv "${settings}.tmp" "$settings"
|
||||
else
|
||||
printf '{"skipDangerousModePermissionPrompt":true,"permissions":{"defaultMode":"bypassPermissions"}}\n' > "$settings"
|
||||
fi
|
||||
|
||||
# Install Stop hook for idle detection: when Claude finishes a response,
|
||||
# the hook writes a timestamp to a marker file. monitor_phase_loop checks
|
||||
# this marker instead of fragile tmux pane scraping.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue