Subagent (Task tool) does not inherit permission allowlist from settings.json

Resolved 💬 3 comments Opened Feb 3, 2026 by sjain-stanford Closed Feb 6, 2026

Description

When using the Task tool to spawn a subagent, the child agent does not appear to inherit the permission allowlist from .claude/settings.json. This results in permission prompts for commands that should be pre-approved.

Steps to Reproduce

  1. Add a command pattern to .claude/settings.json allowlist:
{
  "permissions": {
    "allow": [
      "Bash(ctest:*)"
    ]
  }
}
  1. Use the Task tool to spawn a subagent that runs the allowed command:
Task: Build and test project
Subagent runs: ctest --test-dir build --output-on-failure -j $(nproc)
  1. Observe that the subagent prompts for permission to run ctest, despite it being in the allowlist.

Expected Behavior

Subagents spawned via the Task tool should inherit the permission allowlist from the parent session's .claude/settings.json. Commands matching allowed patterns should execute without prompting.

Actual Behavior

The subagent prompts for permission to run commands that are explicitly allowed in the settings file.

Environment

  • Claude Code CLI
  • Subagent spawned using Task tool with subagent_type: build-test-lint

Additional Context

This affects workflows where custom agents are configured to run build/test commands autonomously. The workaround is to manually approve each command, but this defeats the purpose of the allowlist for automated pipelines.

View original on GitHub ↗

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