Subagents should inherit parent session hooks and permission rules
Problem
When using the Task tool to launch subagents (Explore, Plan, general-purpose, Bash), the subagents do not inherit:
- PreToolUse hooks defined in
.claude/settings.json - Permission allow/deny rules from
.claude/settings.json - CLAUDE.md instructions
- Project memory files
This means project-level safety enforcement (e.g., a hook that blocks cd to the project root, or deny rules for destructive commands) silently stops working when subagents are involved.
Current Behavior
- Parent session has a
PreToolUsehook onBashthat blockscdto the project root - Parent session has permission rules allowing read-only commands without prompting
- Subagents launched via
Task(subagent_type="Explore")ignore both — theycdinto the project root freely and prompt for permission on commands the parent auto-allows
Expected Behavior
Subagents should inherit all hooks and permission rules from the parent session's .claude/settings.json by default, ensuring consistent enforcement across the entire agent tree.
Current Workaround
Creating custom agent definitions in .claude/agents/ that manually replicate each hook:
---
name: explore
hooks:
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/no-cd-project-root.sh"
---
This is fragile because:
- Every new hook in
settings.jsonmust be manually duplicated into every agent file - The agent definitions can drift out of sync with the actual settings
- New subagent types require new override files
- It embeds project rules in prose that the AI may not follow, whereas hooks are deterministic
Proposed Solution
Add a configuration option (or make it the default) to propagate parent session hooks and permission rules to all subagents:
{
"permissions": {
"propagateToSubagents": true
},
"hooks": {
"propagateToSubagents": true
}
}
Or simply make inheritance the default behavior, since hooks and permissions represent project-level safety constraints that should apply everywhere.
Environment
- Claude Code CLI
- macOS (Darwin 25.3.0)
- Using
.claude/settings.jsonwith PreToolUse hooks and permission allow/deny rules
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗