A Personal AI Workflow Stack: Claude Code CLI, CC Switch, and 9router
Introduction
This morning I helped a colleague set up a workflow for working with AI. After finishing, I realized I had never organized this system myself. So I decided to strike while the iron is hot and sort out my own daily AI workflow. Plus, some fellow developers said this could help people slack off more at work, so of course I'm sharing it with all of you.
The overall idea is simple: Node.js runs the underlying environment, Claude Code CLI serves as the core entry point, auxiliary tools fill in efficiency gaps, and finally, habits make the whole system truly integrate into daily life.
A heads-up: during the entire process below, some downloads and API access require a proxy environment (you know what I mean). It's recommended to have one ready beforehand to avoid getting stuck midway.
This article leans towards a practical tutorial, without expanding on principles. Just follow the steps in order.
First, take a look at a panoramic view to get a concept of the entire workflow:
[Image temporarily unavailable outside Feishu documents]
Simply put: Node.js lays the foundation → Claude Code acts as the main engine → CC Switch and 9router handle configuration and routing respectively → finally, daily habits enable continuous efficiency evolution.
1. Basic Environment: Installing Node.js
Many AI tools require Node.js to run underneath. Claude Code CLI itself is an npm package, so Node.js is the first thing to install.
Version Selection
It is recommended to install version 20 or above. This version range currently has the best compatibility, and most third-party plugins and tools won't have issues. If you are a Windows user, go directly to the Node.js official website to download the LTS version and install it.
Optional: NVM
If you have multiple projects requiring different Node versions (e.g., company projects use 16, personal projects use 22), you can install NVM (Node Version Manager) for management. If you don't need a development scenario, you don't need to install it.
# Windows uses nvm-windows
# macOS / Linux
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Common commands
nvm install 22 # Install a specific version
nvm use 22 # Switch versions
nvm list # View installed versions
If you don't want to tinker, using the official website installer is sufficient; this step is not mandatory.
Optional: Git
If you are a developer, it's recommended to install Git as well. Claude Code's code diff, commit, and rollback functions all rely on Git; these features won't work without it. Go to the Git official website to download and install it, using default configurations all the way. Pure document writing/office scenarios can skip this step.
2. Installing AI Tools: Claude Code CLI
My current primary tool is Claude Code, used via the command line. Compared to the web version, the CLI's advantage is its ability to directly operate the local file system, offering better context awareness within projects. Writing code, modifying configurations, and searching files can all be done seamlessly.
Installation is simple, a single line of npm global install:
npm install -g @anthropic-ai/claude-code
After installation, executing claude enters the interactive interface. The first time you use it, you need to bind an API Key; just follow the prompts.
Note: The domestic network environment might cause npm installations to be very slow. You can use a proxy or switch to the Taobao mirror:
npm config set registry https://registry.npmmirror.com
If switching mirrors still doesn't work (some packages originate abroad), the only remaining path is to use a VPN. If you encounter similar issues later when installing CC Switch or 9router, the same solution applies.
About API Key and Network
After starting, Claude Code needs to bind an API Key. There are two ways to obtain one:
- Go to the Anthropic Console to register an account, pay-as-you-go, suitable for light use.
- Subscribe to Claude Pro / Max and obtain it from Claude.ai, suitable for heavy users.
Also, note that the official Claude API requires a proxy to access from within China. It's not just slow installation; network connectivity issues at runtime are a more common pitfall. If you don't have a proxy environment or want to save costs, you can pair it with the later-mentioned 9router to bypass using free/relay channels. Steps like registration, login, and getting the Key basically all require a VPN.
Alternative Choice: OpenCode
Recently, I tried OpenCode, and it's also quite good. I mainly use the desktop version daily, primarily because it's friendly to the domestic network environment and installs and runs smoothly without a VPN.
Desktop Version: Go to the official download page to directly download the installation package for your corresponding system (Windows / macOS / Linux are all available). After installation, opening it presents a graphical interface where you can manage multiple session tabs, making operation more intuitive than the terminal.
Terminal Version: If you're used to the command line, you can also install it with one line:
npm install -g opencode-ai
The usage is similar to Claude Code, supporting Skills and MCP, and is also compatible with 9router. Moreover, it can connect with Claude—meaning you can also use Claude's capabilities within OpenCode, and the ecosystems complement each other well. If Claude Code doesn't work smoothly for you, you can try this alternative; it's lightweight and responsive.
3. Auxiliary Tool: CC Switch
CC Switch is an auxiliary tool I use frequently, and pairing it with Claude Code saves a lot of trouble. It's an open-source project, GitHub address: farion1231/cc-switch, currently with 120k+ Stars, one of the most active AI configuration management tools I've seen.
It offers two versions; just pick one based on your usage habits:
- Desktop Version (Recommended) : Supports Windows / macOS / Linux, has a graphical interface, making configuration management clear at a glance. Directly download the installation package for your system from the Releases page.
- CLI Version: A pure command-line version (SaladDay/cc-switch-cli), suitable for users who prefer staying in the terminal. Install it with one npm line:
npm install -g cc-switch-cli
The two features I use most:
1. Usage Query
You can view the current API call volume, token consumption, and cost, which is very helpful for controlling expenses. Especially taking a look before the end-of-month billing gives you peace of mind.
2. Configuration Backup
Back up Claude Code's configuration (including custom instructions, model selection, etc.) with one click. When reinstalling the system or switching computers, you can restore it directly without re-tinkering.
These two features sound simple, but in actual use, they fall into the category of "you can live without them, but once you have them, you can't go back." They pair very handily with Claude Code for daily assistance.
4. Advanced Artifact: 9router
If CC Switch is an assistant, then 9router is what truly made me think, "AI tools can be played like this." Simply put, it's a multi-AI, multi-model management and routing tool. The open-source address is at decolua/9router, with 20k+ Stars.
Installation Method:
npm install -g 9router
After installation, execute 9router in the terminal to start the service:
9router
After starting, it will prompt the Dashboard address http://localhost:20128. Open it in a browser to access the console. 9router also supports pure CLI operation, but I'm used to the browser UI; point-and-click configuration is much more intuitive.
Usage Flow
- Open the Dashboard. On the Providers page, you can see over 40 built-in model providers, many of which are free or come with free quotas (like Kiro AI, OpenCode Free, Vertex AI, etc.). After registering for the corresponding service, you can connect and use them for free.
- If you have your own API Key (e.g., from Anthropic official, OpenRouter, DeepSeek, or other relay channels), you can also manually add them in the Dashboard.
- After configuration, switch to the CLI Tools page. The Endpoint defaults to
http://localhost:20128/v1, no need to change it. In the model selection area, you can choose the model corresponding to the current CLI—selecting 9router's built-in default model is fine, selecting your own added model is fine, or selecting configured Combos is fine. For the API Key, fill in the key generated in the 9router Dashboard. After this, all model requests from Claude Code will be uniformly routed through 9router.
Security Reminder: Free models and third-party relay APIs mostly send your request content to third-party servers. It's fine for personal projects and public content, but for company projects and sensitive code, it's recommended to only use official channels. Don't risk core assets by sending them through unknown channels just to save money.
Core Concept
There are many AI models on the market now—Claude's, OpenAI's, and various open-source models—each with its own strengths and weaknesses. 9router lets you manage these models in one place, switching to whichever you need without jumping between different platforms.
Combos Feature (Key Recommendation)
This is the feature I use most in 9router. Combos means: you can package multiple models into a "virtual model" and then call it from AI tools like Claude Code. It's equivalent to configuring models into a combination, usable under a single name.
For example: I created a Combo containing Claude, GLM, MiniMax, and a few other models, arranged in the order of "primary model → backup → fallback." When I ask a question in Claude Code, the request first goes to the primary model. If its quota is exhausted or it errors out, 9router automatically switches to the next backup model, all without manual intervention. It's like equipping the primary model with a full set of "spares," preventing dropouts during peak times or quota emergencies.
Relationship with CC Switch
I use these two tools together; their functions complement each other without conflict:
- CC Switch → Handles configuration management and usage monitoring, playing a "butler" role.
- 9router → Handles model routing and combination, playing a "distribution" role.
Simple understanding: one manages my own efficiency and cost of using AI, the other manages how AI models collaborate with each other.
5. Daily Usage Habits
Installing the tools is just the first step; what truly boosts efficiency are the usage habits.
5.1 Scenario-Based Skill Installation
Claude Code supports extending capabilities through Skills. Install different ones for different scenarios:
- When writing documents: Install Skills for formatting, article illustration, etc.
- When writing code: Install Skills for debugging, code review, test generation, etc.
- Daily office work: Install integration Skills for calendars, task management, etc.
It's not recommended to install everything at once. Load them on demand; otherwise, the prompt length will grow and affect speed.
By the way, besides Skills, the Claude Code ecosystem also has MCP (Model Context Protocol) as an extension mechanism for connecting external tools and data sources. MCP can also be managed uniformly in CC Switch. This is an advanced play; no rush to study it until you need it.
5.2 Regular Review
I spend about 10 minutes every week reviewing my AI usage for the week:
- In which scenarios did AI significantly improve efficiency?
- In which scenarios did AI do more harm than good?
- Are there any prompts that could be optimized?
- Are there any tool configurations that need adjustment?
Sticking to this habit, you'll find your usage methods continuously evolving, rather than stagnating after the initial setup.
5.3 Common Claude Code Commands
Finally, attached are the commands I use frequently daily, for reference:
# Start an interactive session (might need a VPN for authentication the first time)
claude
# Single question (without entering interactive mode)
claude "Help me analyze this error"
# Resume the last session
claude --resume
# Continue the most recent conversation
claude --continue
In-Session Shortcut Commands:
/init— Initialize project configuration (generates CLAUDE.md, etc.)/clear— Clear the current session context/compact— Compress context (use when the conversation gets too long to avoid exceeding limits)/cost— View the token consumption and cost estimate for the current session/insights— View session insights and statistics (very useful for regular reviews)/exit— Exit the current session/help— View all available commands...
Hidden Easter Egg:
Add ultrathink at the end of your question, for example:
Help me refactor this code, ultrathink
You will see a circle of colorful special effects in the terminal. It's a small easter egg in Claude Code, intended for very complex problems.
6. Common Issues
1. Switched provider configuration, but Claude Code doesn't take effect?
Most likely an environment variable conflict. If you set environment variables like ANTHROPIC_API_KEY in your system, they will override the CC Switch / 9router configuration. Troubleshooting command:
cc-switch env check --app claude
If you confirm it's an environment variable issue, go to system settings to delete the corresponding variable, then restart the terminal.
2. 9router startup prompts port is occupied?
The default port is 20128. If it's occupied by another process, find the occupying process and kill it, or change the port:
# Windows
netstat -ano | findstr :20128
taskkill /PID <pid> /F
3. Claude Code can't connect, reports a network error?
Check the proxy first. The official Claude API requires a proxy environment in China. Confirm the proxy software is running, or confirm the terminal can normally access the external network.
4. After restarting the computer, 9router isn't running, and all models report errors?
9router is a foreground service. After a restart, you need to manually execute 9router to start it again. If this bothers you, you can check the project documentation to set it up to start automatically on boot.
Conclusion
Ultimately, tools are just means. Whether it's Node.js or 9router, they all do the same thing: reduce the friction when using AI, allowing you to focus your attention on the problems you really need to solve.
Once this workflow runs smoothly, a typical day looks like this: open the terminal in the morning, start the 9router service, enter a claude session, call up the corresponding Skill based on the scenario, click a couple of times in the Dashboard if you need to switch models, and use CC Switch at the end of the month to check usage and review—throughout the whole set, your energy is mostly spent on the actual work.
There are no standard answers for tools; the best one is the one that fits your own rhythm. My configuration here is also constantly being adjusted. If you have better tools or different ways of using them, you're welcome to exchange ideas.
Top 3 of 5 from juejin.cn, machine-translated. The original thread is authoritative.
Bring something everyone doesn't already know.
Alright, I'll put out an advanced AI usage guide later [lightbulb moment]
I thought it would be about simplifying your own work by designing AI workflows, didn't expect it to just be a tutorial on a few tools [awkward grin]
Basic-level stuff,,,, [blushing]
Some of you guys don't roast me, not everyone is proficient with AI. This is a basic-level tutorial. There are still plenty of people like my coworkers who've only heard of it but never tried it [sweating]