deep-planning.mdx 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ---
  2. title: "Deep Planning"
  3. sidebarTitle: "Deep Planning"
  4. description: "Transform Cline into a meticulous architect who investigates your codebase and creates comprehensive implementation plans."
  5. ---
  6. Deep Planning (`/deep-planning`) turns Cline into an architect before it becomes a builder. Instead of jumping straight into code, Cline systematically explores your codebase, asks targeted questions, and produces a detailed implementation plan — all before writing a single line.
  7. <Tip>
  8. **When should you use this?** Use `/deep-planning` for features that touch multiple files, architectural changes, complex integrations, or any task where "just start coding" would lead to rework.
  9. </Tip>
  10. ## How It Works
  11. Deep Planning follows a four-step process:
  12. <Steps>
  13. <Step title="Silent Investigation">
  14. Cline explores your codebase without asking you anything. It reads relevant files, traces dependencies, examines patterns, and builds a mental model of how your project is structured. You'll see Cline reading files and running searches during this phase.
  15. This step is intentionally silent — Cline gathers context first so it can ask better questions next.
  16. </Step>
  17. <Step title="Discussion">
  18. Based on what it learned, Cline asks you targeted, specific questions about your requirements and preferences. These aren't generic questions — they're informed by what Cline found in your code.
  19. For example, instead of asking "how should authentication work?", Cline might ask "I see you're using JWT tokens in `auth/middleware.ts` with refresh token rotation. Should the new endpoint follow the same pattern, or do you want session-based auth for this feature?"
  20. Answer these questions to shape the plan. The more specific you are, the better the implementation plan will be.
  21. </Step>
  22. <Step title="Plan Creation">
  23. Cline generates a comprehensive `implementation_plan.md` file in your project. This plan typically includes:
  24. - **Overview** of the feature and its scope
  25. - **File-by-file changes** with specific descriptions of what to add, modify, or remove
  26. - **Dependencies** between changes (what needs to happen first)
  27. - **Edge cases** and error handling considerations
  28. - **Testing strategy** for the implementation
  29. The plan is saved as a markdown file you can review, edit, and share with your team before any code is written.
  30. </Step>
  31. <Step title="Task Creation">
  32. After you approve the plan, Cline creates a new task with the implementation steps loaded as trackable items. This gives you a clean context window focused entirely on execution, with the plan serving as the roadmap.
  33. </Step>
  34. </Steps>
  35. ## Using Deep Planning
  36. ### Invoking It
  37. Type `/deep-planning` in the Cline chat input, followed by a description of what you want to build:
  38. ```
  39. /deep-planning Add a notification system that sends email and in-app
  40. notifications when users receive comments on their posts
  41. ```
  42. The more context you provide upfront, the more focused the investigation phase will be. Include:
  43. - What you want to build
  44. - Any constraints or preferences
  45. - Which parts of the codebase are relevant (if you know)
  46. ### Reviewing the Plan
  47. Once Cline generates `implementation_plan.md`, review it carefully:
  48. 1. **Check the scope** — Does it cover everything you need? Is anything missing?
  49. 2. **Verify the approach** — Does the technical approach match your preferences?
  50. 3. **Review the order** — Are dependencies handled correctly?
  51. 4. **Edit if needed** — It's a markdown file. Change anything that doesn't look right.
  52. Tell Cline about any adjustments before proceeding to implementation.
  53. ## Model-Specific Optimization
  54. The deep planning prompt is optimized for each model family. Cline adapts its investigation and planning approach based on the strengths of whatever model you're using — whether that's Claude, GPT, Gemini, DeepSeek, or others.
  55. This means you get effective deep planning regardless of your model choice, though stronger reasoning models will generally produce more thorough plans.
  56. <Tip>
  57. Consider using a stronger reasoning model for the planning phase and a faster model for implementation. You can configure separate models for Plan and Act modes in Cline Settings. See [Plan & Act Mode](/core-workflows/plan-and-act#using-different-models-for-each-mode) for details.
  58. </Tip>
  59. ## Pairing with Other Features
  60. Deep Planning works well with several other Cline features:
  61. | Feature | How It Helps |
  62. |---------|-------------|
  63. | [Focus Chain](/features/focus-chain) | Tracks implementation progress against the plan with a visible todo list |
  64. | [Memory Bank](/features/memory-bank) | Preserves project context across sessions so deep planning has richer input |
  65. | [Plan & Act Mode](/core-workflows/plan-and-act) | Use Plan mode for quick exploration, deep planning for thorough architecture |
  66. | [Checkpoints](/core-workflows/checkpoints) | Roll back implementation steps if something goes wrong during execution |
  67. <Tip>
  68. A powerful workflow: run `/deep-planning` to create the plan, enable [Focus Chain](/features/focus-chain) to track progress, then let Cline implement step by step. You get architecture-level thinking with granular progress visibility.
  69. </Tip>
  70. ## Deep Planning vs Plan Mode
  71. Both involve thinking before doing, but they serve different purposes:
  72. | | Plan Mode | Deep Planning |
  73. |---|-----------|---------------|
  74. | **Scope** | Quick exploration and discussion | Thorough codebase investigation |
  75. | **Output** | Conversation context | `implementation_plan.md` file |
  76. | **Best for** | Medium tasks, understanding code | Large tasks, multi-file features |
  77. | **Duration** | Minutes | Longer — depends on codebase size |
  78. | **Persistence** | Lives in conversation history | Saved as a file you can reference later |
  79. For most development work, starting in Plan mode is sufficient. Reserve `/deep-planning` for tasks where you'd normally spend significant time planning on a whiteboard before coding.
  80. ## Tips
  81. - **Be specific in your initial prompt.** "Add authentication" gives a vague plan. "Add OAuth2 authentication with Google and GitHub providers, using our existing user model in `models/user.ts`" gives a focused one.
  82. - **Point Cline at relevant files.** Use `@` mentions to highlight key files in your prompt so the investigation phase starts in the right place.
  83. - **Edit the plan before implementing.** The generated plan is a starting point. Adjust priorities, remove unnecessary steps, or add details before Cline starts coding.
  84. - **Save plans for reference.** The `implementation_plan.md` file is useful documentation even after the feature is built. Consider committing it or moving it to a docs folder.
  85. - **Use for onboarding.** Run `/deep-planning` on a feature you're unfamiliar with to get Cline to map out the codebase and explain how things connect.
  86. ## Related
  87. - [Plan & Act Mode](/core-workflows/plan-and-act) — Cline's dual-mode system for structured development
  88. - [Focus Chain](/features/focus-chain) — Automatic todo list tracking for long-running tasks
  89. - [Memory Bank](/features/memory-bank) — Structured documentation for cross-session context
  90. - [Using Commands](/core-workflows/using-commands) — All available slash commands