Advanced routing and transformation system for Claude Code outputs to multiple AI providers
npm install route-claudecode๐ Enterprise-grade dual-server routing system for Claude Code with intelligent multi-provider support, advanced daemon management, and real-time monitoring.


default, background, thinking, longcontext, search- Node.js 16+ (18+ recommended)
- Operating System: macOS 10.15+, Ubuntu 20.04+, Windows 10+ (native support)
- Claude Code CLI installed
- Provider credentials (AWS CodeWhisperer, OpenAI keys, etc.)
bash
npm install -g route-claudecode
`$3
`bash
Start both development and release servers
rcc startOr explicitly with daemon mode and auto-start
rcc start --daemon --autostart
`$3
`bash
Development environment (port 3456)
export ANTHROPIC_BASE_URL="http://127.0.0.1:3456"
export ANTHROPIC_API_KEY="rcc-router-key"Or release environment (port 8888)
export ANTHROPIC_BASE_URL="http://127.0.0.1:8888"
export ANTHROPIC_API_KEY="rcc-router-key"
`$3
`bash
Check daemon status
rcc status --daemonAccess unified monitoring dashboard
open http://localhost:3456/dual-stats
Or development server: http://localhost:3456/stats
Or release server: http://localhost:8888/stats
`๐๏ธ New CLI Commands (v2.3.0)
$3
`bash
Start dual-config mode (default behavior)
rcc start # Both servers: 3456 + 8888
rcc start --single-config # Single server mode
rcc start --daemon # Background dual-server mode
rcc start --daemon --autostart # Boot-time dual-server startupCheck status
rcc status # Check running servers
rcc status --daemon # Check daemon statusStop services
rcc stop # Stop running servers
rcc stop --daemon # Stop daemon mode
`$3
- โ
Background Operation: Services run independently of terminal
- โ
Auto-Restart: Services restart automatically on failure
- โ
Boot-Time Startup: Services start automatically on system boot
- โ
Process Management: Proper PID management and signal handling
- โ
Log Management: Centralized logging to /tmp/rcc-daemon.log$3
#### Development Server (
config.json)
`json
{
"server": {
"port": 3456,
"host": "0.0.0.0",
"name": "development"
},
"routing": {
"default": {
"providers": [
{"provider": "codewhisperer-primary", "model": "CLAUDE_SONNET_4_20250514_V1_0", "weight": 70},
{"provider": "modelscope-openai", "model": "Qwen/Qwen3-Coder-480B-A35B-Instruct", "weight": 30}
],
"loadBalancing": {"enabled": true, "strategy": "health_based_with_blacklist"},
"failover": {
"enabled": true,
"triggers": [{"type": "http_status", "codes": [429], "blacklistDuration": 300}]
}
}
}
}
`#### Release Server (
config.release.json)
`json
{
"server": {
"port": 8888,
"host": "0.0.0.0",
"name": "release"
},
"routing": {
"default": {
"providers": [
{"provider": "kiro-zcam", "model": "CLAUDE_SONNET_4_20250514_V1_0", "weight": 100}
],
"loadBalancing": {"enabled": false}
}
}
}
`๐ Unified Monitoring Dashboard
$3
Access at http://localhost:3456/dual-stats or http://localhost:8888/dual-statsFeatures:
- ๐ฅ๏ธ Server Comparison: Side-by-side development vs release metrics
- ๐๏ธ Live Model Toggle: Enable/disable models in real-time (non-persistent)
- ๐ Real-time Statistics: Live request counts, success rates, response times
- ๐ Provider Health: Visual status indicators with blacklist information
- โก Instant Updates: 30-second auto-refresh with manual refresh capability
Model Control Features:
- โ
Temporary Toggle: Enable/disable providers without config changes
- ๐ System Recovery: Automatic re-enable after blacklist timeout
- ๐ซ User Override: Manual disable for maintenance or testing
- ๐ Status Indicators: Clear visual feedback (enabled/disabled/blacklisted)
$3
- Development: http://localhost:3456/stats
- Release: http://localhost:8888/statsโ๏ธ Advanced Configuration
$3
`json
{
"routing": {
"longcontext": {
"providers": [
{"provider": "shuaihong-openai", "model": "gemini-2.5-pro", "weight": 40},
{"provider": "gemini-jason-gmail", "model": "gemini-2.5-pro", "weight": 30},
{"provider": "gemini-jason-zcam", "model": "gemini-2.5-pro", "weight": 20},
{"provider": "gemini-nguyentronghuebich", "model": "gemini-2.5-pro", "weight": 10}
],
"loadBalancing": {"enabled": true, "strategy": "health_based_with_blacklist"},
"failover": {
"enabled": true,
"triggers": [{"type": "http_status", "codes": [429], "blacklistDuration": 300}]
}
}
}
}
`$3
#### AWS CodeWhisperer (Enterprise)
`json
{
"codewhisperer-primary": {
"type": "codewhisperer",
"endpoint": "https://codewhisperer.us-east-1.amazonaws.com",
"authentication": {
"type": "bearer",
"credentials": {"tokenPath": "~/.aws/sso/cache/your-token.json"}
},
"models": ["CLAUDE_SONNET_4_20250514_V1_0"],
"defaultModel": "CLAUDE_SONNET_4_20250514_V1_0"
}
}
`#### OpenAI-Compatible (ModelScope, Gemini, etc.)
`json
{
"shuaihong-openai": {
"type": "openai",
"endpoint": "https://ai.shuaihong.fun/v1/chat/completions",
"authentication": {
"type": "bearer",
"credentials": {"apiKey": "sk-your-key-here"}
},
"models": ["gemini-2.5-pro", "gemini-2.5-flash"],
"defaultModel": "gemini-2.5-pro"
}
}
`๐ฏ Intelligent Routing
$3
- background: Haiku models (claude-3-5-haiku-*) โ Fast, lightweight processing
- thinking: thinking=true parameter โ Complex reasoning tasks
- longcontext: Content > 60K tokens โ Extended context handling
- search: Tool definitions present โ Search and function calling
- default: All other requests โ General-purpose routing$3
`
claude-3-5-haiku-20241022 โ background โ gemini-2.5-flash
claude-sonnet-4-20250514 + thinking โ thinking โ CLAUDE_SONNET_4_20250514_V1_0
claude-3-5-sonnet + 70K tokens โ longcontext โ gemini-2.5-pro
claude-sonnet-4-20250514 + tools โ search โ gemini-2.5-flash
claude-sonnet-4-20250514 โ default โ CLAUDE_SONNET_4_20250514_V1_0
`๐ ๏ธ Deployment Options
$3
`bash
Start development with debugging
rcc start --debug --log-level debugAccess development dashboard
open http://localhost:3456/stats
`$3
`bash
Start production daemon with auto-start
rcc start --daemon --autostartMonitor production
rcc status --daemon
open http://localhost:8888/stats
`$3
`bash
Run both development and release servers
rcc start --daemonAccess unified monitoring
open http://localhost:3456/dual-stats
`๐ง Troubleshooting
$3
#### Port Conflicts
`bash
Check port usage
lsof -i :3456
lsof -i :8888Stop conflicting processes
rcc stop --daemon
`#### Configuration Validation
`bash
Validate both configs
rcc config --show ~/.route-claude-code/config.json
rcc config --show ~/.route-claude-code/config.release.jsonTest connectivity
curl http://localhost:3456/health
curl http://localhost:8888/health
`#### Daemon Management
`bash
Check daemon logs
tail -f /tmp/rcc-daemon.logRestart daemon
rcc stop --daemon
rcc start --daemonCheck daemon status
rcc status --daemon
`๐งช Testing
$3
`bash
Set up development environment
export ANTHROPIC_BASE_URL="http://127.0.0.1:3456"
export ANTHROPIC_API_KEY="rcc-router-key"
claude "Test development server"Switch to release environment
export ANTHROPIC_BASE_URL="http://127.0.0.1:8888"
claude "Test release server"Monitor both in dashboard
open http://localhost:3456/dual-stats
`$3
`bash
Generate concurrent requests
for i in {1..10}; do
curl -X POST http://localhost:3456/v1/messages \
-H "Content-Type: application/json" \
-d '{"model": "claude-sonnet-4-20250514", "messages": [{"role": "user", "content": "Test '$i'"}], "max_tokens": 100}' &
doneCheck load distribution
curl http://localhost:3456/api/stats | jq '.providers'
`๐ Version 2.4.0 Changelog
$3
- โ
Cross-Platform Support: Native Windows support with PowerShell daemon scripts
- โ
Intelligent Configuration Detection: Auto-detects single vs dual-config mode
- โ
Enhanced Auto-Start: Boot-time startup for macOS (launchd), Linux (systemd), and Windows (Task Scheduler)
- โ
Windows Daemon Mode: Full daemon support with PowerShell scripts
- โ
Smart Model Routing: Intelligent routing based on configuration files present$3
- โ
Dual-Server Architecture: Simultaneous dev/release server management
- โ
Enhanced Daemon Mode: Proper background process management with auto-restart
- โ
Unified Monitoring Dashboard: Single interface for monitoring both servers
- โ
Temporary Model Toggle: Real-time enable/disable without configuration changes
- โ
Rate Limit Protection: 429 error handling with temporary blacklisting
- โ
Health-Based Load Balancing: Intelligent routing based on provider health$3
- Default Dual-Config: rcc start now defaults to dual-server mode
- Daemon-First Design: Background operation as primary deployment method
- Enhanced CLI: Simplified commands with intelligent defaults
- Process Management: Proper PID handling and signal management
- Configuration Flexibility: Support for both single and dual configurations$3
- Fixed autostart configuration to use dual-config mode by default
- Resolved daemon script signal handling issues
- Corrected model toggle persistence behavior
- Enhanced error handling for port conflicts
- Improved logging and monitoring accuracy๐ License
MIT License - see LICENSE file for details.
๐ Acknowledgments
- AWS CodeWhisperer for enterprise-grade API
- OpenAI for standardized API formats
- Anthropic for Claude and Claude Code
- All contributors and community members
๐ Support
- ๐ Documentation: GitHub Repository
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ Live Monitoring:
http://localhost:3456/dual-stats`---
Made with โค๏ธ for the Claude Code community
RCC v2.4.1 - Cross-platform dual-server architecture with intelligent configuration detection