# How to Configure no-mistakes to Use a Specific AI Agent

> Learn to configure no-mistakes for specific AI agents like Claude or Copilot. Set the agent key in config yaml or use the --agent CLI flag.

- Repository: [Kun Chen/no-mistakes](https://github.com/kunchenguid/no-mistakes)
- Tags: how-to-guide
- Published: 2026-06-28

---

**Configure no-mistakes to use Claude, Codex, GitHub Copilot, or other AI agents by setting the `agent:` key in `~/.no-mistakes/config.yaml` or [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml), or override temporarily with the `--agent` CLI flag.**

The `kunchenguid/no-mistakes` toolchain determines which AI-driven agent to invoke through hierarchical YAML configuration files. Understanding how to configure no-mistakes to use a specific AI agent allows you to control code generation behavior globally, per-repository, or for individual executions.

## Configuration File Structure

The tool defines configuration schemas in [`internal/config/config.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/config/config.go), where the `GlobalConfig` struct (lines 40-48) handles system-wide defaults and the `RepoConfig` struct (lines 69-73) handles repository-specific overrides. Both use the `Agent` field of type `types.AgentName` to store your selected agent.

### Global Configuration (`~/.no-mistakes/config.yaml`)

Create or edit the global configuration file to set a default agent for all repositories on your machine. This file supports additional tuning options for custom binary paths and arguments.

```yaml

# ~/.no-mistakes/config.yaml

agent: claude
acpx_path: /usr/local/bin/acpx
agent_path_override:
  codex: /opt/codex/bin/codex
agent_args_override:
  pi: ["--model", "gpt-4"]

```

### Repository-Local Override ([`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml))

Place a [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml) file at the root of any repository to override the global agent setting for that specific project. According to the source in [`internal/config/config.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/config/config.go), the repository-local value takes precedence when the tool resolves configuration.

```yaml

# .no-mistakes.yaml

agent: opencode
allow_repo_commands: true

```

## Supported Agent Values

The `AgentName` enum in [`internal/types/types.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/types/types.go) (lines 131-138) defines the supported values for the `agent:` key. These constants map to concrete agent implementations instantiated in [`internal/agent/agent.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/agent/agent.go).

| Value | Description |
|-------|-------------|
| `auto` | Automatically detect the first available native agent on the host (default when omitted). |
| `claude` | Invoke the Anthropic Claude agent (requires Claude CLI installation). |
| `codex` | Invoke the OpenAI Codex agent (requires Codex CLI). |
| `rovodev` | Use the RovoDev agent (`acli`). |
| `opencode` | Use the OpenCode agent. |
| `pi` | Use the Pi agent. |
| `copilot` | Use the GitHub Copilot agent. |
| `acp:<target>` | Use a custom ACP target, such as `acp:gemini`. |

## Runtime CLI Overrides

For one-off agent selection without modifying configuration files, use the `--agent` flag. This flag is parsed in [`internal/cli/daemon_cmd.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/daemon_cmd.go) and overrides both global and repository-local settings for that single execution.

```bash

# Use Copilot for this push only

no-mistakes --agent copilot push

# Use a custom ACP target temporarily

no-mistakes --agent acp:gemini suggest

```

## Advanced Agent Configuration

Beyond selecting the agent name, you can customize how no-mistakes launches the binary.

### Custom Binary Paths

Use `agent_path_override` in the global config to specify non-standard installation locations for specific agents. This is useful when agents are installed outside standard `$PATH` directories.

### Custom Launch Arguments

The `agent_args_override` field injects specific command-line arguments when spawning the agent process. When the configuration above specifies `agent: pi`, the tool appends `--model gpt-4` to the Pi agent invocation.

### ACP Target Setup

When using the `acp:` prefix, you may need to specify the custom binary location via `acpx_path`:

```yaml
agent: acp:gemini
acpx_path: /opt/acp/gemini

```

## Summary

- Set the default agent globally in `~/.no-mistakes/config.yaml` using the `agent:` key and values like `claude`, `codex`, or `auto`
- Override per-repository by creating a [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml) file with an `agent:` entry in the repository root
- Use supported agent identifiers defined in [`internal/types/types.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/types/types.go): `auto`, `claude`, `codex`, `rovodev`, `opencode`, `pi`, `copilot`, or `acp:<target>`
- Temporarily override any configuration using the `--agent` CLI flag parsed in [`internal/cli/daemon_cmd.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/daemon_cmd.go)
- Customize binary paths via `agent_path_override` and command arguments via `agent_args_override` in the global configuration
- Repository-local settings take precedence over global settings, and CLI flags take precedence over both

## Frequently Asked Questions

### What happens if I don't specify an agent in the configuration files?

If the `agent:` key is omitted or left empty in both `~/.no-mistakes/config.yaml` and the repository's [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml), no-mistakes defaults to `auto`. This setting automatically detects the first available native agent installed on your host system according to the logic in [`internal/agent/agent.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/agent/agent.go).

### Can I use different agents for different repositories?

Yes. Set your preferred default agent in the global `~/.no-mistakes/config.yaml`, then create a [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml) file in any repository that requires a different agent. The repository-local configuration overrides the global `GlobalConfig.Agent` value for that specific repository only.

### How do I configure a custom AI agent that isn't in the standard list?

Use the `acp:<target>` syntax in the `agent:` field, such as `acp:gemini` or `acp:custom-llm`. You should also specify the binary path using the `acpx_path` key in your global configuration to ensure no-mistakes can locate and execute your custom ACP agent implementation.

### Does the `--agent` flag permanently change my configuration?

No. The `--agent` flag provides a temporary runtime override for a single execution only. It does not modify `~/.no-mistakes/config.yaml` or [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml). The next invocation of `no-mistakes` will revert to using the agent specified in your configuration files.