[BUG] Agent team teammates prompted for .claude protected directory writes despite lead's allow rules
Description
Teammates in an agent team are prompted for permission when writing to ~/.claude/teams/, ~/.claude/tasks/, and ~/.claude/eval/ directories, even though:
- The lead session writes to the same paths without prompting
- Explicit
permissions.allowrules exist for these paths in~/.claude/settings.json - Teammates are spawned with
bypassPermissionsmode
The docs state: "Teammates start with the lead's permission settings." — but the lead's effective permissions (which allow writing to these protected subdirectories without prompting) are not inherited by teammates.
Reproduction steps
- Add allow rules to
~/.claude/settings.json:
{
"permissions": {
"defaultMode": "bypassPermissions",
"allow": [
"Write(//Users/<user>/.claude/teams/**)",
"Edit(//Users/<user>/.claude/teams/**)",
"Write(//Users/<user>/.claude/tasks/**)",
"Edit(//Users/<user>/.claude/tasks/**)"
]
}
}
- From the lead session, write a file to
~/.claude/teams/test/file.txt→ succeeds without prompt ✅
- Create a team and spawn a teammate with
bypassPermissionsmode
- Have the teammate write to
~/.claude/teams/test/file.txt→ prompted for permission ❌
Test results from this session
| Agent | Mode | Write target | Prompted? | Files on disk? |
|-------|------|-------------|-----------|----------------|
| Lead | bypassPermissions | ~/.claude/{teams,tasks,eval}/** | No | Yes |
| Teammate 1 | default | ~/.claude/{teams,tasks,eval}/** | Unanswered → idle | No |
| Teammate 2 | bypassPermissions | ~/.claude/{teams,tasks,eval}/** | Unanswered → idle | No |
| Teammate 3 | bypassPermissions (Bash) | ~/.claude/{teams,tasks,eval}/** | Unanswered → idle | No |
| Teammate 4 | bypassPermissions | /tmp/ + ~/.claude/teams/** | Yes (user approved) | Yes |
Teammate 4 confirmed: both /tmp and .claude/teams/ writes succeeded, but only after the user manually approved the permission prompts. The lead performs the identical .claude/teams/ write without prompting.
Why this matters
TeamCreatestores team config at~/.claude/teams/{name}/config.json(docs)TaskCreatestores tasks at~/.claude/tasks/{name}/(docs)- Teammates are expected to coordinate via these directories — the docs say "all agents can see task status and claim available work"
- Skills and agents that write checkpoint/context files to these directories are blocked by prompts on every teammate write, breaking autonomous team workflows
Expected behavior
Teammates should inherit the lead's effective permissions.allow rules, including rules that override the .claude protected directory check. If the lead can write to ~/.claude/teams/** without prompting, teammates should too.
Environment
- Claude Code version: 2.1.96
- Platform: macOS (Darwin 24.6.0)
- Permission mode:
bypassPermissions - Agent teams enabled via
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 - Teammate mode:
tmux
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗