Subscription Pooling
Kage supports registering multiple Claude Code subscriptions to enable parallel productivity scaling. This allows you to run multiple agents simultaneously, each using a different subscription to avoid rate limits.
Why Multiple Subscriptions?
A single Claude Code subscription has usage limits. When you hit those limits, you need to wait before continuing work. With subscription pooling, Kage automatically routes requests across multiple subscriptions, giving you:
- Parallel scaling — Run more agents simultaneously
- Rate limit avoidance — Rotate to available subscriptions when one hits limits
- Failover — Automatic fallback when a subscription becomes unavailable
- Usage tracking — Per-subscription metrics for cost management
How It Works
┌─────────────────────────────────────────────────────────┐
│ Subscription Pool │
├─────────────────────────────────────────────────────────┤
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Sub 1 │ │ Sub 2 │ │ Sub 3 │ ... │
│ │ Active │ │ Active │ │ Rate │ │
│ │ Pri: 150 │ │ Pri: 100 │ │ Limited │ │
│ └────┬─────┘ └────┬─────┘ └──────────┘ │
│ │ │ │
│ └──────┬──────┘ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Load Balancer │ │
│ │ (Priority + │ │
│ │ Health-aware) │ │
│ └────────┬────────┘ │
└──────────────┼──────────────────────────────────────────┘
▼
Agent Requests
Subscription Selection
When an agent needs to make a request, Kage selects a subscription based on:
- Health status — Only active, healthy subscriptions are considered
- Priority — Higher priority (0-255) subscriptions are preferred
- Tags — Routing rules can direct specific namespaces to specific subscriptions
- Rate limits — Subscriptions approaching limits are deprioritized
Subscription States
| State | Description |
|---|---|
active | Healthy and available for requests |
rate_limited | Hit rate limit, will auto-recover after cooldown |
exhausted | Quota exhausted, waiting for reset |
disabled | Manually disabled by user |
unhealthy | Experiencing errors, temporarily removed from pool |
Adding Subscriptions
# Add a subscription with default settings
# Add a high-priority subscription
# Add a tagged subscription for specific routing
When adding a subscription, you’ll be prompted to enter the API credentials securely. Credentials are stored in your OS keychain, never in plain text.
Routing Configuration
You can configure routing rules to direct specific workloads to specific subscriptions.
By Namespace
Route all agents in a namespace to specific subscriptions:
By Priority Level
Route high-priority tasks to premium subscriptions:
# High-priority tasks get premium subscriptions
# Batch/background work uses lower-tier subscriptions
Monitoring
Pool Status
Shows an overview of all subscriptions:
Subscription Pool Status
========================
Active: 3/4
Rate Limited: 1
Total Usage: 45,230 tokens today
┌──────────────────┬──────────┬──────────┬─────────────┐
│ Name │ Status │ Priority │ Today Usage │
├──────────────────┼──────────┼──────────┼─────────────┤
│ work-premium │ active │ 150 │ 12,450 │
│ personal │ active │ 100 │ 18,200 │
│ backend-dedicated│ active │ 120 │ 14,580 │
│ overflow │ rate_ltd │ 50 │ — │
└──────────────────┴──────────┴──────────┴─────────────┘
Usage Statistics
# Weekly usage
# Usage for specific subscription
Best Practices
Subscription Naming
Use descriptive names that indicate the subscription’s purpose:
# Good
# Avoid
Priority Strategy
- 150-255: Premium/emergency subscriptions
- 100-149: Primary work subscriptions
- 50-99: Secondary/overflow subscriptions
- 0-49: Batch/background work
Tag-Based Routing
Use tags to create logical groups:
# Security-sensitive work uses audited subscriptions
Handling Rate Limits
When a subscription hits rate limits:
- Kage automatically routes to the next available subscription
- The rate-limited subscription enters cooldown
- After cooldown, it automatically rejoins the pool
You don’t need to manually intervene unless all subscriptions are rate-limited.
Configuration File
Subscriptions can also be configured in ~/.config/kage/config.toml:
[]
# Default routing priority
= "round-robin" # or "priority", "least-used"
# Rate limit settings
= "1m"
= "5m"
[]
# Namespace-specific routing
= ["backend-dedicated", "work-premium"]
= ["frontend-1", "personal"]
# Priority-level routing
= ["premium-1", "premium-2"]
= ["batch-1", "batch-2"]