Releases: Hoper-J/ccwrap
Release list
v0.1.2
⚠️ npm package renamed:@hoper-j/ccwrap→ccwrap-cli(unscoped)
Install is nownpm i -g ccwrap-cli; the installed command is unchanged — stillccwrap.
If you installed the old package, switch over:npm uninstall -g @hoper-j/ccwrap npm install -g ccwrap-cliThe old
@hoper-j/ccwrappackage will be marked deprecated and won't receive further updates.
This is a packaging & documentation release — ccwrap's own behavior is unchanged, so upgrading is safe.
Changes
- npm package renamed to the unscoped
ccwrap-cli(the unscopedccwrapname is taken by an unrelated project). Platform binaries move to@hoper-j/ccwrap-cli-<os>-<arch>, installed automatically per platform. - Added a contributing guide: CONTRIBUTING.md (English; a Simplified Chinese version is also available).
- Internal: the web dashboard template was extracted to a standalone file embedded via
go:embed(rendered output is byte-identical); release pipeline hardening.
Install
npm install -g ccwrap-cli
# or: install script (downloads a prebuilt binary)
curl -fsSL https://raw.githubusercontent.com/Hoper-J/ccwrap/main/install.sh | sh
# or: via Go
go install github.com/Hoper-J/ccwrap/cmd/ccwrap@latest
⚠️ npm 包已改名:@hoper-j/ccwrap→ccwrap-cli(无 scope)
安装命令现在是npm i -g ccwrap-cli;安装后的命令名不变,仍然是ccwrap。
已经用旧包的用户请改装新包:npm uninstall -g @hoper-j/ccwrap npm install -g ccwrap-cli旧包
@hoper-j/ccwrap将被标记 deprecated,后续不再更新。
本次是一个打包与文档版本,ccwrap 本身的行为没有任何变化,放心升级。
变化
- npm 包改名为无 scope 的
ccwrap-cli(原@hoper-j/ccwrap的无 scope 名ccwrap已被无关项目占用)。各平台二进制包也相应改为@hoper-j/ccwrap-cli-<os>-<arch>,由 npm 自动按平台安装,无需手动指定。 - 新增贡献指南 CONTRIBUTING.md(英文,另有简体中文版)。
- 内部:web 仪表盘模板抽出为独立文件、经
go:embed嵌入(渲染输出逐字节不变);发布流水线加固。
安装
npm install -g ccwrap-cli
# 或:安装脚本(下载预编译二进制)
curl -fsSL https://raw.githubusercontent.com/Hoper-J/ccwrap/main/install.sh | sh
# 或:用 Go 直接装
go install github.com/Hoper-J/ccwrap/cmd/ccwrap@latestv0.1.1
ccwrap 0.1.1 — Claude Code 2.1.198 compatibility fixes and timezone alignment.
Important
If you sign in with a Claude subscription and run Claude Code ≥2.1.198, upgrade. Claude Code 2.1.198 turned CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST into a credential lockdown — with 0.1.0 a first-party (subscription) session launches with no usable credentials and shows "Not logged in", and /login can't recover it. 0.1.1 declares that flag only when ccwrap owns the upstream credential, so subscription login works again.
Fixes
- Claude Code ≥2.1.198 subscription login — the host-managed flag is now injected only when ccwrap supplies the credential; first-party passthrough keeps the child's own keychain OAuth. (2.1.197 and earlier were unaffected.)
- Environment scrubbing realigned to 2.1.198 — the anthropic_aws / mantle / gateway provider families, two base-URL overrides, and the host-auth channel keys are now stripped from the child, so a stray ambient variable can't reroute the session or open a credential path. Fable / custom-model-option keys are carried as model intent; the cert-store and Bedrock service-tier keys are scrubbed.
- No more repeated "custom API key" prompt — the auth placeholder is now stable per profile, so Claude Code's approval sticks after one confirmation instead of re-asking every launch.
New
- Timezone alignment — inject an aligned
TZinto Claude Code (--timezone/CCWRAP_TZ, adds a first-run prompt for China timezones) so the request's "Today's date" matches your locale.
Install / upgrade
npm install -g @hoper-j/ccwrap
# or: curl -fsSL https://raw.githubusercontent.com/Hoper-J/ccwrap/main/install.sh | sh
# or: go install github.com/Hoper-J/ccwrap/cmd/ccwrap@latestccwrap 0.1.1 —— 修复 Claude Code 2.1.198 兼容性问题,新增时区对齐。
Important
用 Claude 订阅账号登录的用户如果版本 ≥2.1.198 需要升级。 Claude Code 2.1.198 把 CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST 变成了凭据锁定——在 0.1.0 下,第一方(订阅)会话启动时会拿不到可用凭据、显示 "Not logged in",且 /login 无法自救。0.1.1 只在 ccwrap 自己提供凭据时才注入该 flag,订阅登录恢复正常。
修复
- Claude Code ≥2.1.198 订阅登录 —— host-managed flag 现在只在 ccwrap 供给凭据时注入;第一方透传保留子进程自己的钥匙串 OAuth。(2.1.197 及更早不受影响。)
- 环境变量清洗对齐 2.1.198 —— anthropic_aws / mantle / gateway 三个 provider 家族、两个 base-URL 覆盖键、host-auth 通道键现在都会从子进程清除,残留的环境变量无法再改道会话或打开凭据通路。Fable / custom-model-option 键作为模型意图保留;cert-store 和 Bedrock service-tier 键被清洗。
- 不再反复弹"custom API key"确认框 —— auth 占位符现在按 profile 固定,Claude Code 确认一次即记住,不再每次启动都问。
新增
- 时区对齐 —— 向 Claude Code 注入对齐的
TZ(--timezone/CCWRAP_TZ,中国时区增加首次运行提示),让请求里的 "Today's date" 与你的本地时区一致。
安装 / 升级
npm install -g @hoper-j/ccwrap
# 或:curl -fsSL https://raw.githubusercontent.com/Hoper-J/ccwrap/main/install.sh | sh
# 或:go install github.com/Hoper-J/ccwrap/cmd/ccwrap@latestChangelog
Features
- cbe0dbb feat(launcher): inject an aligned timezone into the Claude Code child (first-run China-TZ prompt + --timezone/CCWRAP_TZ)
- 1282e07 feat(version): derive dev-build versions from the Go 1.24 VCS stamp
Fixes
- 94175b8 fix(envpolicy): classify Fable/custom-model-option, cert-store, and Bedrock service-tier keys
- 29e61ea fix(envpolicy): scrub the anthropic_aws/mantle/gateway families and the host-auth channel
- b168c2e fix(launcher): make the auth placeholder stable per profile
- 72d6fd8 fix(preflight): only declare CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST when CCWRAP supplies the credential
Others
v0.1.0
ccwrap owns the network boundary between Claude Code and the upstream API — route Claude Code through any Anthropic-compatible gateway while it still believes it's on the first-party path, swap models per provider, and inspect every request and response.
Highlights
- First-party-looking routing — point Claude Code at any Anthropic-compatible gateway without it silently downgrading the request body.
- Model aliases — keep Claude on logical model IDs; rewrite to the provider's model upstream and normalize responses back.
- Third-party cache fix — strip the per-request
cchattestation block for non-claude-*models so prefix/KV caching isn't defeated. - Pinned egress proxy — send the upstream (and telemetry) through a chosen http/socks5 egress.
- Live hot-swap — switch profile or edit model aliases mid-session, no relaunch.
- Native TLS fingerprint — replay Claude Code's own ClientHello upstream (utls) instead of leaking a Go fingerprint.
- Request inspector — read every
/v1/messagesverbatim (system prompts, tool schemas, subagent orchestration) in a local browser UI.
Install
npm install -g @hoper-j/ccwrap
# or: curl -fsSL https://raw.githubusercontent.com/Hoper-J/ccwrap/main/install.sh | sh
# or: go install github.com/Hoper-J/ccwrap/cmd/ccwrap@latestFull docs: https://github.com/Hoper-J/ccwrap
ccwrap 接管 Claude Code 与上游 API 之间的网络边界 —— 把 Claude Code 路由到任意 Anthropic 兼容网关,同时让它以为自己还在第一方路径上,按 provider 替换模型,并检查每一条请求与响应。
特性
- 第一方伪装路由 —— 把 Claude Code 指到任意 Anthropic 兼容网关,不会因第一方判定没过就静默降级请求体。
- 模型别名 —— 本地只暴露 Claude model id,上游改写成 provider 的模型、响应再归一化回来。
- 修复第三方缓存 —— 为非
claude-*模型去掉每次都变的cch计费 block,避免破坏上游 prefix/KV 缓存。 - 固定出口代理 —— 让上游(及遥测)走指定的 http/socks5 网络出口。
- 配置热切换 —— 会话中途切 profile / 改别名,立即生效、无需重启。
- 保持原生 TLS 指纹 —— 用 utls 把 Claude Code 自己的 ClientHello 原样复刻到上游,而不是漏出 Go 指纹。
- 请求检查器 —— 在本地浏览器里逐字读每条
/v1/messages(system prompt、tool schema、派生 subagent 的编排提示词)。
安装
npm install -g @hoper-j/ccwrap
# 或:curl -fsSL https://raw.githubusercontent.com/Hoper-J/ccwrap/main/install.sh | sh
# 或:go install github.com/Hoper-J/ccwrap/cmd/ccwrap@latest