跪拜 Guibai
← All articles
Artificial Intelligence · Workflow Engine

A Personal AI Workflow Stack: Claude Code CLI, CC Switch, and 9router

By 昭阳 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The stack solves two concrete pain points for developers using LLMs from the command line: managing API costs and configuration across reinstalls, and keeping model access reliable when a primary provider's quota runs out or its network is unreachable. The 9router Combo pattern, which chains models into automatic fallback sequences, is a lightweight alternative to paid multi-provider routing services.

Summary

The core setup runs on Node.js with Claude Code CLI as the primary engine, chosen for its direct file-system access and project-level context awareness. CC Switch handles API usage monitoring and one-click configuration backups, while 9router acts as a local model gateway that can chain multiple providers into fallback Combos, automatically switching when a primary model hits a quota limit or errors out. The workflow also incorporates scenario-based Skill loading inside Claude Code and a weekly review habit to refine prompts and tool configurations.

For developers inside China's network environment, the guide addresses the practical friction of API access by routing requests through 9router's built-in free providers or relay channels, though it warns against sending sensitive company code through third-party endpoints. An alternative tool, OpenCode, is noted for its domestic-network-friendly desktop client and interoperability with Claude's ecosystem.

The end state is a terminal-first routine: start 9router, launch Claude Code, load Skills by task type, and review costs monthly through CC Switch. The emphasis is on reducing tool-switching friction so attention stays on the problem at hand.

Takeaways
Node.js 20+ is the recommended runtime foundation because Claude Code CLI ships as an npm package and most AI tooling in this ecosystem depends on it.
Claude Code CLI is installed globally via `npm install -g @anthropic-ai/claude-code` and requires an API key from Anthropic's console or a Claude Pro/Max subscription.
CC Switch provides a desktop GUI and a CLI version for tracking API call volume, token consumption, and cost, plus one-click backup and restore of Claude Code configurations.
9router is a local multi-model router that exposes an OpenAI-compatible endpoint at `http://localhost:20128/v1` and lists over 40 built-in providers, including several with free tiers.
The Combos feature in 9router packages multiple models into a single virtual model with a priority order; if the primary model fails or exhausts its quota, the router automatically falls back to the next model in the chain.
Claude Code sessions support in-line commands like `/cost` for token estimates, `/compact` to shrink long context windows, and `/init` to generate project-level CLAUDE.md configuration files.
Adding `ultrathink` to the end of a prompt triggers a visual easter egg in Claude Code's terminal interface, intended for complex problems.
Environment variables like `ANTHROPIC_API_KEY` can silently override CC Switch or 9router settings; the command `cc-switch env check --app claude` diagnoses the conflict.
9router runs as a foreground process and must be manually restarted after a reboot unless configured as a startup service.
OpenCode is offered as a fallback desktop client that installs without a proxy in restricted network environments and can interoperate with Claude's capabilities.
Conclusions

The workflow treats model access as an infrastructure reliability problem rather than a model-quality problem: 9router's Combo fallback chain is essentially a load-balancing and circuit-breaker pattern applied to LLM APIs.

CC Switch and 9router together separate two concerns that most AI coding tools bundle opaquely — cost governance and model routing — giving the developer explicit control over both without leaving the terminal.

The recommendation to load Skills per scenario rather than globally is a small but meaningful performance constraint: it acknowledges that prompt bloat from unused extensions directly slows inference, which matters more in a CLI where latency is felt immediately.

The guide's security warning about third-party model relays reflects a real tension in regions where official API access requires a proxy: the convenience of free or relayed endpoints trades off against the risk of leaking proprietary code to unvetted servers.

Concepts & terms
Claude Code CLI
Anthropic's official command-line tool for interacting with Claude models directly from the terminal. It is distributed as an npm package and can read, write, and diff files in the local project directory, enabling agentic coding workflows.
CC Switch
An open-source configuration manager for Claude Code that tracks API usage and cost, and backs up settings like custom instructions and model preferences. Available as a desktop app with a GUI or a CLI-only version.
9router
A local multi-model routing tool that presents an OpenAI-compatible API endpoint. It aggregates over 40 model providers and supports Combos — ordered fallback chains of models that automatically switch when the primary model fails or runs out of quota.
Combos (9router)
A virtual model composed of multiple real models arranged in a priority sequence. Requests are sent to the first model; if it errors or hits a rate limit, the router falls through to the next model in the chain without manual intervention.
MCP (Model Context Protocol)
An extension mechanism in the Claude ecosystem for connecting external tools and data sources to the model. It is managed alongside Skills and can be configured through CC Switch.
From the discussion

The discussion splits between a demand for more advanced, original content and a defense of introductory material. The pushback argues that basic tool tutorials still serve a large audience of newcomers who have only heard about AI but never used it. A reply promises a follow-up with higher-level AI usage.

Basic tool tutorials feel underwhelming to those expecting deeper workflow design or novel techniques.
Introductory content remains necessary because many developers have only heard of AI tools without hands-on experience.
A more advanced guide is promised as a future follow-up.
Featured comments
余斯内克

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]

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗