Main context tokens are MORE valuable than subagent tokens. Subagent contexts are ephemeral and infinitely spawnable. Main context exhaustion = session death.
This skill governs delegation decisions. It complements never-guess (don't fabricate when uncertain about facts) and resolve-ambiguity (how to gather missing information).
- Do I have exact file path(s)? (Not function name, not directory, not pattern)
- Is this 1-2 tool calls with predictable output?
- Have I done fewer than 3 direct operations since last delegation?
If ANY answer is NO → Delegate via Task tool.
UNCERTAIN (delegate):
- User provides function/class name without path
- User provides directory or category ("all files in X")
- User provides error message without file location
- Scope is unknown (could be 1 file or 20)
- Output size is unpredictable or large
Rule: If you would need Grep/Glob/Read to find the location, you don't have certainty—you have a search needle.
This is TRANSITION. Delegate the action phase.
Task(general-purpose): "Update architecture docs to consolidate duplications based on analysis"
When uncertain about facts → never-guess → resolve-ambiguity
When uncertain about scope → delegate-first → Task delegation
If you need to resolve ambiguity about what to do → resolve-ambiguity
If you know what to do but scope is uncertain → delegate-first
A Task that "wasn't necessary" costs ~500 tokens overhead.
Direct execution that exhausts context kills the session.
Err toward delegation.
- Main context stays under 50% for extended sessions
- Research phases delegate to Task(Explore)
- Implementation phases delegate to Task(general-purpose)
- Debug phases delegate to Task(luc:fix-phase)
- Large MCP outputs never enter main context
- Session longevity increases 3-5x for complex work
- Direct execution is rare exception, not default
1---2name: delegate-first3description: Behavioral principle for context preservation through strategic delegation. Use when starting multi-step operations, uncertain about scope, or when direct execution might exhaust context. Complements never-guess and resolve-ambiguity skills.4---5
6<objective>
7Establish Claude's behavioral principle: **Delegate by default. Execute directly only when certainty is absolute.**
8
9Main context tokens are MORE valuable than subagent tokens. Subagent contexts are ephemeral and infinitely spawnable. Main context exhaustion = session death.
10
11This skill governs delegation decisions. It complements `never-guess` (don't fabricate when uncertain about facts) and `resolve-ambiguity` (how to gather missing information).
12</objective>
13
14<quick_start>
15<core_principle>
16Before executing ANY operation, verify absolute certainty:
17
181. **Do I have exact file path(s)?** (Not function name, not directory, not pattern)
192. **Is this 1-2 tool calls with predictable output?**
203. **Have I done fewer than 3 direct operations since last delegation?**
21
22If ANY answer is NO → Delegate via Task tool.
23</core_principle>
24
25<certainty_definition>
26**CERTAIN** (execute directly):
27- User provides EXACT file path: "Edit src/auth/login.ts line 50"
28- Single file, single operation, path in hand
29- Output size is predictable and small
30
31**UNCERTAIN** (delegate):
32- User provides function/class name without path
33- User provides directory or category ("all files in X")
34- User provides error message without file location
35- Scope is unknown (could be 1 file or 20)
36- Output size is unpredictable or large
37
38Rule: If you would need Grep/Glob/Read to find the location, you don't have certainty—you have a search needle.
39</certainty_definition>
40</quick_start>
41
42<delegation_traps>
43<trap name="Specificity Trap">
44<description>
45User gives specific request but you don't know WHERE or HOW MANY.
46</description>
47
48<example>
49User says: "Fix the getUserById bug"
50- FALSE confidence: You know WHAT to fix
51- REALITY: You don't know WHERE (which file) or HOW MANY locations
52</example>
53
54<signal>
55Specific request WITHOUT exact file path(s)
56</signal>
57
58<action>
59Task(Explore): "Find all locations where getUserById is defined or called, identify the bug"
60</action>
61
62<anti_pattern>
63Starting Grep/Glob directly in main context to "quickly find" the location.
64This loads search results into main context—the search itself should be delegated.
65</anti_pattern>
66</trap>
67
68<trap name="Debug-After-Delegation Trap">
69<description>
70You correctly delegated implementation, but revert to direct debugging when issues arise.
71</description>
72
73<pattern>
741. You delegated implementation to subagent ✓
752. Subagent returns with errors or integration issues
763. You think "let me quickly fix this" ✗
774. 33 direct operations later, main context exhausted
78</pattern>
79
80<reality>
81Debugging is often MORE complex than initial implementation.
82The "quick fix" illusion is the highest-risk moment.
83</reality>
84
85<rule>
86**If you delegated creation, delegate fixing.**
87</rule>
88
89<action>
90Task(luc:fix-phase): "Fix these issues from the implementation phase: [list errors]"
91</action>
92
93<recognition>
94When you notice yourself about to do direct edits after a Task returned with issues, STOP.
95Create a new Task for the fix phase.
96</recognition>
97</trap>
98
99<trap name="MCP Tool Blindspot">
100<description>
101Large-output MCP tools load massive content into main context that cannot be "unseen."
102</description>
103
104<dangerous_tools>
105- Analyzers: dart analyze, eslint, tsc --noEmit, pylint
106- Test runners: pytest, jest, flutter test, cargo test
107- Build tools: flutter build, npm run build, cargo build
108- Linters with file output
109</dangerous_tools>
110
111<example>
112Direct call: mcp__dart__analyze_files → 98KB output into main context
113Delegated: Task processes 98KB in its context, returns 500-token summary
114</example>
115
116<action>
117Task(luc:output-analyzer): "Run dart analyze and fix all errors, report remaining warnings"
118</action>
119
120<rule>
121NEVER call large-output MCP tools directly in main context.
122Always wrap in Task for processing.
123</rule>
124</trap>
125
126<trap name="Multi-Turn Iteration Trap">
127<description>
128Per-turn counting misses cumulative context waste across the conversation.
129</description>
130
131<pattern>
132Turn 1: 1 edit (under threshold) ✓
133Turn 2: 1 edit (under threshold) ✓
134Turn 3: 1 edit (under threshold) ✓
135...
136Turn 10: 1 edit (under threshold) ✓
137Result: 10 edits, significant context consumed, no delegation triggered
138</pattern>
139
140<tracking>
141Track across the CONVERSATION, not per-turn:
142- Reads since last Task delegation
143- Edits since last Task delegation
144- Consecutive turns working on same file
145</tracking>
146
147<thresholds>
148| Metric | Threshold | Action |
149|--------|-----------|--------|
150| Reads since last Task | ≥2 | Task(Explore) |
151| Edits since last Task | ≥3 | Task(general-purpose) |
152| Same-file turns | ≥3 | Suggest delegation to user |
153</thresholds>
154
155<action>
156After hitting threshold: "I've been working directly for [N] operations. To preserve context, I'll delegate the remaining work."
157</action>
158</trap>
159
160<trap name="Research-to-Action Transition Trap">
161<description>
162The highest-risk moment: switching from research mode to action mode.
163</description>
164
165<research_indicators>
166Recent turns contained:
167- WebSearch calls
168- Multiple Read operations
169- Grep/Glob exploration
170- Task(Explore) results
171</research_indicators>
172
173<action_indicators>
174Current request contains:
175- Edit/Write language ("update", "fix", "change", "remove", "add")
176- Mutation verbs applied to researched content
177- References to findings ("the files we found", "based on analysis")
178</action_indicators>
179
180<rule>
181At research→action transition:
1821. PAUSE before executing
1832. DEFAULT to Task(general-purpose) for action phase
1843. Do NOT execute directly regardless of apparent simplicity
185</rule>
186
187<example>
188[Previous 5 turns: reading architecture docs, exploring codebase]
189User: "Now update them to consolidate the duplications"
190
191This is TRANSITION. Delegate the action phase.
192Task(general-purpose): "Update architecture docs to consolidate duplications based on analysis"
193</example>
194</trap>
195</delegation_traps>
196
197<decision_tree>
198<flow>
199User Request Received
200│
201├─► Contains "find where", "review all", "search for", "what files"?
202│ └─► YES → Task(Explore) IMMEDIATELY
203│
204├─► Has EXACT file path(s) provided by user?
205│ ├─► YES + 1-2 predictable ops → Direct execution OK
206│ └─► NO → Task(Explore) to find locations first
207│
208├─► Previous Task returned with errors/issues?
209│ └─► YES → Task(luc:fix-phase) for fixes
210│ DO NOT switch to direct debugging
211│
212├─► Will call large-output MCP tool (analyzer, test runner, build)?
213│ └─► YES → Task(luc:output-analyzer) wrapper
214│
215├─► Done ≥2 Reads or ≥3 Edits since last Task?
216│ └─► YES → Delegate remainder to Task
217│
218├─► Just finished research phase, now doing action?
219│ └─► YES → Task(general-purpose) for action phase
220│
221└─► Single known file, 1-2 ops, small predictable output?
222 └─► YES → Direct execution OK
223</flow>
224</decision_tree>
225
226<delegation_targets>
227<target name="Task(Explore)">
228For: Finding locations, understanding scope, research
229When: "Find where", unknown file paths, exploration needed
230</target>
231
232<target name="Task(general-purpose)">
233For: Multi-file operations, implementation, action phases
234When: Known scope but multiple files/edits needed
235</target>
236
237<target name="Task(luc:fix-phase)">
238For: Debugging after delegated implementation
239When: Previous Task returned with errors to fix
240</target>
241
242<target name="Task(luc:output-analyzer)">
243For: Large-output MCP tool processing
244When: Analyzers, test runners, build tools
245</target>
246</delegation_targets>
247
248<integration>
249<with_never_guess>
250`never-guess` handles uncertainty about FACTS.
251`delegate-first` handles uncertainty about SCOPE.
252
253When uncertain about facts → never-guess → resolve-ambiguity
254When uncertain about scope → delegate-first → Task delegation
255</with_never_guess>
256
257<with_resolve_ambiguity>
258`resolve-ambiguity` gathers missing INFORMATION.
259`delegate-first` protects CONTEXT during execution.
260
261If you need to resolve ambiguity about what to do → resolve-ambiguity
262If you know what to do but scope is uncertain → delegate-first
263</with_resolve_ambiguity>
264</integration>
265
266<trade_off>
267<principle>
268False positives (unnecessary delegation) are acceptable.
269Context exhaustion is not.
270
271A Task that "wasn't necessary" costs ~500 tokens overhead.
272Direct execution that exhausts context kills the session.
273
274**Err toward delegation.**
275</principle>
276</trade_off>
277
278<anti_patterns>
279<pattern name="Quick Look Fallacy">
280**Wrong**: "Let me quickly grep for this" (loads results into main context)
281**Right**: Task(Explore): "Find where X is defined"
282</pattern>
283
284<pattern name="Just One More Edit">
285**Wrong**: "I'll just make one more edit directly" (after 4 previous edits)
286**Right**: "I've done several edits. Delegating remaining changes."
287</pattern>
288
289<pattern name="I Know What To Fix">
290**Wrong**: Starting direct edits after subagent reported issues
291**Right**: Task(luc:fix-phase) for the debugging work
292</pattern>
293
294<pattern name="Small Output Assumption">
295**Wrong**: "dart analyze probably won't return much" (calls directly)
296**Right**: Always assume MCP tools return large output; delegate
297</pattern>
298
299<pattern name="Research Complete, Now Execute">
300**Wrong**: After 10 turns of research, doing direct edits
301**Right**: Delegate the action phase after research
302</pattern>
303</anti_patterns>
304
305<success_criteria>
306The principle is working when:
307
308- Main context stays under 50% for extended sessions
309- Research phases delegate to Task(Explore)
310- Implementation phases delegate to Task(general-purpose)
311- Debug phases delegate to Task(luc:fix-phase)
312- Large MCP outputs never enter main context
313- Session longevity increases 3-5x for complex work
314- Direct execution is rare exception, not default
315</success_criteria>