[
    {
        "role": "user",
        "content": "we%20specify%20model%20when%20running%20claude%20code%20with%20claude%20--model%20%3Cmodel-name%3E.%20but%20when%20we%20access%20claude%20code%20via%20a%20acp%20like%20claude-code-acp%20which%20presumably%20runs%20claude%20code%20itself%2C%20how%20do%20we%20specify%20model%3F"
    },
    {
        "role": "assistant",
        "content": "If you're using **Claude Code via an ACP-compatible client** (like Zed, a code editor, or some external agent panel), you *can* still specify which Claude model to use. The methods are nearly the same as when you're running `claude` directly via CLI, with a few extra considerations. Here\u2019s a breakdown of *how* to change the model, *when* those methods work, and some tips specific to ACP contexts.\n\n---\n\n## \u2705 Ways to Specify the Model\n\nAnthropic supports multiple methods for selecting which Claude model is used by Claude Code. These are generally available whether you're using it directly or via ACP. ([support.anthropic.com](https://support.anthropic.com/en/articles/11940350-claude-code-model-configuration?utm_source=openai))\n\n| Method | How to use | Scope | Notes / Caveats |\n|---|---|---|---|\n| **Command-line flag** | `claude --model <alias|model-name>` ([support.anthropic.com](https://support.anthropic.com/en/articles/11940350-claude-code-model-configuration?utm_source=openai)) | One particular session (when launching from terminal) | In ACP, this applies if the agent/server that runs Claude Code is itself launched with such flags. Often config/manifest overrides needed. |\n| **Interactive command (mid-session)** | Inside Claude Code use `/model <alias|name>` ([support.anthropic.com](https://support.anthropic.com/en/articles/11940350-claude-code-model-configuration?utm_source=openai)) | Current running session | Some ACP interfaces might not support text commands. It depends on how the agent is exposed. |\n| **Environment variables** | Set `ANTHROPIC_MODEL=<alias|full name>` or model-specific vars like `ANTHROPIC_DEFAULT_OPUS_MODEL`, etc. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/model-config?utm_source=openai)) | Default for all future sessions | Must be visible in the runtime environment of the Claude Code process (i.e. same process that ACP agent/server uses). |\n| **Settings / config files** | Edit `~/.claude/settings.json` or a project CLAUDE-agent manifest with `\"model\": \"<alias|name>\"` ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/model-config?utm_source=openai)) | Sets default behavior for the agent process | In ACP, this might be managed centrally, or overridden per-agent. |\n\n---\n\n## \u26a0\ufe0f What\u2019s Different with ACP\n\nACP (Agent Client Protocol) clients are front-ends that call a Claude Code agent process somewhere (locally, in an editor, or remote). That separation introduces some nuance:\n\n- **Who runs Claude Code**: If the ACP client just connects to a process you're hosting, then your environment variables, config file, or startup flags are still in effect. If the ACP process is remote or managed through the editor, then the editor\u2019s process setup controls what you can change.\n- **Ability to issue commands**: Some ACP panels might not allow using `/model` or `/status` commands, or those commands may be blocked. It depends on how much the front-end exposes. Zed\u2019s \u201cagent panel\u201d supports launching a Claude Code thread and asking for configuration, but model switching may not be fully surfaced everywhere. ([zed.dev](https://zed.dev/acp/agent/claude-code?utm_source=openai))\n- **Subagents**: There is support for specifying models for subagents (i.e., tasks/components run impersonally or separately) so they don't all have to run the \u201cmain\u201d model. This again depends on version and setup. ([reddit.com](https://www.reddit.com/r/ClaudeCode/comments/1mdtsrw?utm_source=openai))\n\n---\n\n## \ud83d\udee0 How to Set the Model via ACP\n\nHere are actionable steps you can try, depending on whether you control the Claude Code agent or just the client:\n\n1. **Check if `/model` works**  \n   In the Claude Code thread started via the ACP agent, try typing `/model`. If that command is processed, you\u2019ll get an interactive menu to pick from available models. ([support.anthropic.com](https://support.anthropic.com/en/articles/11940350-claude-code-model-configuration?utm_source=openai))\n\n2. **Startup flags**  \n   If you start the agent yourself (in your terminal or via an editor-plugin that you control), you can include the `--model` flag. E.g. `claude --model claude-opus-4-1-20250805`. ([support.anthropic.com](https://support.anthropic.com/en/articles/11940350-claude-code-model-configuration?utm_source=openai))\n\n3. **Environment variable**  \n   Export `ANTHROPIC_MODEL` (or the model-tier specific variables) to your shell or agent\u2019s runtime environment. Example:\n   ```\n   export ANTHROPIC_MODEL=\"claude-sonnet-4-20250514\"\n   ```\n   Or set in settings file if your ACP agent supports passing env vars. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/model-config?utm_source=openai))\n\n4. **Config/settings file or manifest**  \n   If there is a `settings.json`, `.claude/settings.json`, agent manifest, or project config, set the `model` field there. Sometimes ACP servers accept this. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/model-config?utm_source=openai))\n\n5. **Model-alias usage**  \n   Use aliases like `sonnet`, `opus`, `haiku`, or `opusplan` if you don\u2019t want to specify full model names. These map to full names depending on your subscription/plan. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/model-config?utm_source=openai))\n\n---\n\nIf you tell me *which ACP client* you're using (Zed, VSCode, custom, etc.), I can give you the exact commands or configuration location for that setup. Do you want me to walk you through that for your specific setup?"
    }
]