Skip to content
/

CCS (Claude Code Switch)

ccs-switch · kaitranntt/ccs · ★ 2.4k · last commit 2026-04-20

Primitive shape 2 total
Commands 1 Skills 1
00

Summary

ccs-switch — Summary

One-liner: Multi-runtime CLI bridge and account manager that routes Claude Code tasks to the optimal AI coding agent (Claude, Codex, Factory Droid, Gemini, Ollama, and more) based on intelligent profile matching, with a web dashboard for usage analytics.

Identity

Field Value
Slug ccs-switch
GitHub https://github.com/kaitranntt/ccs
Stars 2,410
License MIT
Language TypeScript
Version analyzed 8.1.0
Maintainer status Active
Contributors 30

What It Does

CCS (Claude Code Switch) is a multi-provider AI coding agent router. Starting from a Docker Compose quickstart (dashboard on port 3000, CLIProxy on port 8317), it allows developers to route Claude Code tasks to different AI runtimes based on cost, capability, and workload type. A Claude Code skill (ccs-delegation) and command (ccs.md) are bundled to enable in-session routing from within a Claude Code conversation.

Key capabilities include:

  • Multi-provider routing: Claude, Codex, Factory Droid, GLM, Ollama, OpenRouter, Kimi, Qwen, Kiro, local models
  • CLIProxy: OAuth proxy with round-robin or fill-first account load balancing across multiple Claude accounts
  • Web dashboard: Usage analytics, live auth monitor, session history on port 3000
  • OpenAI-compatible proxy: ccs proxy start exposes a local Anthropic-compatible API endpoint
  • Multiple binaries: ccs, ccs-droid/ccsd, ccs-codex/ccsx, ccsxp
  • Browser automation: Built-in WebSearch fallback and browser automation capabilities

Scope

Mid-complexity platform tool. Includes CLI, web UI, Docker infrastructure, Claude Code plugin (1 command + 1 skill), and community integrations (OpenCode sync plugin by third party).

01

Purpose Workflow

ccs-switch — Purpose & Workflow

Problem Solved

Developers using multiple AI coding agents (Claude Code, Codex, Factory Droid, Ollama) face three problems:

  1. Context switching cost: Different CLIs, different configurations, different command syntax
  2. Account management: Claude Pro accounts have rate limits; multiple accounts need round-robin load balancing
  3. Cost optimization: Different tasks warrant different models (haiku for simple tasks, opus for complex reasoning)

CCS solves all three: a single CLI entry point, account pool management via CLIProxy, and intelligent profile-based task routing.

Deployment Model

# Quickstart via Docker Compose
docker compose up -d
# → Dashboard: http://localhost:3000
# → CLIProxy: http://localhost:8317

Or install the CLI directly:

npm install -g @kaitranntt/ccs

Workflow: Task Delegation from Claude Code

When a developer is in a Claude Code session and wants to delegate a task to a different agent:

Developer: /project:ccs <task description>
        ↓
ccs.md command invokes ccs-delegation skill
        ↓
ccs-delegation parses task + reads ~/.ccs/config.json
        ↓
Profile matching: cost/capability/workload type
        ↓
ccs CLI called with optimal profile + enhanced prompt
        ↓
Target agent (Codex, Droid, Ollama, etc.) executes task
        ↓
Result returned to Claude Code conversation

Workflow: CLIProxy Account Load Balancing

Claude Code session → CLIProxy (port 8317)
        ↓
Round-robin or fill-first across account pool
        ↓
Route to next available Claude account
        ↓
Response proxied back to Claude Code

Workflow: OpenAI-Compatible API Proxy

ccs proxy start                    # Start local proxy
eval "$(ccs proxy activate)"       # Set env vars
# Any OpenAI-compatible SDK now routes through CCS → Claude

Supported Providers

Provider Binary Use case
Claude Code ccs General coding
Codex ccs-codex / ccsx Lightweight tasks
Factory Droid ccs-droid / ccsd Agent pipelines
GLM via config Chinese model tasks
Ollama via config Local/offline tasks
OpenRouter via config Multi-model routing
Kimi via config Long context tasks
Qwen via config Alternative reasoning
Kiro via config AWS-native tasks
Local models via config Air-gapped environments
02

Commands Skills

ccs-switch — Commands & Skills

Claude Code Commands

1 command shipped: ccs.md

Located at .claude/commands/ccs.md. This is a Claude Code slash command that delegates a task to the optimal AI agent via the ccs-delegation skill.

/project:ccs <task description>

Behavior: reads the task description, invokes the ccs-delegation skill to select the appropriate profile from ~/.ccs/config.json, enhances the prompt, and dispatches via the ccs CLI binary.

Claude Code Skills

1 skill shipped: ccs-delegation

Located at .claude/skills/ccs-delegation.md. This is a behavioral guidance skill that teaches Claude Code how to intelligently route tasks to the optimal CCS profile.

Key behaviors encoded in the skill:

  • Parse task description for complexity signals (simple/complex/specialized)
  • Read available profiles from ~/.ccs/config.json
  • Select profile based on cost efficiency, capability match, and current workload
  • Enhance the prompt with context appropriate for the target agent
  • Execute via ccs --profile <name> "<enhanced prompt>"
  • Return results to the Claude Code conversation

Configuration File

~/.ccs/config.json — defines the profile registry:

{
  "profiles": {
    "cheap": {
      "provider": "codex",
      "model": "gpt-4o-mini",
      "use_for": "simple tasks, formatting, documentation"
    },
    "powerful": {
      "provider": "claude",
      "model": "claude-opus-4",
      "use_for": "complex reasoning, architecture decisions"
    },
    "local": {
      "provider": "ollama",
      "model": "llama3",
      "use_for": "offline tasks, sensitive codebases"
    }
  }
}

CCS CLI Commands

# Core routing
ccs "<task>"                          # Route with default profile
ccs --profile <name> "<task>"         # Route with specific profile
ccs --agent codex "<task>"            # Route to specific agent type

# Binary aliases
ccsx "<task>"                         # Codex shorthand
ccsd "<task>"                         # Factory Droid shorthand

# Proxy management
ccs proxy start                       # Start OpenAI-compatible proxy
ccs proxy stop                        # Stop proxy
ccs proxy activate                    # Print env var export commands
eval "$(ccs proxy activate)"          # Activate proxy in current shell

# Account management
ccs accounts list                     # List configured accounts
ccs accounts add                      # Add new account
ccs accounts remove <id>              # Remove account

# Analytics
ccs usage                             # Usage summary
ccs usage --by-profile                # Usage by profile
ccs usage --by-day                    # Daily breakdown
03

Mcp Tools

ccs-switch — MCP & Tools

MCP Server

None shipped as a bundled MCP server. CCS integrates with Claude Code via the plugin system (command + skill), not MCP protocol.

CLIProxy (Port 8317)

The CLIProxy is not an MCP server — it is an OAuth proxy that:

  • Manages a pool of Claude accounts
  • Intercepts Claude Code's outbound API calls
  • Routes to the next available account via round-robin or fill-first strategy
  • Proxies responses back to Claude Code transparently

This is similar in concept to claude-overlay's multi-provider routing, but CCS's CLIProxy specifically manages multiple accounts of the same provider (multiple Claude accounts) for rate limit distribution.

OpenAI-Compatible Proxy

ccs proxy start exposes a local API endpoint that:

  • Accepts OpenAI-format API calls
  • Translates to Anthropic/Claude format
  • Routes through CCS profile selection
  • Returns OpenAI-format responses

This allows any OpenAI SDK-compatible tool to use Claude via CCS:

import openai
client = openai.OpenAI(base_url="http://localhost:8317/v1", api_key="any")
response = client.chat.completions.create(...)

Browser Automation

CCS ships WebSearch fallback and browser automation capabilities (details in the web UI context). These are accessible as features within routed agent sessions, not as standalone MCP tools.

Community Integration: OpenCode Sync

A third-party community plugin (JasonLandbridge/opencode-ccs-sync) synchronizes CCS configuration with OpenCode, allowing OpenCode users to benefit from CCS's account management and routing.

The README credits claude-code-router by musistudio as a related project. CCS and claude-code-router address similar routing problems from different angles.

Web Dashboard (Port 3000)

  • Usage analytics: Token consumption by profile, provider, and day
  • Live auth monitor: Real-time status of account pool health
  • Session history: Past sessions with provider/model/token breakdown
  • Tech stack: Vite + React + TypeScript (in ui/ directory)
  • Deploy: Via Docker Compose (ghcr.io/kaitranntt/ccs:latest)
05

Quality Gates

ccs-switch — Quality Gates

Validation Approach

CCS is a routing and infrastructure tool, not a code generation or analysis tool. Its quality model centers on configuration correctness and account health rather than code quality gates.

Live Auth Monitor

The web dashboard's live auth monitor is a quality gate for account pool health:

  • Displays real-time status of each account (healthy/rate-limited/expired)
  • Prevents routing to accounts that would fail
  • Visual indicator in dashboard (port 3000)

This is operational quality, not code quality.

Profile Validation

~/.ccs/config.json is validated on load. Missing required fields (provider, model) cause clear error messages rather than silent routing failures.

CLIProxy Health Checks

The CLIProxy maintains account health state and automatically excludes rate-limited or expired accounts from the rotation. This is an implicit quality gate: no failed API calls are forwarded to Claude Code as successful responses.

No TDD Evidence

No test suite or TDD enforcement documented in the available data.

No Code Quality Gates

CCS does not run linters, formatters, or type checkers on code it routes to other agents. Quality of the work done by delegated agents is the responsibility of those agents.

Security Considerations

  • OAuth token management: CLIProxy handles multiple OAuth tokens; token storage security depends on the implementation
  • API key exposure: ccs proxy activate exports env vars; these should not be logged
  • Multi-account isolation: Round-robin routing across accounts must not cross-contaminate conversation context between different accounts
09

Uniqueness

ccs-switch — Uniqueness

differs_from_seeds

CCS has no direct analog among the 11 seeds. Seeds focus on enhancing a single agent (Claude Code) with better prompts, skills, and workflows. CCS treats Claude Code as one agent in a portfolio and optimizes which agent handles each task.

Specifically:

  • superpowers, BMAD-METHOD, spec-driver: enhance Claude Code from within — more skills, better prompts, structured workflows. All assume Claude Code is the only agent.
  • taskmaster-ai: structured task management for Claude Code sessions, but all tasks run on Claude
  • No seed includes multi-provider routing, account pool management, or cross-agent task delegation

The closest batch peer is claude-overlay (also routes model selection for Claude Code), but claude-overlay configures Claude Code's model provider while CCS routes entire tasks to external agent runtimes with their own CLIs. Claude-overlay is an infrastructure modifier; CCS is an orchestrator.

Positioning

  • Primary differentiator: Multi-runtime task delegation. The only tool in the catalog that uses a Claude Code skill to intelligently route tasks to external agent runtimes (Codex, Factory Droid, Ollama, Kiro) based on cost/capability/sensitivity profiles.
  • Secondary differentiator: Account pool management via CLIProxy. The only tool that explicitly addresses Claude rate limits by maintaining an OAuth-managed pool of multiple Claude accounts with round-robin/fill-first load balancing.
  • Tertiary differentiator: OpenAI-compatible proxy shim. Any OpenAI SDK client routes through CCS, enabling legacy OpenAI-integrated tools to use Claude without code changes.
  • Target user: Teams running sustained AI coding sessions who encounter rate limits, have cost optimization needs (cheap tasks don't need Claude Opus), or operate in environments with data residency requirements (local Ollama for sensitive repos).

Observable Failure Modes

  1. Conversation context loss on delegation: When Claude Code delegates a task via /project:ccs, the target agent starts with a fresh context. If the task requires knowledge from earlier in the Claude Code conversation, the enhanced prompt must carry it — which depends on the skill's context-packing logic.
  2. Docker dependency for full feature set: The web dashboard and CLIProxy require Docker Compose. Developers who prefer CLI-only setup get reduced functionality (no usage analytics UI, no OAuth pool).
  3. Profile drift: As ~/.ccs/config.json accumulates profiles, the routing heuristics in ccs-delegation may become stale. There's no mechanism to validate that profile descriptions still reflect actual capability differences between providers.
  4. OAuth token rotation: The CLIProxy holds OAuth tokens for multiple accounts. Token expiry handling and the security of the token storage are not documented.
  5. 2,410 stars but v8.1.0: The high version number suggests rapid iteration. Breaking changes between versions may affect teams who pin to specific versions.

Most Surprising Finding

A community member independently built JasonLandbridge/opencode-ccs-sync to integrate CCS with OpenCode — a signal that CCS has ecosystem gravity beyond its own repository despite being primarily a TypeScript CLI package. This organic third-party integration suggests the account management and routing patterns are genuinely useful to developers working across multiple AI tool platforms.

04

Agent Patterns

ccs-switch — Agent Patterns

Primary Pattern: Intelligent Task Delegation

The core agent pattern is skill-driven task routing: a Claude Code skill (ccs-delegation) reads a task description, consults a profile registry, and delegates to the optimal agent. Claude Code becomes the orchestrator; other agents (Codex, Droid, Ollama) become executors.

Claude Code [orchestrator]
    → reads ccs-delegation skill
    → matches task to profile
    → ccs CLI [dispatcher]
        → Codex / Droid / Ollama / Claude [executor]
        → returns result
    → Claude Code incorporates result

This is a two-level agent hierarchy:

  1. Orchestrator: Claude Code running the /project:ccs command
  2. Executor: The target agent running the delegated task

Pattern: OAuth Account Pool

The CLIProxy pattern manages a pool of accounts for the same provider, distributing load to avoid rate limits. This is account-level load balancing, not agent-level orchestration.

Round-robin: Tasks distributed evenly across account pool Fill-first: Use one account until exhausted, then next

Pattern: OpenAI Proxy Shim

By exposing an OpenAI-compatible API, CCS acts as an adapter layer that lets any tool targeting the OpenAI API use Claude as the backend. This is a compatibility bridge, not orchestration.

Profile-Based Routing Logic

The ccs-delegation skill encodes routing heuristics:

Task signal Profile selected Rationale
"format", "rename", "comment" cheap/codex Low complexity, cost optimization
"architecture", "debug complex" powerful/claude-opus High complexity, quality critical
"sensitive", "offline", "private" local/ollama Data residency concerns
"long context", "large file" kimi Extended context window
"AWS", "Lambda" kiro Domain-specialized agent

Cross-Provider Compatibility

CCS abstracts away provider-specific CLI syntax differences:

  • Claude Code: claude "<prompt>"
  • Codex: codex "<prompt>"
  • Factory Droid: droid run "<prompt>"
  • Ollama: ollama run <model> "<prompt>"

All normalized to: ccs [--profile <p>] "<prompt>"

No Subagent Spawning

CCS delegates tasks sequentially — it does not spawn parallel subagents or manage concurrent agent sessions. One task → one agent → one result.

06

Memory Context

ccs-switch — Memory & Context

Persistent State

CCS maintains several persistent stores:

Store Location Purpose
Profile config ~/.ccs/config.json Provider/model profiles
Account pool ~/.ccs/accounts.json (inferred) OAuth tokens + status
Usage analytics CLIProxy database (port 8317) Session history, token counts
Dashboard state Web UI state (port 3000) Live auth status, charts

No Conversation Memory

CCS does not maintain conversation context between delegated tasks. Each /project:ccs invocation is independent — the skill reads the current task description, routes, and returns a result. There is no state carryover from previous delegations.

Account Pool State

The CLIProxy does maintain account health state across sessions:

  • Rate-limit status per account
  • Last-used timestamp per account (for round-robin ordering)
  • Auth validity status

This state persists as long as the CLIProxy Docker container is running.

Context Passed to Delegated Agents

The ccs-delegation skill enhances the prompt before delegation — it adds context appropriate for the target agent's capabilities and constraints. This is context augmentation, not memory. The enhanced prompt is created fresh from the current Claude Code conversation context, not from a cross-session store.

Profile Registry as Institutional Memory

~/.ccs/config.json is the durable knowledge store: it encodes the organization's routing decisions, provider preferences, and cost policies. This is an explicit design choice — routing strategy is treated as configuration, not runtime inference.

Usage Analytics Persistence

The web dashboard (port 3000) shows historical usage data. This persists across sessions as long as the Docker Compose stack is running. The retention period and storage engine are not documented in the gathered data.

07

Orchestration

ccs-switch — Orchestration

Multi-Agent Pattern

Yes — CCS implements a skill-driven task delegation pattern where Claude Code acts as orchestrator and target agents (Codex, Droid, Ollama, etc.) act as executors.

This is sequential delegation: one task at a time, one agent at a time.

Orchestration Pattern

task-delegation — the ccs-delegation skill routes tasks to agents based on profile matching. The routing decision is made by Claude Code running the skill; CCS CLI executes the routing.

Execution Mode

interactive — CCS is not one-shot. The CLIProxy and web dashboard run as persistent services. The /project:ccs command can be invoked repeatedly within a session.

Isolation Mechanism

Per-session isolation via account routing — different Claude Code sessions may route to different accounts in the pool, but there is no filesystem-level or container-level isolation between sessions.

Multi-Model Usage

Yes — CCS is explicitly a multi-model router. The profile registry defines different models for different task types:

  • Fast/cheap: GPT-4o-mini via Codex
  • Powerful: Claude Opus via Claude Code
  • Local: Llama 3 via Ollama
  • Domain-specific: Kiro for AWS tasks

Max Concurrent Agents

1 (sequential delegation). No documented parallel execution.

Subagent Definition Format

Implicit — the ccs-delegation skill defines which agents are available and how to select them, but the agents themselves are external binaries, not defined within CCS.

Cross-Tool Portability

High — CCS provides a CLI abstraction over 10+ providers, making it the multi-provider router with the broadest provider coverage in this batch. The OpenAI-compatible proxy further extends compatibility to any OpenAI SDK client.

Docker Compose Infrastructure

services:
  dashboard:
    image: ghcr.io/kaitranntt/ccs:latest
    ports: ["3000:3000"]     # Web UI
  cliproxy:
    image: ghcr.io/kaitranntt/ccs:latest
    ports: ["8317:8317"]     # OAuth proxy

The infrastructure is Docker-native but the CLI is npm-installable as a standalone package without Docker.

08

Ui Cli Surface

ccs-switch — UI & CLI Surface

CLI Binaries

CCS ships multiple binaries for ergonomic access to different providers:

Binary Alias Provider shorthand
ccs Primary router
ccs-droid ccsd Factory Droid
ccs-codex ccsx Codex
ccsxp Extended proxy mode

Install:

npm install -g @kaitranntt/ccs

Or via Docker:

docker pull ghcr.io/kaitranntt/ccs:latest
docker compose up -d

Local UI Surface

Web Dashboard at http://localhost:3000:

  • Usage analytics: Token consumption broken down by profile, provider, model, and day
  • Live auth monitor: Real-time account pool health — green/amber/red status per account
  • Session history: Browsable log of past agent sessions with metadata
  • Tech stack: Vite + React + TypeScript (ui/ directory)
  • Deploy: Docker Compose only (no standalone web server)

Claude Code Plugin Surface

Installed at .claude/commands/ and .claude/skills/:

  • /project:ccs <task> — command that invokes skill-driven routing
  • ccs-delegation skill — routing logic for Claude Code to consume

OpenAI-Compatible API Proxy

ccs proxy start             # Start proxy at localhost:8317
eval "$(ccs proxy activate)" # Export OPENAI_BASE_URL + OPENAI_API_KEY

Any OpenAI-compatible client then routes through CCS:

OPENAI_BASE_URL=http://localhost:8317/v1
OPENAI_API_KEY=<any string>

CLIProxy OAuth Manager

Accessible at http://localhost:8317 — not a user-facing UI, but an OAuth proxy endpoint for Claude Code to route through. Manages account pool round-robin or fill-first distribution.

Community Integration

JasonLandbridge/opencode-ccs-sync (third-party) — syncs CCS configuration with OpenCode for OpenCode users who want CCS's routing benefits.

Related frameworks

same archetype · same primary tool · same memory type

CodeMachine CLI ★ 2.5k

JavaScript-DSL workflow orchestration engine that captures repeatable AI coding agent workflows with tracks, condition groups,…

Codexia ★ 690

Tauri desktop app providing visual control plane, task scheduler, git worktree manager, and headless REST API for Codex CLI +…

Kagan ★ 88

Kanban TUI for AI coding agents with a structurally enforced human review gate (REVIEW → DONE cannot be automated) — one git…

oh-my-claudecode (Yeachan-Heo) ★ 35k

Zero-learning-curve teams-first multi-agent orchestration for Claude Code with autopilot (6-phase lifecycle), ralph (PRD-driven…

Paseo ★ 6.8k

Multi-provider AI coding agent orchestration daemon with cross-device access (phone/desktop/CLI) and git worktree isolation.

CCG Workflow ★ 5.4k

Routes Claude + Codex + Gemini to task-appropriate collaboration strategies (direct-fix through full-collaborate) with hook-based…