---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/src-chat.md
  - https://vibe.sourcecraft.dev/portal/docs/ru/code-assistant/operations/src-chat.md
  - href: https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/operations/src-chat.md
    type: text/markdown
    title: Markdown version
  - href: https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/llms.txt
    rel: describedby
title: Chat with Code Assistant in SourceCraft
description: How to use the SourceCraft Code Assistant chat in the SourceCraft interface for communicating with the AI assistant and solving tasks.
---
> **Documentation Index:** Fetch the complete configuration index at https://vibe.sourcecraft.dev/portal/docs/en/llms.txt


<!-- source: en/sourcecraft/operations/ca-chat.md -->
# Chat with Code Assistant in SourceCraft

<!-- source: en/_includes/sourcecraft/ai-chat-description.md -->
The SourceCraft interface has a built-in chat with Code Assistant you can use to interact with the AI assistant.

The following scenarios are supported:
* SourceCraft user help, FAQ.
* Searching through the documentation.
* Generating code snippets.
* Explaining code in project files or individual file sections, including code in [markdown](https://en.wikipedia.org/wiki/Markdown) syntax intended for documentation.
* Help with debugging and troubleshooting.
* Generating tests for your code.
* Generating documentation.
* Scanning code for potential issues.
* Suggesting improvements and alternative solutions.
* Generating charts.
* Writing commit messages.

The page in the SourceCraft interface you view defines the context for Code Assistant, e.g., [repository](https://vibe.sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#repos) files, current open file, [pull request](https://vibe.sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#pr) or [issue](https://vibe.sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#issues) content, etc.
<!-- endsource: en/_includes/sourcecraft/ai-chat-description.md -->

## Opening a chat {#open}

1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. If you need Code Assistant to have a specific context without explicitly stating it in a chat message, navigate to the relevant page, such as opening a repository, a specific file, or a task.
1. In the panel on the left, click ![image](../../_assets/code-assistant/chat-logo-src.svg) **Code Assistant Chat**.

## Sending a message {#send}

Write your request to the AI assistant in the message input field and click ![image](../../_assets/console-icons/arrow-up.svg) or press **Enter**.

For a line break in the message, press **Shift** + **Enter**.

{% note info %}

Additional context provided in Code Assistant, such as a pull request or task, is displayed in the message input field.

{% endnote %}

## Stopping response generation {#stop-generation-vs}

If you changed your mind and want to rephrase your question, click ![image](../../_assets/console-icons/circle-stop.svg) **Stop** in the message input window.

## Opening a new chat {#new-chat}

Click ![image](../../_assets/console-icons/plus.svg) in the chat's top panel.

## Viewing the list of chats {#list-chat}

1. Click ![image](../../_assets/console-icons/clock-arrow-rotate-left.svg) in the chat's top panel.
1. From the list that opens, select the chat you want to go back to.

To delete a chat from the list, click the ![image](../../_assets/console-icons/trash-bin.svg) button next to it.

## Code blocks {#codeblocks}

Code Assistant answers may contain code examples. Above the code block, you will see the programming language it was written in.

### Copying code from a chat {#copy-code}

In the right-hand corner of the panel above the code block, click ![image](../../_assets/console-icons/copy.svg).

### Expanding and collapsing a code block {#open-code}

To make it easier to navigate the chat, the system automatically collapses large blocks of code. To expand or collapse a code block, click ![image](../../_assets/console-icons/chevrons-down-wide.svg) or ![image](../../_assets/console-icons/chevrons-up-wide.svg) under it.

## Closing a chat {#close}

Click ![image](../../_assets/console-icons/xmark.svg) in the chat's top panel.

{% note tip %}

Chat history is saved. You can return to a specific chat later.

{% endnote %}

#### Useful links {#see-also}

* [Using AI skills in SourceCraft](https://vibe.sourcecraft.dev/portal/docs/en/sourcecraft/operations/ai-skills.md)
* [Getting started with SourceCraft Code Assistant](https://vibe.sourcecraft.dev/portal/docs/en/code-assistant/index.md)
* [AI in SourceCraft](https://vibe.sourcecraft.dev/portal/docs/en/sourcecraft/concepts/code-assistant.md)
* [Editing code in SourceCraft Code Assistant](https://vibe.sourcecraft.dev/portal/docs/en/sourcecraft/operations/code-edit.md)
* [AI code review of a pull request in SourceCraft](https://vibe.sourcecraft.dev/portal/docs/en/sourcecraft/operations/ca-review.md)
<!-- endsource: en/sourcecraft/operations/ca-chat.md -->