Parent session freeze when subagent with --dangerously-skip-permissions edits ~/.claude/settings.json

Resolved 💬 3 comments Opened Apr 18, 2026 by KinohTaGo Closed Apr 22, 2026

Bug Report: Parent session freeze when subagent with --dangerously-skip-permissions edits ~/.claude/settings.json

CC Version: 2.1.112
Model: claude-opus-4-7[1m] (parent) / claude-opus-4-7 (subagent)
OS: macOS Darwin 25.4.0
Mode: Team agent (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1)
Date: 2026-04-18

Summary

A parent Claude Code session froze when one of 5 parallel subagents issued a permission_request for editing ~/.claude/settings.json while three other subagents simultaneously submitted large completion reports. The parent session stopped responding for ~40 minutes until the user force-resumed from a new session.

Expected Behavior

Either:

  • (a) Subagents spawned with --dangerously-skip-permissions flag should auto-approve all tool uses including ~/.claude/settings.json Edit, OR
  • (b) If certain files are special-cased (CC core settings), the behavior should be documented and parent approval flow should be robust against concurrent message flood from other subagents.

Actual Behavior

  1. Subagent hookify-tier2-impl (spawned with --dangerously-skip-permissions) invoked Edit on ~/.claude/settings.json.
  2. Despite the flag, CC generated permission_request (type: permission_request, request_id: perm-1776523084712-ovvgwf8) sent to parent inbox.
  3. Subagent pane showed ⎿ Waiting for permission… / ✻ Waiting for team lead approval and blocked.
  4. Within the next 6 minutes, 3 other subagents sent completion reports (large texts, total 11 messages) via SendMessage.
  5. Parent session last responded at T+0; after receiving permission_request at T+40s plus the message flood, parent stopped responding at ~T+8min.
  6. Subagent contexts concurrently bloated to 218.4k/200k (109%) observed on findings-w5-impl pane.

Reproduction Steps

  1. Create team with 5 subagents via TeamCreate + Agent(team_name=...).
  2. Ensure all subagents launch with --dangerously-skip-permissions (confirmed via ps aux).
  3. Have one subagent attempt Edit ~/.claude/settings.json.
  4. Simultaneously have other subagents send multi-kilobyte completion reports via SendMessage to parent.
  5. Parent freezes.

Evidence

Pane observation of subagent in waiting state

Update(~/.claude/settings.json)
⎿  Waiting for permission…
╭─────────────────────────────────────╮
│ ✻  Waiting for team lead approval   │
│                                     │
│ ⏺ @hookify-tier2-impl               │
│                                     │
│ Tool: Edit                          │

Subagent process list (all with --dangerously-skip-permissions)

iniad  88238  /Users/iniad/.local/share/claude/versions/2.1.112 --agent-id hookify-tier2-impl@phase5-exec ... --dangerously-skip-permissions --model claude-opus-4-7
iniad  83423  ... --agent-id mail-to-cal-sync-impl@phase5-exec ... --dangerously-skip-permissions ...
iniad  93669  ... --agent-id actions-health-impl@phase5-exec ... --dangerously-skip-permissions ...
iniad  91206  ... --agent-id findings-w5-impl@phase5-exec ... --dangerously-skip-permissions ...

Parent inbox extract (freeze-adjacent timeline)

14:37:24 team-lead → hookify (last parent action)
14:38:04 hookify → team-lead: permission_request perm-1776523084712-ovvgwf8 for Edit /Users/iniad/.claude/settings.json
14:38:58 findings-w5-impl → team-lead: Phase 5.4 completion (~3KB text)
14:39:28 findings-w5-impl → team-lead: re-confirm (~1KB)
14:43:25 actions-health-impl → team-lead: Phase 5.5 completion (~4KB text)
14:43:56 actions-health-impl → team-lead: re-confirm (~1KB)
14:44:33 mail-to-cal-sync-impl → team-lead: Phase 5.1 completion (~5KB text listing 2278 LoC)
14:44:51 mail-to-cal-sync-impl → team-lead: re-confirm (~1KB)
14:44:54 mail-to-cal-sync-impl → team-lead: idle notification (last event received)
~14:45     parent freeze (no further response until user resumed in new session ~40min later)

Subagent context bloat (副次要因)

Pane findings-w5-impl showed:

📦 Ctx: 218.4k/200k (109%) 🔴[██████████]
📊 5h:41%🟢 │ Week:46%🟢 │ Sonnet:1%

Recovery

User resumed in a new session; parent re-loaded with workspace intact (tmux panes + process IDs preserved). To unblock the stuck subagent:

  • tmux send-keys -t '%1115' Escape successfully cancelled the permission dialog.
  • Subagent then autonomously pivoted: committed settings.template.json (version-controlled) and deferred ~/.claude/settings.json deployment to user action via setup.sh merge flow.
  • Subagent is now slowly completing docs updates (2m10s / 2.5k tokens, severely throttled by context saturation).

Hypothesis on Root Cause

A deadlock-like combination of:

  1. --dangerously-skip-permissions not honored for ~/.claude/settings.json (possibly special-cased as CC core settings file).
  2. Large message injection from 3 other subagents consumed parent context/processing bandwidth during permission_request handling.
  3. No backpressure / no queue limit / no timeout on the permission_request protocol on parent side.
  4. Subagent context limit (200k) exceeded due to accumulated team messages + task context, preventing subagent from recovering via message processing.

Requested Fix

  • (High priority) Honor --dangerously-skip-permissions for all file Edit operations consistently, OR document which files are exempt.
  • (High priority) Implement timeout on permission_request (e.g., 5 minutes → auto-deny or auto-approve based on flag).
  • (Medium priority) Add backpressure / queue limit on parent mailbox when multiple subagents report simultaneously.
  • (Medium priority) Surface subagent context saturation warnings to parent earlier (before 109%).

Workaround (for affected users)

  1. Resume parent session in a new terminal.
  2. Identify stuck pane: tmux capture-pane -t '%XXXX' -p | grep "Waiting for".
  3. Cancel dialog: tmux send-keys -t '%XXXX' Escape.
  4. Redirect subagent to indirect edit path (template file + deployment script).

---

Submitter: User via Claude Code (team-lead session)
Related issue search: none found at time of filing

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗