Summary
cc-mirror creates isolated Claude Code instances with custom providers (Z.ai, Kimi, OpenRouter, etc.), each storing session data under its own config dir — completely separate from ~/.claude/. All cc-mirror usage is currently invisible to Tokscale.
What exists locally
~/.cc-mirror/
├── <variant>/
│ ├── variant.json ← name, provider, baseUrl, configDir
│ └── config/
│ └── projects/ ← session .jsonl files
└── .cache/
variant.json example:
{
"name": "zaicc",
"provider": "zai",
"baseUrl": "https://api.z.ai/api/anthropic",
"configDir": "/Users/.../.cc-mirror/zaicc/config"
}
Session .jsonl files under <configDir>/projects/ are identical in schema to ~/.claude/projects/ — full token fields present and verified:
"usage":{"input_tokens":15945,"cache_creation_input_tokens":0,"cache_read_input_tokens":11584,"output_tokens":84,...}
Why it's straightforward
Discovery is deterministic:
- Glob
~/.cc-mirror/*/variant.json
- Read
configDir from each
- Run the existing Claude Code JSONL parser on
<configDir>/projects/
- Tag usage with
provider + name from variant.json
No new parser needed — just path remapping with provider attribution.
Proposed v1 scope
- Auto-discover variants via
~/.cc-mirror/*/variant.json on startup
- Reuse Claude Code parser on each variant's
configDir
- Report each variant as a distinct row (e.g.
cc-mirror/zaicc) since providers have different pricing
- Show discovered variants in
tokscale clients diagnostics
Complication: model name aliasing
cc-mirror sessions use provider-specific model aliases ("glm-5.1", "opus", "sonnet") rather than canonical Claude model IDs. Cost attribution via LiteLLM/OpenRouter may need the provider + baseUrl from variant.json to resolve pricing correctly, especially for non-Anthropic providers like Z.ai.
Non-goals for v1
- No deduplication with
~/.claude/ (no overlap — fully isolated config dirs)
- No parsing of cc-mirror theme/prompt-pack config
- No support for arbitrary
CLAUDE_CONFIG_DIR overrides outside ~/.cc-mirror/
Open questions
- Should each variant be a distinct client or sub-rows under a
cc-mirror parent?
- When
baseUrl is OpenRouter-compatible, can the existing OpenRouter pricing fallback apply?
Context
Verified on macOS against an active zaicc (Z.ai) variant. cc-mirror is commonly used by developers running alternative providers alongside their primary ~/.claude/ setup — a non-trivial slice of Claude Code users whose usage Tokscale currently cannot see at all.
Summary
cc-mirror creates isolated Claude Code instances with custom providers (Z.ai, Kimi, OpenRouter, etc.), each storing session data under its own config dir — completely separate from
~/.claude/. All cc-mirror usage is currently invisible to Tokscale.What exists locally
variant.jsonexample:{ "name": "zaicc", "provider": "zai", "baseUrl": "https://api.z.ai/api/anthropic", "configDir": "/Users/.../.cc-mirror/zaicc/config" }Session
.jsonlfiles under<configDir>/projects/are identical in schema to~/.claude/projects/— full token fields present and verified:Why it's straightforward
Discovery is deterministic:
~/.cc-mirror/*/variant.jsonconfigDirfrom each<configDir>/projects/provider+namefromvariant.jsonNo new parser needed — just path remapping with provider attribution.
Proposed v1 scope
~/.cc-mirror/*/variant.jsonon startupconfigDircc-mirror/zaicc) since providers have different pricingtokscale clientsdiagnosticsComplication: model name aliasing
cc-mirror sessions use provider-specific model aliases (
"glm-5.1","opus","sonnet") rather than canonical Claude model IDs. Cost attribution via LiteLLM/OpenRouter may need theprovider+baseUrlfromvariant.jsonto resolve pricing correctly, especially for non-Anthropic providers like Z.ai.Non-goals for v1
~/.claude/(no overlap — fully isolated config dirs)CLAUDE_CONFIG_DIRoverrides outside~/.cc-mirror/Open questions
cc-mirrorparent?baseUrlis OpenRouter-compatible, can the existing OpenRouter pricing fallback apply?Context
Verified on macOS against an active
zaicc(Z.ai) variant. cc-mirror is commonly used by developers running alternative providers alongside their primary~/.claude/setup — a non-trivial slice of Claude Code users whose usage Tokscale currently cannot see at all.