All Products
Search
Document Center

Alibaba Cloud Model Studio:Claude Code

Last Updated:Mar 05, 2026

Coding Plan supports Anthropic API-compatible endpoints. Set up and use the models with Claude Code.

Install and use

Install Claude Code

macOS and Linux

  1. Install or update Node.js (v18.0 or later).

  2. In your terminal, install Claude Code:

    npm install -g @anthropic-ai/claude-code
  3. Verify the installation. If a version number appears, the installation succeeded:

    claude --version

Windows

To use Claude Code on Windows, install WSL or Git for Windows. Then run the following command in WSL or Git Bash:

npm install -g @anthropic-ai/claude-code
For details, see the Windows setup guide in the official Claude Code documentation.

Set up Coding Plan

To connect Claude Code to Coding Plan, configure these settings:

  1. ANTHROPIC_BASE_URL: Set to https://coding-intl.dashscope.aliyuncs.com/apps/anthropic.

  2. ANTHROPIC_AUTH_TOKEN: Set to your Coding Plan API key.

  3. ANTHROPIC_MODEL: Set to a model supported by Coding Plan.

macOS and Linux

  1. Create and open the config file ~/.claude/settings.json.

    ~ refers to your home directory. If the .claude folder does not exist, create it first. Run mkdir -p ~/.claude in your terminal.
    nano ~/.claude/settings.json
  2. Edit the config file. Replace YOUR_API_KEY with your Coding Plan API key.

    {
        "env": {
            "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
            "ANTHROPIC_BASE_URL": "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",
            "ANTHROPIC_MODEL": "qwen3.5-plus"
        }
    }

    Save the config file. Open a new terminal window to apply the settings.

  3. Edit or create the ~/.claude.json file. Set the hasCompletedOnboarding field to true, then save the file.

    {
      "hasCompletedOnboarding": true
    }
    hasCompletedOnboarding is a top-level field. Do not nest it within other fields.

    This step prevents the error Unable to connect to Anthropic services when you start Claude Code.

Windows

  1. Create and open the config file C:\Users\YourUsername\.claude\settings.json.

    CMD

    1. Create the folder:

      if not exist "%USERPROFILE%\.claude" mkdir "%USERPROFILE%\.claude"
    2. Create and open the file:

      notepad "%USERPROFILE%\.claude\settings.json"

    PowerShell

    1. Create the folder:

      mkdir -Force $HOME\.claude
    2. Create and open the file:

      notepad $HOME\.claude\settings.json
  2. Edit the config file. Replace YOUR_API_KEY with your Coding Plan API key.

    {
        "env": {
            "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
            "ANTHROPIC_BASE_URL": "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",
            "ANTHROPIC_MODEL": "qwen3.5-plus"
        }
    }

    Save the config file. Open a new terminal window to apply the settings.

  3. Edit or create the C:\Users\YourUsername\.claude.json file. Set the hasCompletedOnboarding field to true, then save the file.

    {
      "hasCompletedOnboarding": true
    }

Get started

  1. Open your terminal and navigate to your project directory. Then, start Claude Code:

    cd path/to/your_project
    claude
  2. After startup, grant Claude Code authorization to execute files.

    image

  3. Enter /status to confirm that the model, Base URL, and API key are configured correctly.

    image

  4. Start a conversation in Claude Code.

    image

Switch models

  1. At startup: Run claude --model <model_name> to launch Claude Code with a specific model. For example: claude --model qwen3-coder-next.

  2. During a session: Enter /model <model_name> in the chat window to switch models. For example: /model qwen3-coder-next.

Common commands

Command

Description

Example

/init

Generate a CLAUDE.md file in your project root directory to define project-level instructions and context.

/init

/status

View the current model, API key, Base URL, and other configuration details.

/status

/model <model-name>

Switch models.

/model qwen3-coder-next

/clear

Clear the conversation history and start a new conversation.

/clear

/plan

Enter plan mode to analyze and discuss solutions without modifying code.

/plan

/compact

Compress the conversation history to free up space in the context window.

/compact

/config

Open the configuration menu to set language, theme, and other options.

/config

For more commands and usage details, see the official Claude Code documentation.

Extend capabilities

Claude Code supports MCP and skills to extend its capabilities. For example, use web search to get real-time information or use an image understanding skill to analyze images. For details, see Best practices.

Use Claude Code IDE extension

The Claude Code IDE extension works with VS Code, VS Code–based IDEs (such as Cursor and Trae), and JetBrains IDEs (such as IntelliJ IDEA and PyCharm).

VS Code

  1. First set up Coding Plan with Claude Code. On Windows, install WSL or Git for Windows.

  2. Open VS Code. In the marketplace, search for Claude Code for VS Code and install it.

    image

  3. After installation, restart VS Code. Click the icon in the top-right corner to open and use Claude Code.

    截屏2026-02-06 17

    If the Anthropic login interface appears, set up Coding Plan in Claude Code first.

    image

  4. Switch models: In the chat window, type /, select General config to open the settings page, choose a supported model in Selected Model, and start a conversation in a new window.

    截屏2026-02-06 17

JetBrains

  1. Install Claude Code and set up Coding Plan.

  2. Open a JetBrains IDE (such as IntelliJ IDEA or PyCharm). In the marketplace, search for Claude Code and install it.

    2026-02-25_16-27-56

  3. After installation, restart the IDE. Click the icon in the upper-right corner to use it. Enter /model <model_name> in the chat window to switch models.

    2026-02-25_16-40-33

    Not logged in. Please run /login means the configuration is incomplete. Set up Coding Plan in Claude Code first.

    image

Error codes

See Common errors and solutions.

FAQ

See FAQ.

Best practices

1. Manage context
  • Clear regularly: Use /clear to periodically reset conversations. This prevents stale context from interfering with new tasks and saves tokens.

  • Compress proactively: Use /compact to have Claude summarize key decisions and modified files, retaining only essential context.

  • Reference files explicitly: Use @ to reference files in your prompts (for example, write a test for @auth.py). This avoids unnecessary full-project scans.

  • Use sub-agents: For large tasks, let Claude spawn sub-agents. Each sub-agent returns a concise conclusion, preserving context space in the main conversation.

2. Plan before execution
  • Use Plan mode: Before tackling complex tasks, analyze the solution first without modifying files.

    • Quick action: Press Shift + Tab twice to enter Plan Mode.

    • Prompt constraint: Explicitly instruct Claude: “Output a detailed implementation plan first. Wait for my confirmation before modifying any files.”

  • Reduce trial-and-error: Verify the logic before making code changes.

3. Include project knowledge in CLAUDE.md
  • Include key info: CLAUDE.md loads automatically at the start of each session. Add build commands, coding standards, and workflows to this file.

  • Maintain dynamically: Keep content concise and readable. Record only widely applicable conventions, and update the rules as your project evolves.

4. Extend capabilities: MCP and skills
  • MCP: Install a mature MCP server to connect to external services. For example: add web search MCP.

  • Skills: Write clear skill descriptions. Claude decides whether to invoke a skill based on how well you define its purpose. For example: Add visual understanding skill.

  • Skills vs MCP: Skills teach Claude how to do something (workflow knowledge). MCP gives Claude the tools to do it (external interfaces). The two complement each other. Skills can also integrate external interfaces.

5. Automate guardrails: hooks
  • Use hooks: Hooks are deterministic rules that automatically run local scripts at specific lifecycle points in Claude’s workflow (such as PreToolUse). This ensures that critical checks or actions are always executed.

  • Configuration methods:

    1. Run /hooks for interactive setup.

    2. Edit .claude/settings.json directly.

    3. You can ask Claude to write one. For example: “Write a hook that runs eslint after every file edit.”

6. Build self-check loops
  • Enforce validation: Require Claude to run relevant tests after making code changes, such as pytest or npm test.

  • Define success criteria: For example: “After the changes, make sure the build passes. Then run curl to verify the API returns HTTP 200.”

  • Use visual feedback: For frontend changes, ask Claude to capture browser screenshots to confirm UI results.