> For the complete documentation index, see [llms.txt](https://docs.nimbalyst.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nimbalyst.com/visual-editors-powered-by-ai/markdown-wysiwyg/ai-editing-red-green-diff-approval.md).

# AI Editing, Red/Green Diff, Approval

<figure><img src="/files/szVDnFas4avzmTZn68KC" alt=""><figcaption></figcaption></figure>

### AI-Powered Editing

#### Agent Panel

Runs on the right rail in your document/file view

<div align="left"><figure><img src="/files/8DYTzPmJIAXKqo2HHo6K" alt="" width="375"><figcaption></figcaption></figure></div>

* Open the AI panel by clicking the AI icon or Cmd+Shift+A toggles panel
* Select an AI provider from the dropdown and type your message
* Click on New message to change context. This starts a new Session.
* Paste attachments or images into the chat

#### **Chat**

* You can Chat in the Agent panel without editing your document
* Use this to research, explore, learn

#### **Requesting Edits**

* You can ask AI to modify your document
* "Add a section about X"
* "Rewrite this paragraph"

#### **Streaming Edits:**

* Changes appear as they are ready
* Visual diff shows additions/deletions
* Toolbar appears for review

#### Plan Mode and Agent Mode

* Plan mode limits the Agent to editing markdown and create markdown files
* Agent mode gives the full power of the agent
* Click on the Plan or Agent icon to toggle modes<br>

### Red/Green Diff

<figure><img src="/files/dhSCGciKmXP76O3xMuir" alt=""><figcaption></figcaption></figure>

* Shows changes made by the AI to the document
* Enables Keep/Undo of all changes or one by one
* Clicking on change or arrow selects that change and takes you to it

### Agent Context & Conversations

#### **The Agent is passed and understands the following context:**

* Document context: Current file content
* Workspace context: File tree, related files
* Session context: Conversation history

#### When conversing with the Agent

* AI automatically includes the open document
* You can reference other files by name by typing @
* You can include images and code snippets in messages

#### **Best Practices:**

* Be specific about context needs
* "Looking at the function in file.ts..."
* Include relevant code/text in message

#### Context Window

The 18k/200K Tokens indicats how many words/tokens can fit in this chat session. When you get close to 100%, make sure to hit +New and create a new session.

<div align="left"><figure><img src="/files/GOvagULZIZjdSwsU7wLH" alt=""><figcaption></figcaption></figure></div>

### AI Tool Calls

AI can invoke tools to perform actions beyond text generation.

#### **Available Tools:**

* File operations (read, write, search)
* Code analysis and execution
* Web search and research
* Data processing

\
Tool results shown in chat with special formatting.

#### Show Tool Calls in Chat

By default, every tool call the agent makes appears as a row in the transcript. To hide them entirely (not just collapse them), turn off **Show Tool Calls in Chat** under **Settings → Agent Features**. Interactive prompts — permission requests, plan-mode exits, commit proposals, AskUserQuestion, PromptForUserInput — still appear so you can always respond.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.nimbalyst.com/visual-editors-powered-by-ai/markdown-wysiwyg/ai-editing-red-green-diff-approval.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
