---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/fast-edits.md
  - https://sourcecraft.dev/portal/docs/ru/code-assistant/operations/agent/fast-edits.md
title: Quick editing (diffs) in SourceCraft Code Assistant
description: How to use quick editing via diffs in SourceCraft Code Assistant to make targeted changes in files.
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt


# Quick editing (diffs) in SourceCraft Code Assistant

<!-- source: en/_includes/code-assistant/only-in-vscode.md -->
{% note warning %}

This feature is only available in Visual Studio Code.

{% endnote %}
<!-- endsource: en/_includes/code-assistant/only-in-vscode.md -->

In Code Assistant, instead of overwriting entire files, you can use _quick editing_ based on using the differences (diffs) between the original and output files.

Quick editing (**Enable editing through diffs**) is on by default. Typically, there is no need to modify this parameter unless you are facing specific problems or want to experiment with various diff strategies.

{% note info %}

The quick editing through diffs parameter is set separately for each [model configuration profile](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/api-configuration-profiles.md).

{% endnote %}

## Enabling quick editing {#enable-editing-through-diffs}

1. In the chat's top panel, click <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M7.199 2H8.8a.2.2 0 0 1 .2.2c0 1.808 1.958 2.939 3.524 2.034a.2.2 0 0 1 .271.073l.802 1.388a.2.2 0 0 1-.073.272c-1.566.904-1.566 3.164 0 4.069a.2.2 0 0 1 .073.271l-.802 1.388a.2.2 0 0 1-.271.073C10.958 10.863 9 11.993 9 13.8a.2.2 0 0 1-.199.2H7.2a.2.2 0 0 1-.2-.2c0-1.808-1.958-2.938-3.524-2.034a.2.2 0 0 1-.272-.073l-.8-1.388a.2.2 0 0 1 .072-.271c1.566-.905 1.566-3.165 0-4.07a.2.2 0 0 1-.073-.27l.801-1.389a.2.2 0 0 1 .272-.072C5.042 5.138 7 4.007 7 2.199c0-.11.089-.199.199-.199M5.5 2.2c0-.94.76-1.7 1.699-1.7H8.8c.94 0 1.7.76 1.7 1.7a.85.85 0 0 0 1.274.735 1.7 1.7 0 0 1 2.32.622l.802 1.388c.469.813.19 1.851-.622 2.32a.85.85 0 0 0 0 1.472 1.7 1.7 0 0 1 .622 2.32l-.802 1.388a1.7 1.7 0 0 1-2.32.622.85.85 0 0 0-1.274.735c0 .939-.76 1.7-1.699 1.7H7.2a1.7 1.7 0 0 1-1.699-1.7.85.85 0 0 0-1.274-.735 1.7 1.7 0 0 1-2.32-.622l-.802-1.388a1.7 1.7 0 0 1 .622-2.32.85.85 0 0 0 0-1.471 1.7 1.7 0 0 1-.622-2.32l.801-1.389a1.7 1.7 0 0 1 2.32-.622A.85.85 0 0 0 5.5 2.2m4 5.8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0" clip-rule="evenodd"/></svg> **Settings**.
1. In the **Profile** selector, choose the specific [model configuration profile](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/api-configuration-profiles.md) for which quick editing will be enabled.
1. Select **Enable editing through diffs**.
1. Optionally, matching precision under **Match precision**. This option controls how accurately the code sections identified by the AI must match the original code in you file before the changes are applied. The possible values are:
    * `100%` (default), requires exact match. This is the most secure option that minimizes the risk of incorrect edits.
    * `80%-99%`, allows incomplete match. Code Assistant can apply changes even if the code section is slightly different from what the AI expects. This can be of use if the file was slightly modified; however, it increases the risk of applying the changes in the wrong place.

    {% note warning %}

    Use values below 100% with extreme caution.

    Lower accuracy may be necessary in some cases, but be sure to carefully review all the proposed changes.

    Internally, this setting controls the `fuzzyMatchThreshold` parameter used with algorithms like the [Levenshtein distance](https://ru.wikipedia.org/wiki/Расстояние_Левенштейна) to analyze code for similarity.

    {% endnote %}

To disable quick editing, follow the same procedure. Code Assistant will then revert to overwriting the entire file content for each edit with the help of the `write_to_file` tool instead of applying the target changes using `apply_diff`. This full-overwrite approach is typically slower when editing existing files and uses up more tokens.