# Plan Mode

## **Plan Mode** ([v6.1.0](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/pages/risy3bTOlfBfgFRRXK8K#v6.1.0))

Plan Mode ([v6.1.0](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/pages/risy3bTOlfBfgFRRXK8K#v6.1.0)) in Tabnine CLI is designed for sessions where you want the agent to research and design a solution before it makes any changes. It is especially useful when a request is broad in scope, involves architectural decisions, or requires understanding several parts of the codebase before a safe implementation path can be determined.

When Plan Mode is active, the agent operates in a *read-only* phase first. It inspects the codebase and maps dependencies before producing a structured plan for you to review.

Execution begins *only* after you approve the plan.

### **When to use Plan Mode**

This approach lets you understand what the Agent thinks you want it to do and how it plans to carry it out. This lets you instruct the Agents on specific changes to its plan before it implements it.

So, use Plan Mode when you want Tabnine CLI to think through a problem ***before*** it starts making changes. This is the right choice when you want to check that your instructions for a complex task/set of tasks was actually clear. This can reset the scope if need be, especially if changes would touch multiple parts of the codebase.

This mode is a good fit for the following scenarios:

* Designing a new feature across multiple modules
* Refactoring shared infrastructure with broad dependencies
* Scaffolding a new application before committing to a structure
* Reviewing the agent's strategy before allowing it to act on a large codebase

If your goal is simply to prevent the agent from acting without approval on a per-action basis, approval mode is usually a better fit. Plan Mode is best when you want the entire approach reviewed and confirmed before execution begins.

### **Quickstart**

1. /settings `command`
2. `--approval-mode=plan` argument
3. Shift+Tab or `/plan` in the CLI input box, followed by the goal written in natural language
4. Natural language instruction like “start a plan for…

```shell
tabnine --approval-mode plan -p "refactor the authentication module"
```

In headless or CI contexts, Plan Mode auto-approves the `enter_plan_mode` and `exit_plan_mode` tools and automatically switches to YOLO mode for execution.

**Configure in settings.json**

```json
{
  "tools": {
    "approvalMode": "plan"
  }
}
```

### **Tool Restrictions**

Plan Mode enforces strict safety policies to prevent accidental changes. During the planning phase, only the following tools are available:

* File inspection: `read_file`, `list_directory`, `glob`
* Search: `grep_search`
* Research sub-agents: `codebase_investigator`
* Interaction: `ask_user`
* MCP tools (read-only): Read-only MCP tools are allowed but require explicit confirmation
* Planning (write): `write_file` and replace are allowed only for `.md` files in the plans directory

All other tools, including shell execution and file modification — are blocked *until* you approve the plan and execution begins.

### **The Planning Workflow**

When Plan Mode is active, the agent follows a structured sequence before taking any action. Plans are written in a markdown file to review.

1. **Research:** – The agent reads files, searches the codebase, and maps relevant dependencies.
2. **Design:** – It produces a written plan describing what it intends to change and why.
3. **Review:** – The plan is presented to you. You can approve it, ask for revisions, or cancel.
   * **Collaborative Editing:** Press Ctrl+X to open the plan file directly in your configured external editor for collaborative editing — you can reorder or rewrite steps, or leave inline comments. Save and close; the agent will revise the plan based on detected changes and your feedback.
4. **Execution:** – Only after approval does the agent begin making changes, following the approved plan.

### **Different Approval Workflows to Plan Mode**

**Default Mode** (prompt for all actions)

```shell
tabnine --approval-mode default
```

**Auto-Edit Mode** (auto-approve edits, prompt for commands)

```shell
tabnine --approval-mode auto_edit
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tabnine.com/main/getting-started/tabnine-cli/features/plan-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
