Repository navigation
v0.4.0 — Phase 3: mimicry + sidecar (high-value, fingerprint-sensitive)
Pulls the two CC-fingerprint-heavy packages out of CPA-Claude internal/server/ so any fork can present as a real Claude Code client without re-implementing the body/header dance.
New packages
-
mimicry— header + body Claude Code mimicry.ApplyClaudeCodeBodyMimicry: rewrites/v1/messagesbody to the CC 2.1.146 3-block system layout, signscchvia xxhash64-with-seed, populatesmetadata.user_idin the CC ≥ 2.1.78 JSON shape. Skipped on Haiku and on bodies already looking like real CC.ApplyClaudeCodeHeaders: pinned UA / X-Stainless / Anthropic-Beta / X-App / session-id headers.kindismimicry.KindOAuth/mimicry.KindAPIKey(plain strings — no auth-package coupling).SimIdentity+DeviceIDFor/SessionIDFor/BuildJSONUserID— content-addressed identity helpers so device_id, session_id, and metadata.user_id agree across headers and body.- Constants
CLICurrentVersion,ClaudeCLIUserAgent,ClaudeAnthropicBetaFull, ... pinned to CC 2.1.146. - 8 golden tests verifying invariants captured in
crack/oauth/rows/17.
-
sidecar— full sidecar Manager pulled wholesale (1278 LOC).Managertracks one virtual session per OAuth account.Notifyfires the 9-step CC bootstrap, quota probe, event_logging heartbeat. Datadog phase intentionally left disabled.Config{Enabled, UseUTLS, BaseURL}exported.- Re-uses
mimicry.*constants — bumping CC version is a one-place change. - 8 tests pass at 23s wall-clock (real bootstrap+heartbeat timing).