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

# Generate a commit

> Use CC GUI to write a commit message from the current Git changes and fill it back into Source Control.

CC GUI can read the current workspace Git diff, generate a commit message, and write it into the VS Code Source Control input when possible.

<img src="https://mintcdn.com/mossx-docs/kz4nt5KFSKzkAZwe/images/vscode/scm-commit.png?fit=max&auto=format&n=kz4nt5KFSKzkAZwe&q=85&s=52604819da6499b51e349e10771beaba" alt="Generate button in Source Control" width="100%" data-path="images/vscode/scm-commit.png" />

## Check these first

1. The workspace is a Git repo and has uncommitted changes
2. **Settings → General → Behavior → AI-generated commit messages** is on
3. **Settings → Commit AI** already has a working provider and model

If you turn the master switch off, the command says the feature is disabled.

## Generate one commit message

<Steps>
  <Step title="Open Source Control">
    Confirm the change list has files. With no diff, the command reports `No changes found`.
  </Step>

  <Step title="Click the generate button">
    Click the CC GUI generate button in the Source Control title bar, or run **CC GUI: Generate Commit Message with Claude** from the Command Palette.
  </Step>

  <Step title="Wait for it to write back">
    VS Code shows progress. While it generates, some text may stream into the commit input first.
  </Step>
</Steps>

On success, the input contains a cleaned-up commit message. If it cannot write into the SCM input, the text falls back to the CC GUI input box so you can copy it.

On failure, the extension drops the full prompt into the chat and explains why.

## Configure Commit AI

Open **Settings → Commit AI**:

* Choose a provider and model (Claude Code or Codex)
* Edit the global prompt
* Override the prompt per workspace
* Turn on the related code-review option if you need it

In the prompt you can lock the language, require a title format, or require a body.

<Note>
  Commit AI sends the diff to the selected model. Very large diffs are truncated. For a sensitive repo, review the prompt and provider first.
</Note>

## Common issues

| Symptom               | Cause                                                                                        |
| --------------------- | -------------------------------------------------------------------------------------------- |
| No workspace          | Open a folder first                                                                          |
| No changes            | Stage something, or at least leave an uncommitted diff                                       |
| No available provider | Configure [Claude](/en/vscode/providers/claude) or [Codex](/en/vscode/providers/codex) first |
| Button is missing     | Confirm the current SCM provider is Git, and the master switch is on                         |
