claude-code - 💡(How to fix) Fix [BUG] Agent team teammates prompted for .claude protected directory writes despite lead's allow rules [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45291Fetched 2026-04-09 08:08:47
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Teammates in an agent team are prompted for permission when writing to ~/.claude/teams/, ~/.claude/tasks/, and ~/.claude/eval/ directories, even though:

  1. The lead session writes to the same paths without prompting
  2. Explicit permissions.allow rules exist for these paths in ~/.claude/settings.json
  3. Teammates are spawned with bypassPermissions mode

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.

Root Cause

  • TeamCreate stores team config at ~/.claude/teams/{name}/config.json (docs)
  • TaskCreate stores 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

Code Example

{
  "permissions": {
    "defaultMode": "bypassPermissions",
    "allow": [
      "Write(//Users/<user>/.claude/teams/**)",
      "Edit(//Users/<user>/.claude/teams/**)",
      "Write(//Users/<user>/.claude/tasks/**)",
      "Edit(//Users/<user>/.claude/tasks/**)"
    ]
  }
}
RAW_BUFFERClick to expand / collapse

Description

Teammates in an agent team are prompted for permission when writing to ~/.claude/teams/, ~/.claude/tasks/, and ~/.claude/eval/ directories, even though:

  1. The lead session writes to the same paths without prompting
  2. Explicit permissions.allow rules exist for these paths in ~/.claude/settings.json
  3. Teammates are spawned with bypassPermissions mode

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

  1. 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/**)"
    ]
  }
}
  1. From the lead session, write a file to ~/.claude/teams/test/file.txtsucceeds without prompt

  2. Create a team and spawn a teammate with bypassPermissions mode

  3. Have the teammate write to ~/.claude/teams/test/file.txtprompted for permission

Test results from this session

AgentModeWrite targetPrompted?Files on disk?
LeadbypassPermissions~/.claude/{teams,tasks,eval}/**NoYes
Teammate 1default~/.claude/{teams,tasks,eval}/**Unanswered → idleNo
Teammate 2bypassPermissions~/.claude/{teams,tasks,eval}/**Unanswered → idleNo
Teammate 3bypassPermissions (Bash)~/.claude/{teams,tasks,eval}/**Unanswered → idleNo
Teammate 4bypassPermissions/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

  • TeamCreate stores team config at ~/.claude/teams/{name}/config.json (docs)
  • TaskCreate stores 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

extent analysis

TL;DR

Teammates may need explicit configuration to inherit the lead's permissions, despite the documentation stating they should inherit these settings automatically.

Guidance

  • Review the ~/.claude/settings.json file to ensure the permissions.allow rules are correctly formatted and cover all necessary paths.
  • Verify that the bypassPermissions mode is correctly applied to teammates, as this mode should allow writes to protected directories without prompting.
  • Check the documentation for any specific configuration requirements for agent teams and teammates to ensure that all necessary settings are in place.
  • Consider testing with a simplified permissions.allow rule set to isolate the issue and confirm that the problem is not due to a specific rule or path.

Example

No code snippet is provided as the issue seems to be related to configuration and permissions rather than code.

Notes

The issue may be related to how permissions are inherited by teammates from the lead session, and further investigation into the configuration and documentation may be necessary to resolve the issue.

Recommendation

Apply a workaround by explicitly configuring teammates to use the same permissions.allow rules as the lead session, as the automatic inheritance of permissions appears to not be functioning as expected.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING