Parent session freeze when subagent with --dangerously-skip-permissions edits ~/.claude/settings.json
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-permissionsflag should auto-approve all tool uses including~/.claude/settings.jsonEdit, 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
- Subagent
hookify-tier2-impl(spawned with--dangerously-skip-permissions) invokedEditon~/.claude/settings.json. - Despite the flag, CC generated
permission_request(type:permission_request, request_id:perm-1776523084712-ovvgwf8) sent to parent inbox. - Subagent pane showed
⎿ Waiting for permission… / ✻ Waiting for team lead approvaland blocked. - Within the next 6 minutes, 3 other subagents sent completion reports (large texts, total 11 messages) via
SendMessage. - Parent session last responded at T+0; after receiving
permission_requestat T+40s plus the message flood, parent stopped responding at ~T+8min. - Subagent contexts concurrently bloated to 218.4k/200k (109%) observed on
findings-w5-implpane.
Reproduction Steps
- Create team with 5 subagents via
TeamCreate+Agent(team_name=...). - Ensure all subagents launch with
--dangerously-skip-permissions(confirmed viaps aux). - Have one subagent attempt
Edit ~/.claude/settings.json. - Simultaneously have other subagents send multi-kilobyte completion reports via
SendMessageto parent. - 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' Escapesuccessfully cancelled the permission dialog.- Subagent then autonomously pivoted: committed
settings.template.json(version-controlled) and deferred~/.claude/settings.jsondeployment to user action viasetup.shmerge 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:
--dangerously-skip-permissionsnot honored for~/.claude/settings.json(possibly special-cased as CC core settings file).- Large message injection from 3 other subagents consumed parent context/processing bandwidth during permission_request handling.
- No backpressure / no queue limit / no timeout on the permission_request protocol on parent side.
- 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-permissionsfor 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)
- Resume parent session in a new terminal.
- Identify stuck pane:
tmux capture-pane -t '%XXXX' -p | grep "Waiting for". - Cancel dialog:
tmux send-keys -t '%XXXX' Escape. - 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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗