source dump of claude code
at main 56 lines 2.8 kB view raw
1import { isAgentSwarmsEnabled } from '../../utils/agentSwarmsEnabled.js' 2 3export const DESCRIPTION = 'Create a new task in the task list' 4 5export function getPrompt(): string { 6 const teammateContext = isAgentSwarmsEnabled() 7 ? ' and potentially assigned to teammates' 8 : '' 9 10 const teammateTips = isAgentSwarmsEnabled() 11 ? `- Include enough detail in the description for another agent to understand and complete the task 12- New tasks are created with status 'pending' and no owner - use TaskUpdate with the \`owner\` parameter to assign them 13` 14 : '' 15 16 return `Use this tool to create a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user. 17It also helps the user understand the progress of the task and overall progress of their requests. 18 19## When to Use This Tool 20 21Use this tool proactively in these scenarios: 22 23- Complex multi-step tasks - When a task requires 3 or more distinct steps or actions 24- Non-trivial and complex tasks - Tasks that require careful planning or multiple operations${teammateContext} 25- Plan mode - When using plan mode, create a task list to track the work 26- User explicitly requests todo list - When the user directly asks you to use the todo list 27- User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated) 28- After receiving new instructions - Immediately capture user requirements as tasks 29- When you start working on a task - Mark it as in_progress BEFORE beginning work 30- After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation 31 32## When NOT to Use This Tool 33 34Skip using this tool when: 35- There is only a single, straightforward task 36- The task is trivial and tracking it provides no organizational benefit 37- The task can be completed in less than 3 trivial steps 38- The task is purely conversational or informational 39 40NOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly. 41 42## Task Fields 43 44- **subject**: A brief, actionable title in imperative form (e.g., "Fix authentication bug in login flow") 45- **description**: What needs to be done 46- **activeForm** (optional): Present continuous form shown in the spinner when the task is in_progress (e.g., "Fixing authentication bug"). If omitted, the spinner shows the subject instead. 47 48All tasks are created with status \`pending\`. 49 50## Tips 51 52- Create tasks with clear, specific subjects that describe the outcome 53- After creating tasks, use TaskUpdate to set up dependencies (blocks/blockedBy) if needed 54${teammateTips}- Check TaskList first to avoid creating duplicate tasks 55` 56}