Skip to main content
rule CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/proactive-delegation.md
Open on GitHub

What 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.md

The paths frontmatter field limits the files

Step 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

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set161

The whole set →
agentica-spawn agentica-spawn — a skill that spawns multi-agent patterns via Agentica: swarms for parallel research, hierarchies for role-based tasks, generator-critic loops for iterative refinement, and juries for consensus. CX Codex +1 ★ 3,951repo stars parallel-agent-contracts parallel-agent-contracts enforces type ownership rules across parallel agents in TypeScript projects, requiring grep checks and tsc verification before any subtask completes. CX Codex +1 ★ 3,951repo stars spark spark is a Claude Code subagent for small, focused code changes. It handles quick fixes and tweaks, then writes a summary to a project file. CX Codex ★ 3,951repo stars entropy A skill for Shannon entropy, conditional and differential entropy, KL divergence, and maximum entropy principle problems. CX Codex +1 ★ 3,951repo stars search-hierarchy The search-hierarchy skill picks a search tool based on whether a question concerns code structure, meaning, or an exact identifier. It helps locate a relevant file before reading it. CX Codex +1 ★ 3,951repo stars channel-capacity A skill for solving information-theory problems: calculating channel capacity, mutual information, and applying the Blahut-Arimoto algorithm. Use it when working with information theory, coding, or communication channels. CX Codex +1 ★ 3,951repo stars rudin-real-complex-analysis rudin-real-complex-analysis is a Claude Code skill for solving problems and checking proofs with Walter Rudin's Real and Complex Analysis textbook, a theorem tree, and Python scripts. CX Codex +1 ★ 3,951repo stars agent-context-isolation agent-context-isolation is a Claude Code skill for routing background-agent results through files. It keeps full agent transcripts out of the main conversation context. CX Codex +1 ★ 3,951repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open