VioletScar-Hui

Claude Account Guard — Security skill for Claude Code

Security community

Claude Code 本机环境体检与自动清理(macOS):出口 IP 与 ASN 类型、系统代理残留、DNS 与 WebRTC 泄漏、IPv6、时区两道闸、settings.json 里的中转端点与凭据、失效权限条目.

How to install Claude Account Guard

This entry records only its repository, not the path inside it, so there is no exact command to give. Open VioletScar-Hui/claude-account-guard and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Account Guard does

Claude Code 本机环境体检与自动清理(macOS):出口 IP 与 ASN 类型、系统代理残留、DNS 与 WebRTC 泄漏、IPv6、时区两道闸、settings.json 里的中转端点与凭据、失效权限条目。25 项只读体检 + 十类可逆清理,改前先备份,零依赖。Audit and clean a Claude Code environment on macOS: exit IP, proxy residue, DNS/WebRTC leaks, timezone, endpoint leftovers.

Alternatives in Security

  • Octoboss Clean Contexts — You are the Octoboss — a cross-tentacle orchestrator 1.4k ★
  • Dotclaude — A comprehensive development environment with specialized AI agents for code review, security analysis, and tec 435 ★
  • Agent Skills Guard — 一款提供Agent Skills安全扫描和可视化管理的桌面应用 A desktop application that provides security scanning and visual management fo 389 ★

README

claude-account-guard

Claude Code 本机环境体检与自动清理 · macOS · Python 标准库 · 零依赖

一条命令把本机跟 Claude Code 有关的环境查一遍(25 项),再把其中可以安全清理的残留清掉(十类,幂等、可逆、改前先备份)。

**English** — claude-account-guard is a macOS command-line tool that audits and cleans the local environment around Claude Code: exit IP and ASN type, proxy residue, DNS and WebRTC leaks, IPv6 leaks, timezone layers, third-party endpoint leftovers in `settings.json`, telemetry switches, CLI signature integrity, stale permission entries and project-level junk. The audit is read-only; cleaning is idempotent, reversible, and always preceded by a backup.

git clone https://github.com/VioletScar-Hui/claude-account-guard.git
cd claude-account-guard && python3 scripts/account_guard.py --audit

什么时候用它

  • 登录 Claude 之前,想确认本机环境是干净的
  • 换了代理或节点之后,确认出口 IP、DNS、WebRTC 都没有泄漏
  • 排查过 DNS 泄漏、WebRTC 泄漏,或者发现系统代理被反复回填
  • 账号被风控或封禁之后,换环境之前做一次排查
  • 日常巡检:时区、遥测开关、权限条目、可回收的缓存

它想回答的是这类问题:我的 Claude Code 环境干净吗?我的真实 IP 会不会泄漏给网站?我的出口是住宅还是机房?系统代理有没有残留?DNS 有没有被交给国内解析器?时区对不对?`settings.json` 里有没有指向第三方中转的端点?

它查哪 25 项

网络身份:出口 IP 与归属、出口的 ASN 类型(住宅还是机房)、出口是否和上一次一致、DNS 有没有落到国内解析器、WebRTC 在拿到摄像头权限后会不会露出真实 IP、IPv6 有没有绕过隧道、Claude 域名会不会走到直连。

代理链路:系统代理里有没有未启用却存着值的残留、终端与 shell 配置里的代理、npm 与 git 的全局代理、Clash 的规则模式与 DNS 配置。

账号环境:时区分层与那两道闸、浏览器 Intl 区域设置、浏览器资料有没有和日常混用、本机有没有多账号痕迹、钥匙串里的凭据条目、时区与出口与语言是否自相矛盾。

Claude Code 自身:`settings.json` 里有没有指向第三方中转的端点与凭据、遥测三键、有没有装第三方客户端、CLI 二进制有没有被改过(走官方签名验签,不是比版本号)。

环境卫生:项目级 `.claude` 的规模、过期的工作树注册、系统级可回收的体积、项目级 `settings.json` 里已经失效的权限条目、代码有没有落在本地 Git。

快速开始:只读体检

python3 scripts/account_guard.py --audit

只读,不改任何文件。出一张 25 项的表,末尾给出完整 JSON 报告的路径。第一次用建议就停在这一步。

一键自检:

python3 scripts/selfcheck.py

把语法编译、单元测试、LaunchAgent、Clash 内核状态、系统代理四开关、完整环境体检串成七项,跑完出两张表。加 `--fast` 跳过单测(约 20 秒)。

完整加固(会改状态)

python3 scripts/account_guard.py

需要真实终端,先列出「最终执行清单」,输入 `CONFIRM` 才开始,整个过程只输一次 sudo 密码。

自动清的十类,不再逐项问:

  1. 系统代理残留——只清 Enabled: No 却存着值的那些,正在启用的整条跳过
  2. shell 配置(.zshrc / .zprofile / `.profi