security: close telemetry leak in preconnectAnthropicApi startup path (#1253)
🔒 Security Discovery: Un-gated outbound connection bypasses privacy controls
Summary
preconnectAnthropicApi() unconditionally sends a TCP+TLS handshake to api.anthropic.com on every ccb startup — even when the user has explicitly disabled all non-essential traffic via CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 or DISABLE_TELEMETRY=1.
This is the LAST un-gated outbound connection in the entire startup path. Every other telemetry sink (Sentry, Langfuse, OpenTelemetry, GrowthBook, 1P Event Logger, Datadog, BigQuery, etc.) already respects the privacyLevel module’s isEssentialTrafficOnly() gate. This one did not.
Impact
While the preconnect is a HEAD request with no payload, the connection itself leaks the client’s IP address and session timing to Anthropic’s infrastructure. For privacy-conscious users and enterprise deployments that have disabled telemetry, this constitutes an unexpected data leak.
Fix
Add isEssentialTrafficOnly() check at the function entry, consistent with every other privacy-gated code path in the codebase. The privacyLevel module is already imported by init.ts and 12+ other modules — no new dependencies.
Verification
Reproduced and verified via strace on Linux (aarch64):
Before fix
$ strace -f -e connect ccb -p <<< ‘hello’ connect(16, sin_addr=inet_addr(“160.79.104.10”), sin_port=htons(443)) = 0
↑ connector to api.anthropic.com despite CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
After fix
$ strace -f -e connect ccb -p <<< ‘hello’
↑ zero remote TCP connections — all traffic to localhost only
Changes: 1 file, +5 lines (import + gate)
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Claude Code Best V5 (CCB)
牢 A (Anthropic) 官方 Claude Code 完整复原的工程化项目。虽然很难绷, 但是它叫做 CCB(踩踩背)… 而且, 我们实现了企业版或者需要登陆 Claude 账号才能使用的特性, 并在此基础上扩展了更多好玩的特性。
Peri Code:Claude Code 兼容的 Rust Agent,多年大模型经验匠心制作,国内大模型(DeepSeek/GLM)精调,CPU/内存极致优化,在开发版/树莓派上也能跑 CC 一样的体验。
文档在这里 | 留影文档在这里 | Discord 群组,群主在线答疑
/pipes选择面板 +Shift+↓交互 + 消息广播路由--channels plugin:name@marketplace启用/login)/voice doubao)⚡ 快速开始(安装版)
不用克隆仓库, 从 NPM 下载后, 直接使用
⚡ 快速开始(源码版)
⚙️ 环境要求
一定要最新版本的 bun 啊, 不然一堆奇奇怪怪的 BUG!!! bun upgrade!!!
安装 Bun:
安装后的操作:
让当前终端识别
bun命令安装脚本会把
~/.bun/bin写入对应的 shell 配置文件。macOS 默认 zsh 环境通常会看到:可以按安装脚本提示重启当前 shell:
如果你使用 bash,重新加载 bash 配置:
Windows PowerShell 用户关闭并重新打开 PowerShell 即可。
验证 Bun 是否可用
如果已经安装过 Bun,更新到最新版本
📍 命令执行位置
curl -fsSL https://bun.sh/install | bash、bun --help、bun --version、bun upgradepackage.json的目录。📥 安装
▶️ 运行
构建采用 code splitting 多文件打包(
build.ts),产物输出到dist/目录(入口dist/cli.js+ 约 450 个 chunk 文件)。构建出的版本 bun 和 node 都可以启动, 你 publish 到私有源可以直接启动
如果遇到 bug 请直接提一个 issues, 我们优先解决
👤 新人配置 /login
首次运行后,在 REPL 中输入
/login命令进入登录配置界面,选择 Anthropic Compatible 即可对接第三方 API 兼容服务(无需 Anthropic 官方账号)。 选择 OpenAI 和 Gemini 对应的栏目都是支持相应协议的需要填写的字段:
https://api.example.com/v1sk-xxxclaude-haiku-4-5-20251001claude-sonnet-4-6claude-opus-4-6Feature Flags
所有功能开关通过
FEATURE_<FLAG_NAME>=1环境变量启用,例如:各 Feature 的详细说明见
docs/features/目录,欢迎投稿补充。VS Code 调试
TUI (REPL) 模式需要真实终端,无法直接通过 VS Code launch 启动调试。使用 attach 模式:
步骤
终端启动 inspect 服务:
会输出类似
ws://localhost:8888/xxxxxxxx的地址。VS Code 附着调试器:
src/文件中打断点Teach Me 学习项目
我们新加了一个 teach-me skills, 通过问答式引导帮你理解这个项目的任何模块。(调整 sigma skill 而来)
它能做什么
--resume从上次进度继续学习记录
学习进度保存在
.claude/skills/teach-me/目录下,支持跨主题学习者档案。相关文档及网站
docs/目录,欢迎投稿 PRContributors
Star History
致谢
许可证
本项目仅供学习研究用途。Claude Code 的所有权利归 Anthropic 所有。