> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/cline/cline/llms.txt
> Use this file to discover all available pages before exploring further.

# Deep Planning

> Trigger an extended investigation and planning phase before Cline writes any code.

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.

<Tip>
  Use `/deep-planning` for features that touch multiple files, architectural changes, complex integrations, or any task where "just start coding" would lead to rework.
</Tip>

## How it works

Deep Planning follows a four-step process:

<Steps>
  <Step title="Silent investigation">
    Cline explores your codebase without asking you anything first. It reads relevant files, traces dependencies, examines patterns, and builds a mental model of your project structure. You'll see Cline reading files and running searches during this phase.

    This step is intentionally silent — Cline gathers context first so it can ask better, more informed questions next.
  </Step>

  <Step title="Discussion">
    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.

    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?"

    Answer these questions to shape the plan. The more specific you are, the better the output.
  </Step>

  <Step title="Plan creation">
    Cline generates a comprehensive `implementation_plan.md` file in your project. A typical plan includes:

    * **Overview** of the feature and its scope
    * **File-by-file changes** with specific descriptions of what to add, modify, or remove
    * **Dependencies** between changes (what needs to happen first)
    * **Edge cases** and error handling considerations
    * **Testing strategy** for the implementation

    The plan is saved as a markdown file you can review, edit, and share with your team before any code is written.
  </Step>

  <Step title="Task creation">
    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.
  </Step>
</Steps>

## Using Deep Planning

### Invoking it

Type `/deep-planning` in the Cline chat input followed by a description of what you want to build:

```text theme={null}
/deep-planning Add a notification system that sends email and in-app notifications
when users receive comments on their posts
```

The more context you provide upfront, the more focused the investigation phase will be. Include:

* What you want to build
* Any constraints or preferences
* Which parts of the codebase are relevant (if you know)
* Relevant files using `@` mentions

### Reviewing the plan

Once Cline generates `implementation_plan.md`, review it carefully before proceeding:

1. **Check the scope** — Does it cover everything you need? Is anything missing?
2. **Verify the approach** — Does the technical approach match your preferences?
3. **Review the order** — Are dependencies handled correctly?
4. **Edit if needed** — It's a plain markdown file. Change anything that doesn't look right.

Tell Cline about any adjustments before it starts implementing.

## Model-specific optimization

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.

This means deep planning works effectively regardless of your model choice, though stronger reasoning models will generally produce more thorough plans.

<Tip>
  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) for details.
</Tip>

## Deep Planning vs. Plan mode

Both involve thinking before doing, but they serve different purposes:

|                 | Plan mode                        | Deep Planning                           |
| --------------- | -------------------------------- | --------------------------------------- |
| **Scope**       | Quick exploration and discussion | Thorough codebase investigation         |
| **Output**      | Conversation context             | `implementation_plan.md` file           |
| **Best for**    | Medium tasks, understanding code | Large tasks, multi-file features        |
| **Duration**    | Minutes                          | Longer — depends on codebase size       |
| **Persistence** | Lives in conversation history    | Saved as a file you can reference later |

For most development work, starting in Plan mode is sufficient. Reserve `/deep-planning` for tasks where you'd normally spend significant time on a whiteboard before coding.

## Pairing with other features

| Feature                                         | How it helps                                                                             |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------- |
| [Memory Bank](/features/memory-bank)            | Preserves project context across sessions so deep planning has richer input to work with |
| [Plan & Act mode](/core-workflows/plan-and-act) | Use Plan mode for quick exploration, deep planning for thorough architecture work        |
| [Checkpoints](/core-workflows/checkpoints)      | Roll back implementation steps if something goes wrong during execution                  |
| [Subagents](/features/subagents)                | Use subagents alongside deep planning to explore large codebases faster                  |

## Tips

* **Be specific in your initial prompt.** "Add authentication" produces a vague plan. "Add OAuth2 authentication with Google and GitHub providers, using our existing user model in `models/user.ts`" produces a focused one.
* **Point Cline at relevant files.** Use `@` mentions in your prompt to highlight key files so the investigation phase starts in the right place.
* **Edit the plan before implementing.** The generated plan is a starting point. Adjust priorities, remove unnecessary steps, or add details before Cline starts coding.
* **Save plans for reference.** `implementation_plan.md` is useful documentation even after the feature is built. Consider committing it or moving it to a docs folder.
* **Use for onboarding.** Run `/deep-planning` on a feature you're unfamiliar with to have Cline map out how things connect and why.

## Related

* [Plan & Act mode](/core-workflows/plan-and-act) — Cline's dual-mode system for structured development
* [Memory Bank](/features/memory-bank) — Structured project documentation for cross-session context
* [Using commands](/core-workflows/using-commands) — All available slash commands
* [Subagents](/features/subagents) — Parallel codebase research to inform planning
