Enforce Teams
Enforce Claude Code Agent Teams usage at configurable delegation levels.
Claude Code's Agent Teams feature lets you coordinate multiple Claude instances working in parallel. By default, Claude won't create a team without your approval.
Enforce Teams changes that. Choose a delegation level, and the team leader automatically creates agent teams based on your configured policy — no slash commands or special prompts needed.
Prerequisites
Agent Teams is an experimental feature that must be opted into before this plugin can work. Enable it by adding the following to your settings:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
Add this to ~/.claude/settings.json (global) or .claude/settings.json (per-project).
Features
- Auto-activation via UserPromptSubmit hook — delegation behavior injected into every conversation turn
- 3 delegation levels — from "delegate everything" to "default behavior"
/enforce-teams command to switch levels anytime
Install
Step 1: Add the marketplace
claude plugin marketplace add Wan-ZL/claude-enforce-teams
Or in Claude Code:
/plugin marketplace add Wan-ZL/claude-enforce-teams
Step 2: Install the plugin
claude plugin install enforce-teams@claude-enforce-teams
Or in Claude Code:
/plugin install enforce-teams@claude-enforce-teams
Step 3: Restart Claude Code
Restart Claude Code to load the plugin hooks. You can verify the hook is loaded by running /hooks — you should see:
bash ${CLAUDE_PLUGIN_ROOT}/hooks/enforce_teams_check.sh (read-only) Plugin Hooks
Step 4: Configure delegation level (optional)
/enforce-teams
Choose from 3 levels. The default is Smart Delegate. The selected level takes effect in the next new conversation.
Delegation Levels
┌───┬──────────────────┬──────────────────────────────────────────────────────────┐
│ # │ Level │ Behavior │
├───┼──────────────────┼──────────────────────────────────────────────────────────┤
│ 3 │ Full Delegate │ Pure coordinator. Delegates ALL work to teammates. │
│ 2 │ Smart Delegate * │ Creates teams for complex tasks. Handles simple directly.│
│ 1 │ Off │ Default Claude Code behavior. Teams require your approval│
└───┴──────────────────┴──────────────────────────────────────────────────────────┘
* = Recommended
Full Delegate (Level 3)
The team leader becomes a pure coordinator. Every user message triggers a team — the leader never does work directly. Even simple questions go through a teammate. This maximizes parallelism but uses more tokens.
Smart Delegate (Level 2) — Recommended
The team leader creates teams when the task is complex enough to benefit from parallel work (3+ files, research, review, debugging, multi-file implementation). Simple tasks like typo fixes or direct questions are handled directly without a team.
Off (Level 1)
Restores default Claude Code behavior. The team leader may suggest creating a team for complex tasks, but will always ask for your approval first. Teams are never created automatically.
How It Works
The Problem
Claude Code has Agent Teams built in, but it defaults to asking for permission before creating teams. Even for tasks that clearly benefit from parallel work (researching a bug from multiple angles, reviewing code for security AND performance, implementing across frontend + backend), Claude asks first rather than just creating the team.
The Solution
Enforce Teams uses a UserPromptSubmit hook to inject delegation behavior into every conversation turn. The hook reads the configured level from ~/.claude/enforce-teams-level and injects the appropriate context that tells Claude:
- Decision criteria — when to create a team vs work alone
- Team templates — which team composition to use for research, implementation, review, or debugging
- Orchestration rules — how to manage tasks, file ownership, and cleanup
This approach means the plugin does not modify your CLAUDE.md. The behavior is injected dynamically at the start of each conversation turn.
Examples
Smart Delegate level (recommended)
You say: "Investigate why the login is slow"
The team leader automatically:
- Creates team
debug-login
- Creates 3 tasks (database query analysis, auth middleware profiling, frontend rendering check)
- Spawns 3 teammates, one per hypothesis
- Teammates investigate in parallel, message each other to challenge theories
- Leader synthesizes findings and reports the root cause
- Cleans up the team
You say: "Fix the typo in README"
Leader: Just fixes it. No team needed.
Changing levels
Directly:
/enforce-teams full-delegate
Or interactively:
/enforce-teams