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
{{ message }}
Repository navigation
Commit 45bdab1
Browse filesBrowse the repository at this point in the historyBrowse files
prompt+=`You can dispatch subagents using the dispatch_agent tool. Available profiles:\n`;
76
+
prompt+='You can dispatch subagents using the dispatch_agent tool. Available profiles:\n';
77
77
for(constpofenabledProfiles){
78
78
prompt+=`\n### ${p.name}\n${p.description}`;
79
79
if(p.tools&&p.tools.length>0){
80
80
prompt+=`\nTools: ${p.tools.join(', ')}`;
81
81
}
82
82
}
83
+
84
+
prompt+=`
85
+
86
+
### When to dispatch
87
+
88
+
Dispatch a subagent when the task involves extensively reading files, searching across the codebase, or analyzing a whole module. A subagent runs in an independent context window — all of its tool calls (read_file, search_code, etc.) consume only the subagent\'s own context. Only the final result comes back to you.
89
+
90
+
**Dispatch = protect your context window.** If you do the same work yourself, all raw content goes directly into your context.
91
+
92
+
### When NOT to dispatch
93
+
94
+
- The task needs only a small amount of information — do it yourself.
95
+
- You already know the exact file path and what to look for — use read_file / search_code directly.
96
+
97
+
### Rules
98
+
99
+
1. Once you dispatch a subagent, do **NOT** also perform the same searches yourself.
100
+
2. **Do NOT peek** — the subagent runs independently. Do not try to read its intermediate output, as that defeats the context protection.
101
+
3. When the subagent returns, relay its conclusion to the user concisely.
102
+
103
+
### Example
104
+
105
+
\`\`\`
106
+
User: "Find all API route definitions in this project."
107
+
108
+
Thinking: This requires searching multiple directories broadly. If I grep and read files myself, all the raw output piles into my context. I should dispatch explore.
109
+
110
+
dispatch_agent({
111
+
agent: "explore",
112
+
prompt: "Search the entire project for API route definitions..."
'You are a read-only code exploration agent. Your role is to help explore and understand codebases through reading files, searching for symbols, and analyzing code structure. You can only read; you cannot write or modify files.',
0 commit comments