delegate-first
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.
$ Installieren
git clone https://github.com/rayk/lucid-toolkit /tmp/lucid-toolkit && cp -r /tmp/lucid-toolkit/plugins/luc/skills/delegate-first ~/.claude/skills/lucid-toolkit// tip: Run this command in your terminal to install the skill
name: delegate-first description: 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. allowed-tools:
- Task
- AskUserQuestion
- Read
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).
<quick_start> <core_principle> Before executing ANY operation, verify absolute certainty:
- 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. </core_principle>
<certainty_definition> CERTAIN (execute directly):
- User provides EXACT file path: "Edit src/auth/login.ts line 50"
- Single file, single operation, path in hand
- Output size is predictable and small
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. </certainty_definition> </quick_start>
<delegation_traps> User gives specific request but you don't know WHERE or HOW MANY.
<anti_pattern> Starting Grep/Glob directly in main context to "quickly find" the location. This loads search results into main contextâthe search itself should be delegated. </anti_pattern>
<dangerous_tools>
- Analyzers: dart analyze, eslint, tsc --noEmit, pylint
- Test runners: pytest, jest, flutter test, cargo test
- Build tools: flutter build, npm run build, cargo build
- Linters with file output </dangerous_tools>
<research_indicators> Recent turns contained:
- WebSearch calls
- Multiple Read operations
- Grep/Glob exploration
- Task(Explore) results </research_indicators>
<action_indicators> Current request contains:
- Edit/Write language ("update", "fix", "change", "remove", "add")
- Mutation verbs applied to researched content
- References to findings ("the files we found", "based on analysis") </action_indicators>
This is TRANSITION. Delegate the action phase. Task(general-purpose): "Update architecture docs to consolidate duplications based on analysis" </delegation_traps>
<decision_tree> User Request Received â âââș Contains "find where", "review all", "search for", "what files"? â âââș YES â Task(Explore) IMMEDIATELY â âââș Has EXACT file path(s) provided by user? â âââș YES + 1-2 predictable ops â Direct execution OK â âââș NO â Task(Explore) to find locations first â âââș Previous Task returned with errors/issues? â âââș YES â Task(luc:fix-phase) for fixes â DO NOT switch to direct debugging â âââș Will call large-output MCP tool (analyzer, test runner, build)? â âââș YES â Task(luc:output-analyzer) wrapper â âââș Done â„2 Reads or â„3 Edits since last Task? â âââș YES â Delegate remainder to Task â âââș Just finished research phase, now doing action? â âââș YES â Task(general-purpose) for action phase â âââș Single known file, 1-2 ops, small predictable output? âââș YES â Direct execution OK </decision_tree>
<delegation_targets> For: Finding locations, understanding scope, research When: "Find where", unknown file paths, exploration needed
When uncertain about facts â never-guess â resolve-ambiguity When uncertain about scope â delegate-first â Task delegation </with_never_guess>
<with_resolve_ambiguity>
resolve-ambiguity gathers missing INFORMATION.
delegate-first protects CONTEXT during execution.
If you need to resolve ambiguity about what to do â resolve-ambiguity If you know what to do but scope is uncertain â delegate-first </with_resolve_ambiguity>
<trade_off> False positives (unnecessary delegation) are acceptable. Context exhaustion is not.
A Task that "wasn't necessary" costs ~500 tokens overhead. Direct execution that exhausts context kills the session.
Err toward delegation. </trade_off>
<anti_patterns> Wrong: "Let me quickly grep for this" (loads results into main context) Right: Task(Explore): "Find where X is defined"
<success_criteria> The principle is working when:
- 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 </success_criteria>
Repository
