Subagents don't inherit parent session permission allow list

Resolved 💬 3 comments Opened Mar 2, 2026 by robtaylor Closed Mar 2, 2026

Description

Subagents spawned via the Task tool don't inherit the parent session's permission allow list from settings.json. This means agents get prompted for Read, Edit, Glob, Grep, etc. even when the user has broad patterns like Read(/**) or Edit(/Users/me/**) configured in their global settings.

Steps to reproduce

  1. Configure ~/.claude/settings.json with:

``json
{
"permissions": {
"allow": [
"Read(/**)",
"Edit(/Users/me/**)",
"Glob(**)",
"Grep(**)"
]
}
}
``

  1. In the main session, Read, Edit, Glob, Grep all auto-approve as expected
  2. Spawn a subagent via the Task tool (e.g., an Explore agent to search the codebase)
  3. The subagent gets prompted for every Read, Glob, and Grep call, despite the same settings.json being in effect

Expected behavior

Subagents should respect the same permissions.allow list from settings.json as the parent session. The settings are user-level and global — there's no reason for agents to have a different permission context.

Actual behavior

Subagents appear to start with a blank permission context. Every tool call that requires permission triggers a user prompt, even when the parent session would auto-approve.

Impact

This makes subagents significantly less useful for autonomous work. An Explore agent that needs to read 20 files will prompt 20 times, defeating the purpose of delegation.

Workaround

A PreToolUse hook that reads the allow patterns from settings.json and auto-approves matching tool calls:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Read|Edit|Write|Glob|Grep|LS|NotebookRead|NotebookEdit",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/tool-permissions-inherit.sh",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

Full hook implementation: https://github.com/robtaylor/claude-config/blob/main/hooks/tool-permissions-inherit.sh

Related: #29967 (permission pattern matching issues with piped Bash commands)

View original on GitHub ↗

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