focus-chain.mdx 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. ---
  2. title: "Focus Chain"
  3. sidebarTitle: "Focus Chain"
  4. ---
  5. Focus Chain is a task management enhancement feature in Cline that provides automatic todo list management with real-time progress tracking throughout your tasks.
  6. <Frame>
  7. <img
  8. src="https://storage.googleapis.com/cline_public_images/docs/assets/2dos.gif"
  9. alt="Focus Chain todo list management with real-time progress tracking"
  10. />
  11. </Frame>
  12. This enables Cline to work on long-horizon tasks, seamlessly managing the context sent to LLMs, and keeping Cline on track across many context window resets.
  13. <Tip>
  14. Focus Chain works particularly well with Cline's [Deep Planning slash command](/features/slash-commands/deep-planning), providing seamless progress tracking for implementation tasks created through the [planning process](/features/plan-and-act).
  15. </Tip>
  16. ## Key Features
  17. ### Automatic Todo List Generation
  18. Cline analyzes your task and automatically creates a comprehensive todo list with:
  19. - Clear, actionable items in markdown checklist format
  20. - Logical breakdown of complex tasks into manageable steps
  21. - Real-time updates as work progresses
  22. ### User-Editable Todo Lists
  23. Todo lists are stored as editable markdown files:
  24. - Direct editing through your preferred markdown editor
  25. - Automatic detection of changes you make
  26. - Seamless integration back into Cline's workflow
  27. - Quick access through the edit button in the task header
  28. ### Visual Progress Tracking
  29. The task header displays clear progress indicators:
  30. - **Step counters** showing current progress (e.g., "3/8")
  31. - **Completed items** clearly marked with checkmarks
  32. - **Current work** highlighted with indicators
  33. - **Expandable view** to see the full todo list
  34. ### Smart Reminder System
  35. Configurable reminders ensure todo lists stay current:
  36. - Default reminder every 6 messages (customizable 1-100)
  37. - Automatic prompts when switching from Plan Mode to Act Mode
  38. - User-triggered updates when todo lists are manually edited
  39. ## Getting Started
  40. <Steps>
  41. <Step title="Open Cline Settings">
  42. - Click the gear icon in the Cline sidebar
  43. - Navigate to the "Features" section
  44. </Step>
  45. <Step title="Enable Focus Chain">
  46. - Check "Enable Focus Chain"
  47. - Optionally adjust "Remind Cline Interval" (default: 6 messages)
  48. </Step>
  49. <Step title="Start a New Task">
  50. - Begin a new task
  51. - Cline will automatically start creating and managing todo lists
  52. </Step>
  53. </Steps>
  54. | Setting | Default | Range | Description |
  55. |---------|---------|-------|-------------|
  56. | Enable Focus Chain | Disabled | On/Off | Enables enhanced task progress tracking |
  57. | Remind Cline Interval | 6 | 1-100 messages | How often Cline updates the todo list |
  58. ## Usage Examples
  59. #### 1. Task Initiation
  60. When you start a new task with Focus Chain enabled:
  61. ``` markdown User Request
  62. User: "Create a user authentication system for my React app"
  63. Cline: [Analyzes request and creates todo list]
  64. ```
  65. #### 2. Todo List Created
  66. Cline creates a comprehensive plan for the task, stored in a markdown file:
  67. ```markdown Todo List Created
  68. - [ ] Set up project structure
  69. - [ ] Install authentication dependencies
  70. - [ ] Create user registration component
  71. - [ ] Implement login functionality
  72. - [ ] Add password validation
  73. - [ ] Set up user database schema
  74. - [ ] Write authentication tests
  75. - [ ] Deploy to staging environment
  76. ```
  77. #### 3. Progress Tracking
  78. As Cline works, the task header shows real-time progress:
  79. ```markdown Todo List Header
  80. [3/8] Implement login functionality ⌄
  81. ```
  82. Click to expand and see the full list:
  83. ```markdown Full Todo List
  84. ✓ Set up project structure
  85. ✓ Install authentication dependencies
  86. ✓ Create user registration component
  87. ○ Implement login functionality ← Currently working
  88. ○ Add password validation
  89. ○ Set up user database schema
  90. ○ Write authentication tests
  91. ○ Deploy to staging environment
  92. ```
  93. #### 4. User Editing
  94. Need to tweak the todo list? No problem.
  95. <Steps>
  96. <Step title="Open the todo list">
  97. Click the edit button in the expanded todo view
  98. </Step>
  99. <Step title="Edit the markdown file">
  100. A markdown file opens in your editor:
  101. ```markdown Editing Todo List
  102. # Focus Chain Todo List for Task abc123
  103. <!-- Edit this markdown file to update your focus chain todo list -->
  104. <!-- Use - [ ] for incomplete items and - [x] for completed items -->
  105. - [x] Set up project structure
  106. - [x] Install authentication dependencies (e.g., Firebase Auth)
  107. - [x] Create user registration component
  108. - [ ] Implement login functionality
  109. - [ ] Add password reset feature
  110. - [ ] Set up protected routes
  111. - [ ] Implement logout functionality
  112. - [ ] Add user profile page
  113. - [ ] Write authentication tests
  114. - [ ] Deploy to staging environment
  115. <!-- Save this file to update the task's todo list -->
  116. ```
  117. </Step>
  118. <Step title="Make your changes">
  119. Add, remove, or reorder items as needed
  120. </Step>
  121. <Step title="Save the file">
  122. Cline automatically detects and uses your updates
  123. </Step>
  124. </Steps>
  125. ## File Structure
  126. ### Todo List Storage
  127. Todo lists are stored as markdown files in your task directory:
  128. ``` markdown
  129. <VSCode Global Storage>/
  130. tasks/
  131. <taskId>/
  132. focus_chain_taskid_<taskId>.md
  133. ... other task files
  134. ```
  135. ### Markdown Format
  136. Todo files use standard markdown checklist syntax:
  137. ```markdown Example Todo Syntax
  138. # Focus Chain Todo List for Task abc123
  139. <!-- Edit this markdown file to update your focus chain todo list -->
  140. <!-- Use the format: - [ ] for incomplete items and - [x] for completed items -->
  141. - [x] Set up project structure
  142. - [x] Install authentication dependencies
  143. - [ ] Create user registration component
  144. - [ ] Implement login functionality
  145. - [ ] Add password validation
  146. - [ ] Set up user database schema
  147. - [ ] Write authentication tests
  148. - [ ] Deploy to staging environment
  149. <!-- Save this file and the todo list will be updated in the task -->
  150. ```
  151. ## Integration with Plan/Act Mode
  152. Focus Chain works seamlessly with Cline's [Plan/Act mode](/features/plan-and-act):
  153. - **Plan Mode**: Optional todo lists for presenting concrete steps
  154. - **Act Mode**: Automatic todo creation when switching from Plan Mode
  155. <Tip>
  156. For complex projects, start in Plan Mode to discuss and refine your approach before switching to Act Mode for implementation.
  157. </Tip>
  158. ## Best Practices
  159. <AccordionGroup>
  160. <Accordion title="For Effective Todo Lists">
  161. 1. **Start with Clear Requests**
  162. - Provide detailed initial task descriptions
  163. - Include specific requirements and constraints
  164. - Mention any preferred technologies or approaches
  165. 2. **Review Generated Lists**
  166. - Check that Cline's breakdown aligns with your expectations
  167. - Verify that all important steps are included
  168. - Ensure the order makes sense for your project
  169. 3. **Edit When Needed**
  170. - Add missing steps you identify
  171. - Remove unnecessary items
  172. - Reorder steps for better workflow
  173. - Add more specific details to general items
  174. </Accordion>
  175. <Accordion title="For Complex Projects">
  176. 1. **Use Plan Mode First**
  177. - Discuss the approach before implementation
  178. - Refine requirements through conversation
  179. - Switch to Act Mode when ready to begin work
  180. 2. **Break Down Large Tasks**
  181. - Split complex projects into smaller, manageable tasks
  182. - Create separate todo lists for different components
  183. - Focus on one major area at a time
  184. 3. **Regular Reviews**
  185. - Check progress periodically during long tasks
  186. - Update todo lists as requirements evolve
  187. - Communicate changes to Cline through edits
  188. </Accordion>
  189. <Accordion title="For Collaboration">
  190. 1. **Share Todo Files**
  191. - Todo markdown files can be shared with team members
  192. - Include in version control for project documentation
  193. - Use as basis for project planning discussions
  194. 2. **Consistent Format**
  195. - Follow the standard markdown checklist format
  196. - Keep item descriptions clear and actionable
  197. - Use consistent terminology across todo lists
  198. </Accordion>
  199. </AccordionGroup>
  200. ## Troubleshooting
  201. Having issues? Try these quick fixes:
  202. <AccordionGroup>
  203. <Accordion title="Todo list not updating?">
  204. - Check that Focus Chain is enabled in settings
  205. - Focus Chain may not work as well with smaller, less capable models
  206. - Ensure file permissions are correct in the task directory
  207. </Accordion>
  208. <Accordion title="Can't edit todo file?">
  209. - Verify your editor supports markdown
  210. - Check VSCode has write permissions for the directory
  211. </Accordion>
  212. <Accordion title="Progress not displaying?">
  213. - Ensure todo items use correct syntax (`- [ ]` and `- [x]`)
  214. - Verify the markdown file is properly formatted
  215. </Accordion>
  216. </AccordionGroup>
  217. Still stuck? Use the [/reportbug](/features/slash-commands/report-bug) command in Cline to get help.
  218. ## Technical Details (for the curious)
  219. <AccordionGroup>
  220. <Accordion title="File Monitoring">
  221. - Real-time file watching detects changes to todo markdown files
  222. - Automatic synchronization between file edits and UI updates
  223. - Graceful handling of file creation, modification, and deletion
  224. </Accordion>
  225. <Accordion title="Progress Calculation">
  226. - Dynamic counting of completed vs. total todo items
  227. - Support for both `- [x]` and `- [X]` completion syntax
  228. - Unicode symbols (✓, ○) for enhanced visual display
  229. </Accordion>
  230. <Accordion title="Privacy Considerations">
  231. - Todo lists stored locally in VSCode workspace
  232. - No todo content transmitted to external services
  233. - Usage telemetry (can be disabled in settings)
  234. </Accordion>
  235. </AccordionGroup>
  236. Focus Chain turns Cline into your personal project manager, keeping you on track and your tasks organized. Give it a try on your next project!