Skip to content

How to Use Side Chat in Trae

Side chat (the Chat mode) works as an all-in-one AI partner during your coding process. It can answer coding questions, explain code repositories, generate code snippets, fix errors, and more as you ask.

Enable the Chat Mode

  1. Open the side chat box using shortcut command + U
  2. At the top left of the chat box, click Chat to open Chat mode

Explore the Chat Mode

Add Contexts

The AI assistant can understand the context of the current project, including code, files, and folders, allowing it to assist you more accurately in fulfilling your development needs. For more information, refer to "Context".

Input Multimodal Content

You can add images in the chat, such as error screenshots, design drafts, reference styles, and more, to express your needs more accurately and efficiently. For more information, refer to "Multimodal input".

Generate and Handle Code Changes

Based on your needs, the AI assistant will automatically create new files or edit existing ones and save the generated code. You can accept or reject code changes:

  • Handle all code changes in multiple files: Click the Accept All or Reject All buttons in the file list above the input box to bulk accept or reject all code changes in the current project.

  • Handle all code changes in a file: In the editor, open the file and click the Accept (shortcut: Command + Enter) or Reject (shortcut: Command + Backspace) button in the top prompt bar to bulk accept or reject all code changes within the current file.

  • Handle a single code change: Click the ^Y or ^N button in the upper right corner of a specific code change in the editor to accept or reject that particular change.

Additionally, for code snippets generated in chats, you can:

  1. Click the Copy button to copy all the code in the code snippet
  2. In the file currently open in the editor, click any area, then click the Insert at Cursor button to add the code to the cursor location
  3. Click the Add to New File button to create a new file with the code snippet
  4. For a code change, click the Apply button to apply it to the corresponding file (Note: Code irrelevant to the current project cannot be applied)

Generate and Run Commands

In the Chat mode, the AI assistant will provide executable Shell commands that you can run with a single click. You can:

  1. Click the Copy button to copy the command
  2. Click the Add to Terminal button to add the command to an available terminal
  3. Click the Run button to run the command in an available terminal

Revert to Previous Versions

In the Chat mode, you can revert the project to a version before a certain round of chat:

  • Reversions cannot be undone
  • Only supports reverting a project in the latest Chat window
  • Only supports reverting a project to a version within the latest 10 rounds of chat

To revert:

  1. Find the target chat bubble
  2. Click the Revert button on the left
  3. Review the impacted files in the dialog box
  4. Click a file name to preview changes in the editor
  5. Click Confirm to proceed with the reversion

Manage Historical Chats

Click the Show History button in the top right of the Chat window to view the History panel, which displays all historical chats from both Chat and Builder modes.

  • Click any entry to view that specific chat
  • Hover over an entry and click Delete to remove it (deleted chats cannot be restored)

Learn More: Builder Mode

While the Chat mode operates in a simple question-and-answer flow, the Builder mode enables the AI assistant to utilize various tools for analyzing code, editing files, running commands, and more - making responses more precise and effective. For more information, refer to "Builder".