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

# Ask AI during a review

> Ask a configured local AI provider about selected diff lines while keeping its answers separate from submitted review feedback.

Select lines in a code diff and choose **Ask AI** to ask a question about that code. The answer streams into the AI sidebar and stays attached to the file in the chat history.

You can also ask a general question from the AI tab. Plannotator includes the current comparison in the request, such as uncommitted changes, a branch comparison, a Jujutsu revision, a GitButler stack, or a pull-request checkout. When you switch the comparison, the next question receives the new review context.

Ask AI is an explanation tool. Its conversation is separate from your annotations and final review. Copy a useful conclusion into a normal annotation if you want it included when you send feedback.

## Ask this session

When Plannotator is opened from Claude Code 2.1.287 or later (with the Plannotator mod), Pi, or OpenCode 2, Ask AI is answered by the agent session that opened it. This is the only Ask AI option there. There is no provider or model picker, and the provider settings below do not apply. Your question shows in the agent's chat, and the agent already knows the conversation. See [Ask this session](/open-source/workflows/ask-this-session).

## Configure a provider

You pick a provider when Ask this session is not available: Claude Code without the mod, OpenCode 1, Codex and the other agents, remote mode, `--tailscale`, or a `plannotator` command you run yourself.

Plannotator detects supported AI providers from their local command-line tools. Install and authenticate or configure at least one provider before opening the review.

| Provider | Local requirement | Permission behavior |
| - | - | - |
| Claude | Install and authenticate the `claude` CLI. | Plannotator starts with read and search tools plus a limited set of inspection commands. Other tool use can require approval. |
| Codex | Install and authenticate the `codex` CLI. | Plannotator pins the Ask AI session to Codex's read-only sandbox. Your configured approval policy still applies. |
| OpenCode | Install and authenticate the `opencode` CLI. | OpenCode handles tool permissions and can show approval requests in the chat. |
| Pi | Install and configure the `pi` CLI and its model providers. | Pi controls tool execution through its own local runtime. Plannotator does not expose a Pi permission gate. |

Plannotator does not create accounts or manage provider API keys. If a provider is detected but cannot answer, verify its authentication and model configuration by running its CLI directly.

Open **Settings > AI** to choose a provider and model. The choice persists across sessions.

For the first session, Plannotator prefers the matching provider when it is available:

| Calling agent | Preferred provider |
| - | - |
| Claude Code | Claude |
| Codex | Codex |
| OpenCode | OpenCode |
| Pi | Pi |

Other agents use the saved provider or the available server default.

Changing the provider or model starts a new AI session. Earlier messages remain visible, but they are not part of the new provider conversation.

## Disable AI features

Set `PLANNOTATOR_AI=disabled` before starting Plannotator to remove Ask AI, Review Agents, and Guided Review from the UI and disable their provider and job endpoints:

```bash theme={null}
PLANNOTATOR_AI=disabled plannotator review
```

Ordinary plan, document, and code review still work. External agents can still open reviews and submit annotations. Saved Guided Review files are retained, but their in-app history browser is hidden while AI is disabled. The annotate-mode agent terminal is separate and keeps its own settings.

## Ask a focused question

1. Select the smallest useful line range in the diff.
2. Choose **Ask AI** in the annotation toolbar.
3. Ask a concrete question about behavior, risk, or intent.
4. Verify the answer against the patch and repository before turning it into review feedback.

For example:

```text theme={null}
Can this error path leave the transaction open? Point to the relevant cleanup code.
```

The selected lines are included even when the overall diff must be shortened to fit the provider's context window.

## Pull requests need a local checkout

Ask AI can read local-change reviews immediately. For a GitHub pull request or GitLab merge request, it needs the temporary local checkout that Plannotator prepares by default. If preparation is still running, retry after it finishes.

Ask AI is unavailable for a pull-request review started with `--no-local`, because that mode intentionally retains only the provider diff. See [Review pull requests and merge requests](/open-source/workflows/pull-requests) for the checkout boundary.

Last verified against Plannotator OSS v0.25.0 on July 27, 2026. Maintained by the Plannotator project.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.