






















暂无文章
This is Part 01 of the Crazyrouter Claude Code series. This article focuses on “Claude Code with Crazyrouter: Quick Start and Configuration,” with an emphasis on getting started with Claude Code and setting it up correctly.
Unified access pattern: use
ANTHROPIC_BASE_URL=https://cn.crazyrouter.comfor Claude Code / Anthropic native clients; usebase_url=https://cn.crazyrouter.com/v1for OpenAI-compatible SDKs, HTTP requests, and frontend/backend applications.
/v1/v1/... issue caused by an incorrect Base URL.Your system must meet the following minimum requirements:
Operating system: Linux (Ubuntu 18.04+, CentOS 7+), macOS 10.15+, Windows 10+
Network connection: a stable internet connection
Storage: at least 500 MB of available disk space
Before you begin the installation, check your Node.js and npm versions:
If Node.js is not installed on your machine, we recommend installing Node.js 18 LTS or later:
Before you begin the installation, check your Git version:
If Git is not installed on your machine, choose the installation method for your system:
When connecting Claude Code to Crazyrouter, configure ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY first. In most cases, there is no need to include an empty proxy address in the article.
Windows PowerShell:
macOS / Linux:
If you want a script to automatically check Git, Node.js, and Claude Code, you can use the Crazyrouter Claude Code one-click configuration script.
Enter claude in the terminal. You will then need to log in to Claude and authenticate with your Crazyrouter Token.
Want to get started quickly? Begin with claude --help. This command lists all available options and commands, such as -p for non-interactive output, -c to continue the most recent conversation, and --model to specify a model. Memorizing common options can double your efficiency—for example, use claude -r to restore a previous session, or --output-format json to export structured results.
| Command | Description | Use Case |
|---|---|---|
| /clear | Clear context | Use this when you need to start over or feel that the AI can no longer solve the problem |
| /compact | Compact the conversation | Start a new conversation without losing previous memory |
| /cost | Cost | Check the current session’s usage; recommended to cross-check with logs in the Crazyrouter console |
| /logout /login | Log out / log in | Switch accounts and similar operations |
| /model | Switch model | Switch available models based on Token permissions and the model whitelist |
| /status | Status | View the current status of CC |
| /doctor | Diagnostics | Check the installation status of CC |
Install the plugin: search for “Claude Code,” choose the official Anthropic version, and click Install.
Quick launch: use the Cmd+Escape shortcut (customizable) to wake it up, or click the Claude Code icon in the IDE UI. The workspace will appear directly on the right. It supports automatically passing selected code into context, comparing code changes with diff, and even using Alt+Cmd+K to push selected content into the prompt box with one action.
This is suitable for file creation and modification scenarios where you do not need to confirm each step. Press Shift+Tab once to enable it. Claude will then automatically perform edit operations without manual confirmation. For example, if you prompt it with “create a cool todolist app,” it will directly generate and modify files, saving the time spent on repeated confirmations.
When setting up a project or handling a complex problem, press Shift+Tab twice to enable Plan Mode. It will first outline the solution structure. For example, if you want to build “a pixel-style mobile todolist,” it will automatically plan the tech stack, page structure, adaptation strategy, and more before implementation. If you are not satisfied, you can simply say “replan” until it meets your expectations.
When refactoring code, starting a new project, or fixing a complex bug, use claude --dangerously-skip-permissions to enter Yolo Mode. In this mode, Claude has higher permissions and can directly perform more operations. Be mindful of security and use it in a sandbox environment when possible. After entering this mode, you can still use Shift+Tab to adjust modes and flexibly switch the permission level.
When talking to a chatbot, we know the “system prompt” matters because it continuously affects the AI’s behavior. In CC, CLAUDE.md plays a similar role. A typical workflow looks like this:
Create an initial CLAUDE.md → keep chatting until the context is close to overflowing, then run /compact to extend the session → when you reach a milestone, ask CC to update CLAUDE.md based on the progress → repeat until finished
As you can see, CLAUDE.md acts like a global variable that keeps taking effect throughout the session. And when CC writes to it, it usually summarizes aggressively enough to keep the file very readable.
Notes on CLAUDE.md
Esc while working to pause the current operation. For example, if you notice Claude is stuck installing dependencies or going down the wrong path, interrupting it early can reduce wasted work.Esc twice to roll back to a previous point in the conversation history. Note that there is no redo feature, so confirm before rolling back./compact command to extend the session and avoid interruptions.#claude -c to jump directly back into the previous conversation.claude -r to choose and restore a historical session, which is useful when you exit midway and want to continue working later.Want to know how many resources you consume per day or per hour? Run npx ccusage@latest to view daily usage, or npx ccusage blocks --live to monitor consumption speed in real time. If usage is growing too quickly, you can handle token-heavy operations such as git commits manually to avoid going over the limit.
If you need to run dozens of repetitive tasks, such as generating documentation chapters in batches, use a script-style workflow:
TASK.md, with one task per line.You can add timeout to prevent a single task from hanging, and use --allowedTools "Edit" to limit permissions and avoid accidental operations. Be careful not to run tasks concurrently, or you may trigger rate-limit bans.
Claude may occasionally “brag,” for example by claiming success before tests are complete. Add a rule to CLAUDE.md such as: “Every time you claim success, you must include a link to evidence files.” Also ask it periodically: “Is it really done? Do you have evidence?” If you find a problem, have it fix it immediately.
Mastering these techniques turns Claude Code from a “tool” into an “efficient partner.” Whether you use it for daily coding, project management, or batch processing, it can significantly improve productivity. Remember: the key is to switch modes as needed, make good use of global memory, and add the right monitoring and safeguards. That is how you get the most value out of it.
/v1 usageIf you are ready to connect Claude Code, domestic models, or your own applications to Crazyrouter through a unified setup, proceed in this order:
https://cn.crazyrouter.com; for OpenAI-compatible SDKs, use: https://cn.crazyrouter.com/v1./v1.When you need to evaluate model costs or choose different models, first check the Crazyrouter pricing and models page, then add your commonly used models to the Token whitelist.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。