You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hook config source of truth: `hooks/plugin-hooks.json` (not settings.json). All hooks are Python for cross-platform compatibility (Windows/macOS/Linux).
121
123
122
124
### Tool Allowlist
123
125
124
-
Main agent can only use: `AskUserQuestion`, `TaskCreate`, `TaskUpdate`, `TaskList`, `TaskGet`, `Skill`, `SlashCommand`, `Agent`, `Task`, `SubagentTask`, `AgentTask`, `EnterPlanMode`, `ExitPlanMode`, `ToolSearch`
126
+
Main agent can only use: `AskUserQuestion`, `TaskCreate`, `TaskUpdate`, `TaskList`, `TaskGet`, `Skill`, `SlashCommand`, `Agent`, `Task`, `SubagentTask`, `AgentTask`, `EnterPlanMode`, `ExitPlanMode`, `ToolSearch`, `CronCreate`, `CronDelete`, `CronList`
125
127
126
128
Special cases:
127
129
-`Write` tool allowed for temp/scratchpad paths only (`/tmp/`, `/private/tmp/`, `/var/folders/`)
@@ -144,9 +146,10 @@ Special cases:
144
146
145
147
### Skills (forked context)
146
148
147
-
-**task-planner** (`skills/task-planner/SKILL.md`): Legacy planning skill, retained for reference/backward compatibility. The core planning logic (complexity scoring, tier classification, agent assignment, wave scheduling, task creation) has been absorbed into `system-prompts/workflow_orchestrator.md` and now executes as native plan mode (EnterPlanMode/ExitPlanMode) directly in the main agent context rather than a forked skill context.
**Note:** The `task-planner` skill has been removed. Its orchestration and planning functionality is now provided by native plan mode (EnterPlanMode/ExitPlanMode), which handles both planning and execution orchestration directly within the main agent context.
152
+
150
153
### Specialized Agents (8)
151
154
152
155
| Agent | Domain |
@@ -176,12 +179,13 @@ Two team workflow patterns:
176
179
-**Team mode (simple):** Single AGENT TEAM phase with `phase_type: "team"` and `teammates` array -- used for multi-perspective exploration (e.g., "explore from different angles")
177
180
-**Team mode (complex):** Multiple individual phases across waves, all executed as teammates via `Agent(team_name=...)` -- used for collaborative implementation (e.g., "implement project, tasks should be collaborative"). The plan has `execution_mode: "team"` at the top level; no individual phase needs `phase_type: "team"`
178
181
179
-
**Mode selection** uses `team_mode_score` (calculated during plan mode):
**Mode selection** is based on TeamCreate tool availability (detected during plan mode):
183
+
-**If TeamCreate tool is available** (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set): Calculate `team_mode_score` to determine whether to use team mode or subagent mode
- Score >= 5: use team mode; Score < 5: use subagent mode
188
+
-**If TeamCreate tool is not available** (env var not set): Always use subagent mode (≥2 subtasks mandatory)
185
189
186
190
**When team mode is active:**
187
191
-`validate_task_graph_compliance.py` hook is bypassed (team handles dependencies)
@@ -191,7 +195,10 @@ Two team workflow patterns:
191
195
192
196
Agent selection uses keyword matching (≥2 matches threshold, highest count wins). Falls back to general-purpose if 0-1 matches. See `system-prompts/workflow_orchestrator.md` for keyword lists.
193
197
194
-
Agent config format: YAML frontmatter (`name`, `description`, optional `tools`/`model`/`color`) + markdown system prompt body. All agents enforce `DONE|{output_file}` return format.
@@ -287,13 +298,13 @@ Ensure SessionStart hooks are installed (inject_workflow_orchestrator.py) so tha
287
298
288
299
**TeamCreate blocked:**
289
300
```bash
290
-
echo$CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS#Must be "1"
301
+
echo$CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS#Check if set to "1"
291
302
export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
292
303
```
293
-
The PreToolUse hook blocks all team tools (`TeamCreate`, `SendMessage`, pattern `*team*`/`*teammate*`) unless this env var is set. The hook prints a specific error message indicating the env var is missing.
304
+
The PreToolUse hook blocks all team tools (`TeamCreate`, `SendMessage`, pattern `*team*`/`*teammate*`) unless this env var is set. The hook auto-creates `.claude/state/team_mode_active` when the env var is "1" and a team tool is invoked.
294
305
295
306
**Team mode not activating despite keywords:**
296
-
When `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set, team mode is the default. It only falls back to subagent mode when`team_mode_score <= -3` (breadth-only tasks with no complexity factors). Without the env var, plan mode always selects `"subagent"` mode (with ≥2 subtasks mandatory).
307
+
Team mode is activated by tool availability detection during plan mode. Ensure `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set before running a workflow that should use team mode. The planning phase evaluates`team_mode_score` based on task complexity and characteristics. Without the env var, plan mode always selects `"subagent"` mode (with ≥2 subtasks mandatory).
Copy file name to clipboardExpand all lines: README.md
+17-22Lines changed: 17 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -252,14 +252,14 @@ The `plugin-hooks.json` configures the delegation enforcement hooks using cross-
252
252
253
253
**Note:** All hooks use `uv run --no-project --script` for cross-platform compatibility (Windows, macOS, Linux). The `--no-project` flag allows execution without requiring a pyproject.toml, and `--script` directly runs Python scripts using uv's managed interpreter.
@@ -268,22 +268,10 @@ The `plugin-hooks.json` configures the delegation enforcement hooks using cross-
268
268
Multi-step workflow orchestration requires the workflow_orchestrator system prompt to be appended:
269
269
270
270
**Automatic (via SessionStart hook):**
271
-
```json
272
-
{
273
-
"hooks": {
274
-
"SessionStart": [
275
-
{
276
-
"hooks": [
277
-
{
278
-
"type": "append_system_prompt",
279
-
"path": "system-prompts/workflow_orchestrator.md"
280
-
}
281
-
]
282
-
}
283
-
]
284
-
}
285
-
}
286
-
```
271
+
272
+
The `inject_workflow_orchestrator.py` hook uses conditional injection:
273
+
-**On startup/resume:** Injects a lightweight stub that registers `/delegate` and `/bypass` commands without loading the full orchestrator prompt, keeping baseline token overhead minimal.
274
+
-**On `/delegate` invocation:** The full `workflow_orchestrator.md` system prompt is loaded on-demand, providing the complete planning and execution logic only when needed.
287
275
288
276
**What this enables:**
289
277
- Multi-step task detection via pattern matching
@@ -415,7 +403,7 @@ No other configuration is required. Plan mode automatically evaluates whether a
415
403
416
404
### How Mode Selection Works
417
405
418
-
During planning, plan mode calculates a `team_mode_score` based on task characteristics:
406
+
During planning, plan mode checks if the TeamCreate tool is available (indicator that Agent Teams are enabled). If available, it calculates a `team_mode_score` based on task characteristics:
@@ -428,7 +416,7 @@ During planning, plan mode calculates a `team_mode_score` based on task characte
428
416
| Breadth task | -5 | Simple exploration is better as subagents |
429
417
| Phase count <= 3 | -3 | Small workflows don't need team overhead |
430
418
431
-
A score of **5 or higher** (with `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`) triggers team mode. Otherwise, subagent mode is used.
419
+
Default to team mode when Agent Teams available (TeamCreate in tools). Falls back to subagent only when `team_mode_score <= -3` (breadth-only tasks). If TeamCreate tool is not available (env var not set), subagent mode is always selected.
432
420
433
421
### Subagent Mode vs Team Mode
434
422
@@ -503,7 +491,7 @@ Team mode creates two additional state files (automatically cleaned up on comple
503
491
504
492
The framework minimizes command output to reduce context consumption and preserve tokens for meaningful work. Token efficiency is enabled by default (`CLAUDE_TOKEN_EFFICIENCY=1`).
505
493
506
-
### Two-Layer Approach
494
+
### Multi-Layer Approach
507
495
508
496
1.**Behavioral Guidance** — The `token_efficient_cli.md` system prompt (injected via SessionStart) teaches compact flag usage:
509
497
-`git status -sb` (short branch format)
@@ -515,6 +503,13 @@ The framework minimizes command output to reduce context consumption and preserv
515
503
- Git: `push`, `pull`, `commit`, `merge`, `rebase`, `status`, etc.
516
504
- Test runners: `pytest`, `cargo test`, `npm/pnpm/yarn/bun test`, `vitest`, `jest`, `mocha`, etc.
0 commit comments