Skip to content

v0.4.0 — Phase 3: mimicry + sidecar (high-value, fingerprint-sensitive)

Choose a tag to compare

@wjsoj wjsoj released this 24 May 09:47
· 184 commits to main since this release

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/messages body to the CC 2.1.146 3-block system layout, signs cch via xxhash64-with-seed, populates metadata.user_id in 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. kind is mimicry.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).

    • Manager tracks one virtual session per OAuth account. Notify fires 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).