proactive-delegation — Claude Code rule: what it does, how to install
The proactive-delegation rule directs Claude Code to proactively hand off tasks to specialized subagents. It preserves the main context by detecting research, bug fixes, and parallel work automatically.
MIT ★ 3,951 updated 2026-01-26
.claude/rules/proactive-delegation.mdWhat proactive-delegation does
The rule changes how Claude Code handles user requests. When prompts include words like "add", "fix", or "explore", it routes work into workflows such as /build, /fix, or /explore. The primary session stays reserved for orchestration and summaries. Subagents handle heavy work. Reading three or more files goes to scout, external research goes to oracle, and testing routes to arbiter or validator.
Independent tasks trigger parallel agent runs. Once an action finishes, the rule suggests the next logical step. It recommends /commit after a fix, or /premortem after planning. Checking past solutions relies on recall_learnings.py, which requires $CLAUDE_OPC_DIR and uv installed in the environment.
Small tasks stay in the primary thread. Single direct questions and quick checks across one or two files do not spawn subagents.
What it helps with
- keep main context clear during multi-file inspection
- run independent research and diagnostics in parallel
- chain development stages from planning to commit
- verify existing project memory before repeating research
Example prompts for the agent
- Fix the auth bug and add tests
- Research auth patterns and check performance
- Explore how the billing service works and propose changes
How to install proactive-delegation
Manually: put the files in place
.claude/rules/proactive-delegation.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/proactive-delegation.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/proactive-delegation.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/proactive-delegation.mdManually: put the files in place
.clinerules/proactive-delegation.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about proactive-delegation
How to install proactive-delegation in Claude Code?
Save the rule to .claude/rules/proactive-delegation.md in your project.
When does proactive-delegation avoid spawning subagents?
Simple single questions and quick checks across one or two files stay in the main context. The agent also skips delegation when the user asks for a direct reply or when minimal latency is preferred.
What is needed for memory recall before research tasks?
The memory check command executes scripts/core/recall_learnings.py, which requires the $CLAUDE_OPC_DIR environment variable and uv installed.
Source text
proactive-delegation.md · MIT
# Proactive Agent Delegation Keep main context clean by delegating to agents. Don't wait to be asked. ## Pattern Detection When user message arrives, detect: | Pattern | Signal | Action | |---------|--------|--------| | Multiple tasks | "X and Y", "also", comma-separated | Suggest parallel agents | | Research needed | "how does", "what is", "find" | Spawn scout/oracle | | Implementation | "add", "implement", "create" | Route to /build workflow | | Bug/issue | "fix", "broken", "failing", "debug" | Route to /fix workflow | | Exploration | "understand", "explore", "how does X work" | Route to /explore | ## Workflow Suggestions Detect and suggest appropriate workflows: ``` User: "Fix the auth bug and add tests" Claude: "I detect a /fix workflow with 2 tasks: 1. debug-agent → investigate 2. spark → implement fix 3. arbiter → add tests Proceed?" ``` ## Main Context = Coordination Only **Delegate to agents:** - Reading 3+ files → scout - External research → oracle - Implementation → kraken/spark - Running tests → validator/arbiter - Debugging → debug-agent/sleuth **Keep in main context:** - Understanding user intent - Workflow selection - Agent coordination - Presenting summaries ## Parallel Detection When tasks are independent, spawn agents in parallel: ``` User: "Research auth patterns and check performance" → Detect: 2 independent tasks → Spawn: oracle + profiler (parallel) → Synthesize results ``` ## Workflow Chaining After completing a workflow, suggest the natural next step: | After | Suggest | |-------|---------| | /explore | "Ready for /build brownfield?" | | /plan | "Run /premortem before implementing?" | | /fix | "Create /commit for the fix?" | | Research complete | "Create plan from findings?" | ## Memory Check Before research tasks, check for prior work: ```bash # Quick memory check (cd $CLAUDE_OPC_DIR && uv run python scripts/core/recall_learnings.py --query "<topic>" --k 3 --text-only) ``` If relevant memory found: "I researched this on [date] - reuse or refresh?" ## Don't Over-Delegate Keep in main context when: - Single simple question (just answer it) - Quick file lookup (1-2 files) - User explicitly wants direct response - Latency matters more than context preservation
© parcadei · MIT · parcadei/Continuous-Claude-v3