claude-sonar 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. claude_sonar-1.0.0/LICENSE +21 -0
  2. claude_sonar-1.0.0/PKG-INFO +210 -0
  3. claude_sonar-1.0.0/README.md +188 -0
  4. claude_sonar-1.0.0/README.zh-CN.md +194 -0
  5. claude_sonar-1.0.0/SKILL.md +321 -0
  6. claude_sonar-1.0.0/assets/social-preview.en.jpg +0 -0
  7. claude_sonar-1.0.0/assets/social-preview.jpg +0 -0
  8. claude_sonar-1.0.0/claude_sonar/__init__.py +104 -0
  9. claude_sonar-1.0.0/claude_sonar/__main__.py +387 -0
  10. claude_sonar-1.0.0/claude_sonar/__version__.py +1 -0
  11. claude_sonar-1.0.0/claude_sonar/analysis/__init__.py +21 -0
  12. claude_sonar-1.0.0/claude_sonar/analysis/browser.py +41 -0
  13. claude_sonar-1.0.0/claude_sonar/analysis/common.py +95 -0
  14. claude_sonar-1.0.0/claude_sonar/analysis/mihomo.py +306 -0
  15. claude_sonar-1.0.0/claude_sonar/analysis/privacy.py +207 -0
  16. claude_sonar-1.0.0/claude_sonar/analysis/system.py +1057 -0
  17. claude_sonar-1.0.0/claude_sonar/analyze.py +346 -0
  18. claude_sonar-1.0.0/claude_sonar/badge.py +140 -0
  19. claude_sonar-1.0.0/claude_sonar/collectors/__init__.py +1 -0
  20. claude_sonar-1.0.0/claude_sonar/collectors/posix.py +107 -0
  21. claude_sonar-1.0.0/claude_sonar/diff.py +292 -0
  22. claude_sonar-1.0.0/claude_sonar/models.py +77 -0
  23. claude_sonar-1.0.0/claude_sonar/personalize.py +621 -0
  24. claude_sonar-1.0.0/claude_sonar/probes/__init__.py +3 -0
  25. claude_sonar-1.0.0/claude_sonar/probes/base.py +177 -0
  26. claude_sonar-1.0.0/claude_sonar/probes/baseurl_probe.py +373 -0
  27. claude_sonar-1.0.0/claude_sonar/probes/cross_site.py +155 -0
  28. claude_sonar-1.0.0/claude_sonar/probes/dns_egress_probe.py +186 -0
  29. claude_sonar-1.0.0/claude_sonar/probes/dns_probe.py +232 -0
  30. claude_sonar-1.0.0/claude_sonar/probes/egress.py +321 -0
  31. claude_sonar-1.0.0/claude_sonar/probes/endpoints.py +23 -0
  32. claude_sonar-1.0.0/claude_sonar/probes/http_probe.py +100 -0
  33. claude_sonar-1.0.0/claude_sonar/probes/ja4_probe.py +360 -0
  34. claude_sonar-1.0.0/claude_sonar/probes/proxy_detector.py +38 -0
  35. claude_sonar-1.0.0/claude_sonar/probes/reputation.py +263 -0
  36. claude_sonar-1.0.0/claude_sonar/probes/runtime_probe.py +36 -0
  37. claude_sonar-1.0.0/claude_sonar/probes/safety.py +133 -0
  38. claude_sonar-1.0.0/claude_sonar/probes/stability.py +195 -0
  39. claude_sonar-1.0.0/claude_sonar/probes/webrtc_guide.py +75 -0
  40. claude_sonar-1.0.0/claude_sonar/redaction.py +220 -0
  41. claude_sonar-1.0.0/claude_sonar/report.py +1692 -0
  42. claude_sonar-1.0.0/claude_sonar/reposcan/__init__.py +54 -0
  43. claude_sonar-1.0.0/claude_sonar/reposcan/baseline.py +67 -0
  44. claude_sonar-1.0.0/claude_sonar/reposcan/models.py +147 -0
  45. claude_sonar-1.0.0/claude_sonar/reposcan/report.py +194 -0
  46. claude_sonar-1.0.0/claude_sonar/reposcan/rules.py +66 -0
  47. claude_sonar-1.0.0/claude_sonar/reposcan/sarif.py +91 -0
  48. claude_sonar-1.0.0/claude_sonar/reposcan/scanner.py +173 -0
  49. claude_sonar-1.0.0/claude_sonar/reposcan/scoring.py +60 -0
  50. claude_sonar-1.0.0/claude_sonar/reposcan/stack.py +159 -0
  51. claude_sonar-1.0.0/claude_sonar/reposcan/suggest.py +51 -0
  52. claude_sonar-1.0.0/claude_sonar/reposcan/tools.py +686 -0
  53. claude_sonar-1.0.0/claude_sonar/resources/known_baseurl_blacklist.txt +147 -0
  54. claude_sonar-1.0.0/claude_sonar/resources/semgrep_rules/NOTICE.md +30 -0
  55. claude_sonar-1.0.0/claude_sonar/resources/semgrep_rules/csharp.yaml +173 -0
  56. claude_sonar-1.0.0/claude_sonar/resources/semgrep_rules/go.yaml +149 -0
  57. claude_sonar-1.0.0/claude_sonar/resources/semgrep_rules/java.yaml +156 -0
  58. claude_sonar-1.0.0/claude_sonar/resources/semgrep_rules/javascript.yaml +156 -0
  59. claude_sonar-1.0.0/claude_sonar/resources/semgrep_rules/php.yaml +146 -0
  60. claude_sonar-1.0.0/claude_sonar/resources/semgrep_rules/python.yaml +181 -0
  61. claude_sonar-1.0.0/claude_sonar/resources/semgrep_rules/ruby.yaml +152 -0
  62. claude_sonar-1.0.0/claude_sonar/resources/semgrep_rules/rust.yaml +137 -0
  63. claude_sonar-1.0.0/claude_sonar/resources.py +16 -0
  64. claude_sonar-1.0.0/claude_sonar/schema.py +53 -0
  65. claude_sonar-1.0.0/claude_sonar/serve.py +470 -0
  66. claude_sonar-1.0.0/claude_sonar.egg-info/PKG-INFO +210 -0
  67. claude_sonar-1.0.0/claude_sonar.egg-info/SOURCES.txt +107 -0
  68. claude_sonar-1.0.0/claude_sonar.egg-info/dependency_links.txt +1 -0
  69. claude_sonar-1.0.0/claude_sonar.egg-info/top_level.txt +1 -0
  70. claude_sonar-1.0.0/pyproject.toml +51 -0
  71. claude_sonar-1.0.0/scripts/collect_posix_network.py +7 -0
  72. claude_sonar-1.0.0/scripts/collect_windows_network.ps1 +1111 -0
  73. claude_sonar-1.0.0/scripts/remediate_posix_network.py +130 -0
  74. claude_sonar-1.0.0/scripts/remediate_windows_network.ps1 +77 -0
  75. claude_sonar-1.0.0/setup.cfg +4 -0
  76. claude_sonar-1.0.0/static/panel.html +523 -0
  77. claude_sonar-1.0.0/tests/test_advanced_network_checks.py +151 -0
  78. claude_sonar-1.0.0/tests/test_analyze.py +56 -0
  79. claude_sonar-1.0.0/tests/test_audit_diff.py +142 -0
  80. claude_sonar-1.0.0/tests/test_badge.py +113 -0
  81. claude_sonar-1.0.0/tests/test_cli.py +329 -0
  82. claude_sonar-1.0.0/tests/test_encrypted_dns.py +111 -0
  83. claude_sonar-1.0.0/tests/test_golden_snapshot.py +78 -0
  84. claude_sonar-1.0.0/tests/test_intended_mode.py +205 -0
  85. claude_sonar-1.0.0/tests/test_netdims.py +310 -0
  86. claude_sonar-1.0.0/tests/test_online_parallel.py +224 -0
  87. claude_sonar-1.0.0/tests/test_online_probes.py +271 -0
  88. claude_sonar-1.0.0/tests/test_online_probes_ext.py +302 -0
  89. claude_sonar-1.0.0/tests/test_personalize_cli.py +86 -0
  90. claude_sonar-1.0.0/tests/test_personalize_fixes.py +62 -0
  91. claude_sonar-1.0.0/tests/test_posix_collector.py +58 -0
  92. claude_sonar-1.0.0/tests/test_privacy.py +74 -0
  93. claude_sonar-1.0.0/tests/test_privacy_artifacts.py +60 -0
  94. claude_sonar-1.0.0/tests/test_privacy_fold.py +70 -0
  95. claude_sonar-1.0.0/tests/test_probes_smoke.py +35 -0
  96. claude_sonar-1.0.0/tests/test_redaction.py +106 -0
  97. claude_sonar-1.0.0/tests/test_report_format.py +224 -0
  98. claude_sonar-1.0.0/tests/test_report_i18n.py +176 -0
  99. claude_sonar-1.0.0/tests/test_report_plain.py +124 -0
  100. claude_sonar-1.0.0/tests/test_report_schema.py +39 -0
  101. claude_sonar-1.0.0/tests/test_reposcan_core.py +185 -0
  102. claude_sonar-1.0.0/tests/test_reposcan_endtoend.py +200 -0
  103. claude_sonar-1.0.0/tests/test_reposcan_freshness.py +145 -0
  104. claude_sonar-1.0.0/tests/test_reposcan_report.py +133 -0
  105. claude_sonar-1.0.0/tests/test_reposcan_stack.py +113 -0
  106. claude_sonar-1.0.0/tests/test_reposcan_tools.py +301 -0
  107. claude_sonar-1.0.0/tests/test_serve_panel.py +373 -0
  108. claude_sonar-1.0.0/tests/test_system_checks.py +191 -0
  109. claude_sonar-1.0.0/tests/test_system_proxy_consistency.py +245 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AschoofAlpha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: claude-sonar
3
+ Version: 1.0.0
4
+ Summary: Local privacy and proxy consistency audit for Claude Code and agent skills
5
+ Author: Claude Shield Authors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/AschoofAlpha/claude-sonar
8
+ Project-URL: Repository, https://github.com/AschoofAlpha/claude-sonar
9
+ Project-URL: Issues, https://github.com/AschoofAlpha/claude-sonar/issues
10
+ Project-URL: Changelog, https://github.com/AschoofAlpha/claude-sonar/blob/main/CHANGELOG.md
11
+ Keywords: claude,privacy,proxy,dns-leak,mihomo,audit,agent-skills
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Operating System :: POSIX
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Security
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Dynamic: license-file
22
+
23
+ <p align="center">
24
+ <img src="https://raw.githubusercontent.com/AschoofAlpha/claude-sonar/main/assets/social-preview.en.jpg" alt="Claude Sonar — local-first privacy and proxy audit" width="100%">
25
+ </p>
26
+
27
+ <h1 align="center">Claude Sonar</h1>
28
+
29
+ <p align="center"><strong>Local-first privacy and proxy-consistency audit for Claude Code and Agent Skills hosts.</strong></p>
30
+
31
+ <p align="center">
32
+ <img src="https://img.shields.io/github/actions/workflow/status/AschoofAlpha/claude-sonar/ci.yml?style=flat-square&label=CI" alt="CI">
33
+ <img src="https://img.shields.io/badge/version-1.0.0-2DD4BF?style=flat-square" alt="v1.0.0">
34
+ <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FAschoofAlpha%2Fclaude-sonar%2Fmain%2Fsonar-badge.json&query=%24.message&label=配置自洽分&color=2DD4BF" alt="配置自洽分">
35
+ <img src="https://img.shields.io/badge/default-read--only-2DD4BF?style=flat-square" alt="Read-only by default">
36
+ <img src="https://img.shields.io/badge/platform-Windows-4F7CFF?style=flat-square" alt="Windows">
37
+ <img src="https://img.shields.io/badge/license-MIT-64748B?style=flat-square" alt="MIT License">
38
+ </p>
39
+
40
+ <p align="center"><a href="README.zh-CN.md">简体中文</a> · <a href="SKILL.md">Skill instructions</a> · <a href="LICENSE">MIT License</a></p>
41
+
42
+ > **How is your Claude account doing lately?**
43
+ >
44
+ > If you use Claude from China, chances are you've seen these before:
45
+ >
46
+ > - You paid for Pro, and days later the account simply won't sign in
47
+ > - Months of conversations and project context, gone overnight with the account
48
+ > - Your appeal email vanished into a black hole
49
+ > - You registered a fresh account with a new email — banned again before you could really use it
50
+ > - You ask perfectly normal questions, yet keep getting flagged as "high risk"
51
+ >
52
+ > It's probably not bad luck — it's the road your traffic takes. You think everything goes through your proxy, but actually: a DNS lookup quietly asks your home broadband first, a "backup tunnel" connects directly without the proxy, a small WebRTC backdoor lets websites see your real network address, or your proxy node randomly hops between countries at 3am.
53
+ >
54
+ > **Every one of these leaks tells the platform "something's off."** Accounts get flagged, challenged, even banned — often not because of what you say, but because of these details exposing you. And the worst part: none of it hurts until the ban screen shows up.
55
+ >
56
+ > Claude Sonar is the tool that checks those details for you — **a read-only checkup that touches nothing**:
57
+ >
58
+ > - **Traffic routing**: where does your data actually leave from, and is anything slipping past the proxy?
59
+ > - **Domain lookups**: when you type a URL, does the query secretly take a detour it shouldn't?
60
+ > - **Proxy setup**: are your nodes auto-switching countries, and are your routing rules still working?
61
+ > - **System state**: do your timezone, language, and privacy toggles fight each other?
62
+ >
63
+ > When the checkup finishes, you get a **clear report** — every item labeled: **Must fix** (a real problem), **Optional consistency** (not a risk, but worth aligning), **Leave alone** (don't touch it). At the top sits your **configuration self-consistency score** (simply put: do your settings contradict each other), at a glance.
64
+ >
65
+ > Then the decision is **entirely yours** — nothing changes without your explicit approval.
66
+ >
67
+ > And here's what this tool **won't do**:
68
+ >
69
+ > - It won't help you **impersonate someone else** (no fingerprint spoofing, no hiding automation)
70
+ > - It won't help you **fabricate identity** (no fake addresses, billing, or personal info)
71
+ > - It will never **guarantee** "this config means you'll never get banned" — anyone who promises that is lying to you.
72
+ >
73
+ > The "anti-ban" tools teach you to fool the platform. Claude Sonar does one thing: **show you the truth**, and give you back the choice.
74
+ >
75
+ > **Audit first. Decide after.** Your account deserves one honest check.
76
+
77
+ ## Install
78
+
79
+ ```bash
80
+ pip install -U claude-sonar
81
+ ```
82
+
83
+ Requires **1.4.0+** for CLI `--out` / `--diff` / `--compact` / `--intended-mode` and parallel online probes.
84
+ **1.3.3+** already includes the plain-language report, consistency score, and proxy-layer checks.
85
+ Legacy package **`anti-claude-check`** is retired — use **`claude-sonar`** only.
86
+
87
+
88
+ As an agent skill (Codex / Claude Code):
89
+
90
+ ```powershell
91
+ git clone https://github.com/AschoofAlpha/claude-sonar.git "$HOME/.codex/skills/claude-sonar"
92
+ ```
93
+
94
+ Invoke `$claude-sonar` in Codex. For Claude Code, install the same folder as `~/.claude/skills/claude-sonar` and invoke `/claude-sonar`.
95
+
96
+ ## CLI (1.4)
97
+
98
+ ```bash
99
+ python -m claude_sonar # full markdown report (offline)
100
+ python -m claude_sonar --compact # shorter markdown (score + must-fix / optional)
101
+ python -m claude_sonar --json # report_dict + summary as JSON
102
+ python -m claude_sonar --out report.md
103
+ python -m claude_sonar --json --out report.json
104
+ python -m claude_sonar --diff previous.json
105
+ python -m claude_sonar --online --timeout 5
106
+ python -m claude_sonar --online --intended-region US
107
+ python -m claude_sonar --intended-mode system_proxy # or full_tunnel
108
+ python -m claude_sonar --lang en
109
+ python -m claude_sonar serve --port 8765 # read-only local web panel on 127.0.0.1
110
+ python -m claude_sonar repo ./my-project # code security scan (SAST/secrets/deps)
111
+ python -m claude_sonar badge # write sonar-badge.json from an audit
112
+ ```
113
+
114
+ Sub-commands (same `python -m claude_sonar` entry point):
115
+
116
+ - **`serve [--port N] [--open]`** — zero-dependency local web panel bound to **127.0.0.1 only**. `/` renders the audit (score, Must fix / Optional / Leave alone groups), `/api/report?online=0` returns the redacted report JSON (online probes stay off unless you opt in), plus a browser-side observation block (WebRTC ICE candidates, local timezone/language). Read-only: POST is 405, path traversal is 404, only loopback `Host` headers are accepted.
117
+ - **`repo PATH [--no-tools] [--baseline F] [--json] [--sarif F] [--out F]`** — repository security scan: stack detection, semgrep / gitleaks / pip-audit / npm audit / freshness (npm outdated, pip list --outdated) orchestration with graceful degradation (missing tools are skipped and noted), bundled trimmed Semgrep rules (MIT source noted), weighted 0–100 code-security score, fix suggestions, baseline diff, SARIF 2.1.0 export. No pentesting, no GitHub-issue filing.
118
+ - **`badge [--out PATH] [--from-report F]`** — writes `sonar-badge.json` (score + color) for the shields.io dynamic badge below; `--from-report` reuses a previous `--json` report instead of re-auditing.
119
+
120
+ Online probes (egress, DNS observation, IP reputation, cross-site exits, **DNS-vs-HTTP exit consistency**, **JA3/JA4 TLS fingerprint**) stay **off** unless you pass `--online`. With `--online`, independent probes run in parallel (shared timeout). The `ANTHROPIC_BASE_URL` audit (official endpoint vs a bundled public risk-intel blacklist) always runs offline.
121
+
122
+ `--out` writes the report to a file **and** still prints to stdout. `--diff` accepts a previous CLI `--json` payload or bare `report_dict` and appends a status-diff section (or a `diff` key in JSON mode). Default markdown is full; pass `--compact` for a short report (`--full` forces full if both are set).
123
+
124
+ Library defaults: `run_full_audit(include_recommendations=True)` returns `report_markdown` via `format_report`. Windows collector also reports Firefox WebRTC policy presence when detectable.
125
+
126
+ ## What you get
127
+
128
+ | Layer | Checks |
129
+ | --- | --- |
130
+ | Claude privacy | 3 main opt-out switches + 6 supplemental vars + local artifact presence |
131
+ | Proxy | system proxy / WinHTTP / env vars / PAC / other-client conflicts |
132
+ | DNS | fake-IP, port-53 hijack, DoH, physical-resolver residue, browser Secure DNS |
133
+ | Routing | TUN, default route, Teredo, IPv6 bypass |
134
+ | Consistency | timezone × locale × (online) exit region |
135
+ | Personalized | detects your proxy client (Clash Verge / v2rayN / sing-box / …) and gives per-app manual steps |
136
+ | Online (opt-in) | DNS-vs-HTTP exit consistency (DoH), JA3/JA4 TLS client fingerprint (openssl capture) |
137
+ | Always-on | `ANTHROPIC_BASE_URL` audit vs a bundled public relay-risk blacklist |
138
+ | Local panel | `serve` — 127.0.0.1 read-only panel + browser-side WebRTC/timezone observation |
139
+ | Repo scan | `repo` — SAST / secrets / dependency audit with a 0–100 code-security score |
140
+ | Badge | `badge` — `sonar-badge.json` driving a shields.io dynamic badge |
141
+
142
+ Results split into **Must fix**, **Optional consistency**, and **Leave alone**; every check carries a plain-language **说明/meaning** column and the report ends with a **configuration self-consistency** score (not anti-ban) plus a footer of what stays **recommend-only never auto** (fingerprint, timezone-follow-node, env wipe, anti-ban score disguise, DNS/route/TUN).
143
+
144
+ Optional, reversible privacy environment-variable remediation only. No automatic DNS, route, firewall, VPN, or IPv6-adapter changes. Device-ID/cache/fingerprint items appear only as optional recommendations with explicit limits (local hygiene only; not server unban; no anti-detect stacks).
145
+
146
+ The audit is local evidence, not a prediction of account approval or suspension.
147
+
148
+ Run `python -m claude_sonar` for a live markdown report (`format_report`: evidence table + Must fix / Optional consistency / Leave alone). No staged demo screenshot is shipped.
149
+
150
+ ## Read-only collection
151
+
152
+ Windows PowerShell 7:
153
+
154
+ ```powershell
155
+ pwsh -NoProfile -ExecutionPolicy Bypass -File .\scripts\collect_windows_network.ps1
156
+ ```
157
+
158
+ Windows PowerShell 5.1:
159
+
160
+ ```powershell
161
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\collect_windows_network.ps1
162
+ ```
163
+
164
+ macOS or Linux:
165
+
166
+ ```bash
167
+ python ./scripts/collect_posix_network.py
168
+ ```
169
+
170
+ Collector output can contain local identifiers. Keep raw output local and let the Skill redact it before sharing.
171
+
172
+ ## Report
173
+
174
+ The Skill returns a compact evidence table (`signal`, `status`, `confidence`, `evidence`, `action`) followed by three short sections: **Must fix**, **Optional consistency**, and **Leave alone**. See `SKILL.md` for the exact report format and interpretation rules.
175
+
176
+ ## Manual network alternatives (recommend-only)
177
+
178
+ When the audit flags DNS/HTTP egress divergence, two standard-tool fixes are worth knowing — both manual, reversible, and never applied for you:
179
+
180
+ - **socks5h remote DNS** — point Claude Code at a `socks5h://127.0.0.1:<port>` proxy URL instead of `socks5://` or `http://`. The `h` moves domain resolution to the proxy end and removes most local-DNS bypass paths.
181
+ - **SSH dynamic forwarding** — run `ssh -N -D 1080 user@your-vps` in a terminal you keep open (Windows ships OpenSSH), then point the tool at `socks5h://127.0.0.1:1080` for a fixed, self-owned VPS exit with no local client.
182
+
183
+ These are ordinary proxy techniques, not spoofing; the audit stays read-only and only ever *suggests* them.
184
+
185
+ ## Privacy opt-outs
186
+
187
+ Preview first:
188
+
189
+ ```powershell
190
+ pwsh -NoProfile -File .\scripts\remediate_windows_network.ps1
191
+ ```
192
+
193
+ After explicit approval, apply the documented Claude Code privacy environment variables:
194
+
195
+ ```powershell
196
+ pwsh -NoProfile -File .\scripts\remediate_windows_network.ps1 -Apply
197
+ ```
198
+
199
+ The script writes a backup and prints the exact rollback command. The broad non-essential-traffic opt-out can disable optional Claude Code features, so enable it only when that tradeoff is intended. On POSIX, `--apply` creates a private environment file and prints the `source` command; it does not edit shell profiles or network settings.
200
+
201
+ ## Safety boundary
202
+
203
+ - No fingerprint spoofing, automation concealment, CAPTCHA bypass, or multi-account tooling.
204
+ - No fabricated identity, residence, billing, tax, or payment information.
205
+ - May recommend optional local device-id/cache hygiene or browser WebRTC hardening when artifacts are present; does not auto-delete IDs, does not spoof fingerprints, and cannot clear server-side marks or unban accounts.
206
+ - No claim that a configuration prevents account review or suspension.
207
+
208
+ Use current primary documentation for Claude Code privacy controls and rate limits. Treat third-party detector labels as opinions until live routing evidence corroborates them.
209
+
210
+ If this project finds a real leak or prevents an unnecessary destructive change, a GitHub star helps others discover it.
@@ -0,0 +1,188 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/AschoofAlpha/claude-sonar/main/assets/social-preview.en.jpg" alt="Claude Sonar — local-first privacy and proxy audit" width="100%">
3
+ </p>
4
+
5
+ <h1 align="center">Claude Sonar</h1>
6
+
7
+ <p align="center"><strong>Local-first privacy and proxy-consistency audit for Claude Code and Agent Skills hosts.</strong></p>
8
+
9
+ <p align="center">
10
+ <img src="https://img.shields.io/github/actions/workflow/status/AschoofAlpha/claude-sonar/ci.yml?style=flat-square&label=CI" alt="CI">
11
+ <img src="https://img.shields.io/badge/version-1.0.0-2DD4BF?style=flat-square" alt="v1.0.0">
12
+ <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FAschoofAlpha%2Fclaude-sonar%2Fmain%2Fsonar-badge.json&query=%24.message&label=配置自洽分&color=2DD4BF" alt="配置自洽分">
13
+ <img src="https://img.shields.io/badge/default-read--only-2DD4BF?style=flat-square" alt="Read-only by default">
14
+ <img src="https://img.shields.io/badge/platform-Windows-4F7CFF?style=flat-square" alt="Windows">
15
+ <img src="https://img.shields.io/badge/license-MIT-64748B?style=flat-square" alt="MIT License">
16
+ </p>
17
+
18
+ <p align="center"><a href="README.zh-CN.md">简体中文</a> · <a href="SKILL.md">Skill instructions</a> · <a href="LICENSE">MIT License</a></p>
19
+
20
+ > **How is your Claude account doing lately?**
21
+ >
22
+ > If you use Claude from China, chances are you've seen these before:
23
+ >
24
+ > - You paid for Pro, and days later the account simply won't sign in
25
+ > - Months of conversations and project context, gone overnight with the account
26
+ > - Your appeal email vanished into a black hole
27
+ > - You registered a fresh account with a new email — banned again before you could really use it
28
+ > - You ask perfectly normal questions, yet keep getting flagged as "high risk"
29
+ >
30
+ > It's probably not bad luck — it's the road your traffic takes. You think everything goes through your proxy, but actually: a DNS lookup quietly asks your home broadband first, a "backup tunnel" connects directly without the proxy, a small WebRTC backdoor lets websites see your real network address, or your proxy node randomly hops between countries at 3am.
31
+ >
32
+ > **Every one of these leaks tells the platform "something's off."** Accounts get flagged, challenged, even banned — often not because of what you say, but because of these details exposing you. And the worst part: none of it hurts until the ban screen shows up.
33
+ >
34
+ > Claude Sonar is the tool that checks those details for you — **a read-only checkup that touches nothing**:
35
+ >
36
+ > - **Traffic routing**: where does your data actually leave from, and is anything slipping past the proxy?
37
+ > - **Domain lookups**: when you type a URL, does the query secretly take a detour it shouldn't?
38
+ > - **Proxy setup**: are your nodes auto-switching countries, and are your routing rules still working?
39
+ > - **System state**: do your timezone, language, and privacy toggles fight each other?
40
+ >
41
+ > When the checkup finishes, you get a **clear report** — every item labeled: **Must fix** (a real problem), **Optional consistency** (not a risk, but worth aligning), **Leave alone** (don't touch it). At the top sits your **configuration self-consistency score** (simply put: do your settings contradict each other), at a glance.
42
+ >
43
+ > Then the decision is **entirely yours** — nothing changes without your explicit approval.
44
+ >
45
+ > And here's what this tool **won't do**:
46
+ >
47
+ > - It won't help you **impersonate someone else** (no fingerprint spoofing, no hiding automation)
48
+ > - It won't help you **fabricate identity** (no fake addresses, billing, or personal info)
49
+ > - It will never **guarantee** "this config means you'll never get banned" — anyone who promises that is lying to you.
50
+ >
51
+ > The "anti-ban" tools teach you to fool the platform. Claude Sonar does one thing: **show you the truth**, and give you back the choice.
52
+ >
53
+ > **Audit first. Decide after.** Your account deserves one honest check.
54
+
55
+ ## Install
56
+
57
+ ```bash
58
+ pip install -U claude-sonar
59
+ ```
60
+
61
+ Requires **1.4.0+** for CLI `--out` / `--diff` / `--compact` / `--intended-mode` and parallel online probes.
62
+ **1.3.3+** already includes the plain-language report, consistency score, and proxy-layer checks.
63
+ Legacy package **`anti-claude-check`** is retired — use **`claude-sonar`** only.
64
+
65
+
66
+ As an agent skill (Codex / Claude Code):
67
+
68
+ ```powershell
69
+ git clone https://github.com/AschoofAlpha/claude-sonar.git "$HOME/.codex/skills/claude-sonar"
70
+ ```
71
+
72
+ Invoke `$claude-sonar` in Codex. For Claude Code, install the same folder as `~/.claude/skills/claude-sonar` and invoke `/claude-sonar`.
73
+
74
+ ## CLI (1.4)
75
+
76
+ ```bash
77
+ python -m claude_sonar # full markdown report (offline)
78
+ python -m claude_sonar --compact # shorter markdown (score + must-fix / optional)
79
+ python -m claude_sonar --json # report_dict + summary as JSON
80
+ python -m claude_sonar --out report.md
81
+ python -m claude_sonar --json --out report.json
82
+ python -m claude_sonar --diff previous.json
83
+ python -m claude_sonar --online --timeout 5
84
+ python -m claude_sonar --online --intended-region US
85
+ python -m claude_sonar --intended-mode system_proxy # or full_tunnel
86
+ python -m claude_sonar --lang en
87
+ python -m claude_sonar serve --port 8765 # read-only local web panel on 127.0.0.1
88
+ python -m claude_sonar repo ./my-project # code security scan (SAST/secrets/deps)
89
+ python -m claude_sonar badge # write sonar-badge.json from an audit
90
+ ```
91
+
92
+ Sub-commands (same `python -m claude_sonar` entry point):
93
+
94
+ - **`serve [--port N] [--open]`** — zero-dependency local web panel bound to **127.0.0.1 only**. `/` renders the audit (score, Must fix / Optional / Leave alone groups), `/api/report?online=0` returns the redacted report JSON (online probes stay off unless you opt in), plus a browser-side observation block (WebRTC ICE candidates, local timezone/language). Read-only: POST is 405, path traversal is 404, only loopback `Host` headers are accepted.
95
+ - **`repo PATH [--no-tools] [--baseline F] [--json] [--sarif F] [--out F]`** — repository security scan: stack detection, semgrep / gitleaks / pip-audit / npm audit / freshness (npm outdated, pip list --outdated) orchestration with graceful degradation (missing tools are skipped and noted), bundled trimmed Semgrep rules (MIT source noted), weighted 0–100 code-security score, fix suggestions, baseline diff, SARIF 2.1.0 export. No pentesting, no GitHub-issue filing.
96
+ - **`badge [--out PATH] [--from-report F]`** — writes `sonar-badge.json` (score + color) for the shields.io dynamic badge below; `--from-report` reuses a previous `--json` report instead of re-auditing.
97
+
98
+ Online probes (egress, DNS observation, IP reputation, cross-site exits, **DNS-vs-HTTP exit consistency**, **JA3/JA4 TLS fingerprint**) stay **off** unless you pass `--online`. With `--online`, independent probes run in parallel (shared timeout). The `ANTHROPIC_BASE_URL` audit (official endpoint vs a bundled public risk-intel blacklist) always runs offline.
99
+
100
+ `--out` writes the report to a file **and** still prints to stdout. `--diff` accepts a previous CLI `--json` payload or bare `report_dict` and appends a status-diff section (or a `diff` key in JSON mode). Default markdown is full; pass `--compact` for a short report (`--full` forces full if both are set).
101
+
102
+ Library defaults: `run_full_audit(include_recommendations=True)` returns `report_markdown` via `format_report`. Windows collector also reports Firefox WebRTC policy presence when detectable.
103
+
104
+ ## What you get
105
+
106
+ | Layer | Checks |
107
+ | --- | --- |
108
+ | Claude privacy | 3 main opt-out switches + 6 supplemental vars + local artifact presence |
109
+ | Proxy | system proxy / WinHTTP / env vars / PAC / other-client conflicts |
110
+ | DNS | fake-IP, port-53 hijack, DoH, physical-resolver residue, browser Secure DNS |
111
+ | Routing | TUN, default route, Teredo, IPv6 bypass |
112
+ | Consistency | timezone × locale × (online) exit region |
113
+ | Personalized | detects your proxy client (Clash Verge / v2rayN / sing-box / …) and gives per-app manual steps |
114
+ | Online (opt-in) | DNS-vs-HTTP exit consistency (DoH), JA3/JA4 TLS client fingerprint (openssl capture) |
115
+ | Always-on | `ANTHROPIC_BASE_URL` audit vs a bundled public relay-risk blacklist |
116
+ | Local panel | `serve` — 127.0.0.1 read-only panel + browser-side WebRTC/timezone observation |
117
+ | Repo scan | `repo` — SAST / secrets / dependency audit with a 0–100 code-security score |
118
+ | Badge | `badge` — `sonar-badge.json` driving a shields.io dynamic badge |
119
+
120
+ Results split into **Must fix**, **Optional consistency**, and **Leave alone**; every check carries a plain-language **说明/meaning** column and the report ends with a **configuration self-consistency** score (not anti-ban) plus a footer of what stays **recommend-only never auto** (fingerprint, timezone-follow-node, env wipe, anti-ban score disguise, DNS/route/TUN).
121
+
122
+ Optional, reversible privacy environment-variable remediation only. No automatic DNS, route, firewall, VPN, or IPv6-adapter changes. Device-ID/cache/fingerprint items appear only as optional recommendations with explicit limits (local hygiene only; not server unban; no anti-detect stacks).
123
+
124
+ The audit is local evidence, not a prediction of account approval or suspension.
125
+
126
+ Run `python -m claude_sonar` for a live markdown report (`format_report`: evidence table + Must fix / Optional consistency / Leave alone). No staged demo screenshot is shipped.
127
+
128
+ ## Read-only collection
129
+
130
+ Windows PowerShell 7:
131
+
132
+ ```powershell
133
+ pwsh -NoProfile -ExecutionPolicy Bypass -File .\scripts\collect_windows_network.ps1
134
+ ```
135
+
136
+ Windows PowerShell 5.1:
137
+
138
+ ```powershell
139
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\collect_windows_network.ps1
140
+ ```
141
+
142
+ macOS or Linux:
143
+
144
+ ```bash
145
+ python ./scripts/collect_posix_network.py
146
+ ```
147
+
148
+ Collector output can contain local identifiers. Keep raw output local and let the Skill redact it before sharing.
149
+
150
+ ## Report
151
+
152
+ The Skill returns a compact evidence table (`signal`, `status`, `confidence`, `evidence`, `action`) followed by three short sections: **Must fix**, **Optional consistency**, and **Leave alone**. See `SKILL.md` for the exact report format and interpretation rules.
153
+
154
+ ## Manual network alternatives (recommend-only)
155
+
156
+ When the audit flags DNS/HTTP egress divergence, two standard-tool fixes are worth knowing — both manual, reversible, and never applied for you:
157
+
158
+ - **socks5h remote DNS** — point Claude Code at a `socks5h://127.0.0.1:<port>` proxy URL instead of `socks5://` or `http://`. The `h` moves domain resolution to the proxy end and removes most local-DNS bypass paths.
159
+ - **SSH dynamic forwarding** — run `ssh -N -D 1080 user@your-vps` in a terminal you keep open (Windows ships OpenSSH), then point the tool at `socks5h://127.0.0.1:1080` for a fixed, self-owned VPS exit with no local client.
160
+
161
+ These are ordinary proxy techniques, not spoofing; the audit stays read-only and only ever *suggests* them.
162
+
163
+ ## Privacy opt-outs
164
+
165
+ Preview first:
166
+
167
+ ```powershell
168
+ pwsh -NoProfile -File .\scripts\remediate_windows_network.ps1
169
+ ```
170
+
171
+ After explicit approval, apply the documented Claude Code privacy environment variables:
172
+
173
+ ```powershell
174
+ pwsh -NoProfile -File .\scripts\remediate_windows_network.ps1 -Apply
175
+ ```
176
+
177
+ The script writes a backup and prints the exact rollback command. The broad non-essential-traffic opt-out can disable optional Claude Code features, so enable it only when that tradeoff is intended. On POSIX, `--apply` creates a private environment file and prints the `source` command; it does not edit shell profiles or network settings.
178
+
179
+ ## Safety boundary
180
+
181
+ - No fingerprint spoofing, automation concealment, CAPTCHA bypass, or multi-account tooling.
182
+ - No fabricated identity, residence, billing, tax, or payment information.
183
+ - May recommend optional local device-id/cache hygiene or browser WebRTC hardening when artifacts are present; does not auto-delete IDs, does not spoof fingerprints, and cannot clear server-side marks or unban accounts.
184
+ - No claim that a configuration prevents account review or suspension.
185
+
186
+ Use current primary documentation for Claude Code privacy controls and rate limits. Treat third-party detector labels as opinions until live routing evidence corroborates them.
187
+
188
+ If this project finds a real leak or prevents an unnecessary destructive change, a GitHub star helps others discover it.
@@ -0,0 +1,194 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/AschoofAlpha/claude-sonar/main/assets/social-preview.jpg" alt="Claude Sonar — 本地隐私与代理一致性审计" width="100%">
3
+ </p>
4
+
5
+ <h1 align="center">Claude Sonar</h1>
6
+
7
+ <p align="center"><strong>面向 Codex、Claude Code 和 Agent Skills 宿主的本地隐私与代理一致性审计。</strong></p>
8
+
9
+ <p align="center">
10
+ <img src="https://img.shields.io/github/actions/workflow/status/AschoofAlpha/claude-sonar/ci.yml?style=flat-square&label=CI" alt="CI">
11
+ <img src="https://img.shields.io/badge/version-1.0.0-2DD4BF?style=flat-square" alt="v1.0.0">
12
+ <img src="https://img.shields.io/badge/default-read--only-2DD4BF?style=flat-square" alt="默认只读">
13
+ <img src="https://img.shields.io/badge/platform-Windows-4F7CFF?style=flat-square" alt="Windows">
14
+ <img src="https://img.shields.io/badge/license-MIT-64748B?style=flat-square" alt="MIT License">
15
+ </p>
16
+
17
+ <p align="center"><a href="README.md">English</a> · <a href="SKILL.md">Skill 指令</a> · <a href="LICENSE">MIT License</a></p>
18
+
19
+ > **你的 Claude 账号,最近还好吗?**
20
+ >
21
+ > 如果你在国内用 Claude,下面这些场景你多半不陌生:
22
+ >
23
+ > - 刚充的会员还没用几天,账号突然登不上去了
24
+ > - 攒了好几个月的对话、项目上下文,一夜之间全跟着账号没了
25
+ > - 申诉邮件发出去,石沉大海
26
+ > - 换个邮箱重新注册,新号还没捂热,又被封了
27
+ > - 明明只是正常提问,却总被当成"高风险用户"
28
+ >
29
+ > 这不是你的运气问题,多半是"出门的路"出了问题。你以为所有流量都走了代理,实际上:
30
+ >
31
+ > - 查个网址,你的电脑先偷偷去问了自家宽带的 DNS
32
+ > - 某个"备用通道"没走代理,直接连出去了
33
+ > - 网页还能通过浏览器自带的一个小功能(WebRTC),瞄到你的真实上网地址
34
+ > - 代理节点半夜自己换国家,一会儿美国一会儿日本
35
+ >
36
+ > **这些细节,每一个都在告诉平台"这个人不对劲"。** 账号被风控、被要求验证、甚至被封,很多时候不是内容的问题,是这些细节在暴露你。更麻烦的是:这些隐患平时毫无感觉,等你看到封号页面的时候,一切都晚了。
37
+ >
38
+ > Claude Sonar 就是帮你把这些细节查清楚的工具——**一次只读体检,不动你任何配置**:
39
+ >
40
+ > - **流量走向**:你的数据到底从哪出去,有没有没走代理的"漏网之鱼"
41
+ > - **域名查询**:你输入一个网址,查询请求有没有偷偷走了不该走的路
42
+ > - **代理设置**:节点是不是在自动换国家,分流规则还有没有用
43
+ > - **系统状态**:时区、语言、隐私开关,有没有互相打架的地方
44
+ >
45
+ > 体检完,你会拿到一张清清楚楚的**报告**,每一项都标注:**必须处理**(这是真问题)、**可选一致性**(不影响安全但建议统一)、**保持不动**(别瞎折腾)。最上面还会给你一个**配置自洽分**(简单说就是:你的各项设置有没有互相矛盾),一目了然。
46
+ >
47
+ > 然后,改不改、怎么改,**完全由你决定**——没有你的明确批准,它一个字都不会动。
48
+ >
49
+ > 最后说清楚这个工具**不做什么**:
50
+ >
51
+ > - 不帮你**伪装成另一个人**(不伪造指纹、不隐藏自动化)
52
+ > - 不帮你**编造身份**(不捏造地址、账单、个人信息)
53
+ > - 更不会**打包票**说"这样配就永远不会被封"——凡是这么承诺的,都是在骗你。
54
+ >
55
+ > 市面上的"防封神器"教你怎么骗过平台;Claude Sonar 只做一件事:**让你看清真相**,把选择权还给你。
56
+ >
57
+ > **先体检,再决定。** 你的账号,值得一次诚实的检查。
58
+
59
+ ## 快速开始
60
+
61
+ ```bash
62
+ pip install -U claude-sonar
63
+ ```
64
+
65
+ CLI `--out` / `--diff` / `--compact` / `--intended-mode` 与并行在线探测请使用 **1.4.0+**。
66
+ 说明列、配置自洽分、代理分层检查等报告能力自 **1.3.3+** 起已具备。
67
+ 旧包名 **`anti-claude-check`** 已停用,请只安装 **`claude-sonar`**。
68
+
69
+
70
+ 作为 Agent Skill(Codex / Claude Code):
71
+
72
+ ```powershell
73
+ git clone https://github.com/AschoofAlpha/claude-sonar.git "$HOME/.codex/skills/claude-sonar"
74
+ ```
75
+
76
+ 在 Codex 中调用 `$claude-sonar`。Claude Code 用户将同一目录安装到 `~/.claude/skills/claude-sonar`,调用 `/claude-sonar`。
77
+
78
+ ## CLI(1.4)
79
+
80
+ ```bash
81
+ python -m claude_sonar # 完整 Markdown 报告(离线)
82
+ python -m claude_sonar --compact # 精简报告(分数 + 必须处理 / 可选一致性)
83
+ python -m claude_sonar --json # 输出 report_dict + summary
84
+ python -m claude_sonar --out report.md
85
+ python -m claude_sonar --json --out report.json
86
+ python -m claude_sonar --diff previous.json
87
+ python -m claude_sonar --online --timeout 5
88
+ python -m claude_sonar --online --intended-region US
89
+ python -m claude_sonar --intended-mode system_proxy # 或 full_tunnel
90
+ python -m claude_sonar --lang en
91
+ python -m claude_sonar serve --port 8765 # 只读本地网页面板(仅 127.0.0.1)
92
+ python -m claude_sonar repo ./my-project # 代码仓库安全扫描(SAST/密钥/依赖)
93
+ python -m claude_sonar badge # 从审计结果生成 sonar-badge.json
94
+ ```
95
+
96
+ 子命令(同一入口 `python -m claude_sonar`):
97
+
98
+ - **`serve [--port N] [--open]`** — 零依赖本地网页面板,**仅绑定 127.0.0.1**。`/` 渲染审计结果(分数、必须处理/可选一致性/保持不动分组);`/api/report?online=0` 返回脱敏后的报告 JSON(在线探测默认关闭,需手动打开);附带浏览器端观察区(WebRTC ICE 候选、本地时区/语言)。只读:POST 返回 405、路径穿越 404、仅接受回环 Host 头。
99
+ - **`repo PATH [--no-tools] [--baseline F] [--json] [--sarif F] [--out F]`** — 代码仓库安全扫描:技术栈识别、semgrep / gitleaks / pip-audit / npm audit / 过期检测(npm outdated、pip list --outdated)编排(工具缺失自动跳过并注明)、内置精简 Semgrep 规则(MIT 来源已注明)、0–100 加权代码安全分、修复建议、基线对比、SARIF 2.1.0 导出。不含渗透测试、不自动建 GitHub issue。
100
+ - **`badge [--out PATH] [--from-report F]`** — 写入 `sonar-badge.json`(分数+颜色),供下方 shields.io 动态徽章使用;`--from-report` 可复用上次 `--json` 报告、无需重新审计。
101
+
102
+ 除非传入 `--online`,否则不会启用在线探测(出口、DNS、IP 声誉、跨站出口、**DNS 与 HTTP 出口一致性**、**JA3/JA4 TLS 指纹**)。启用 `--online` 时,独立探测会并行执行(共享超时)。`ANTHROPIC_BASE_URL` 审计(官方端点 vs 内置公开风控黑名单情报)始终离线运行。
103
+
104
+ `--out` 写入文件的同时仍打印到 stdout。`--diff` 接受上次 CLI `--json` 输出或裸 `report_dict`,在 Markdown 末尾追加对比段(JSON 模式增加 `diff` 字段)。默认完整报告;`--compact` 输出精简版(若与 `--full` 同时出现,以 `--full` 为准)。
105
+
106
+ 库默认 `run_full_audit(include_recommendations=True)`,并返回 `report_markdown`。Windows 采集器在可检测时也会报告 Firefox WebRTC 策略。
107
+
108
+ ## 你会得到什么
109
+
110
+ | 层 | 检查 |
111
+ | --- | --- |
112
+ | Claude 隐私 | 3 个主开关 + 6 项补充变量 + 本地残留 |
113
+ | 代理 | 系统代理 / WinHTTP / 环境变量 / PAC / 其它客户端冲突 |
114
+ | DNS | fake-IP、53 劫持、DoH、物理网卡残留、浏览器 Secure DNS |
115
+ | 路由 | TUN、默认路由、Teredo、IPv6 旁路 |
116
+ | 在线(可选) | DNS 与 HTTP 出口一致性(DoH)、JA3/JA4 TLS 客户端指纹(openssl 抓包) |
117
+ | 始终运行 | `ANTHROPIC_BASE_URL` 审计(内置公开中转风险黑名单比对) |
118
+ | 本地面板 | `serve` — 127.0.0.1 只读面板 + 浏览器端 WebRTC/时区观察 |
119
+ | 仓库扫描 | `repo` — SAST / 密钥 / 依赖审计,0–100 代码安全分 |
120
+ | 徽章 | `badge` — `sonar-badge.json` 驱动 shields.io 动态徽章 |
121
+ | 一致性 | 时区 × 语言 ×(在线)出口地区 |
122
+ | 个性化 | 自动识别你的梯子(Clash Verge / v2rayN / sing-box / …)并按软件给手动步骤 |
123
+
124
+ 结果分为 **必须处理**、**可选一致性**、**保持不动**;每项都有白话 **说明** 列,报告含 **配置自洽分**(不是防封分),页脚标明「只建议、不自动」:改指纹 / 时区跟随节点 / 清环境洗白 / 防封评分伪装 / 改 DNS·路由·TUN。
125
+
126
+ 仅提供可选且可回滚的隐私环境变量修复;不会自动修改 DNS、路由、防火墙、VPN、IPv6 网卡、设备 ID、缓存或浏览器指纹。
127
+
128
+ 审计结果只是本地证据,不是账号通过审核或避免封禁的预测。
129
+
130
+ 运行 `python -m claude_sonar` 即可得到实时 Markdown 报告(`format_report`:证据表 + 必须处理 / 可选一致性 / 保持不动)。仓库不再附带伪造的演示截图。
131
+
132
+ ## 只读采集
133
+
134
+ Windows PowerShell 7:
135
+
136
+ ```powershell
137
+ pwsh -NoProfile -ExecutionPolicy Bypass -File .\scripts\collect_windows_network.ps1
138
+ ```
139
+
140
+ Windows PowerShell 5.1:
141
+
142
+ ```powershell
143
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\collect_windows_network.ps1
144
+ ```
145
+
146
+ macOS 或 Linux:
147
+
148
+ ```bash
149
+ python ./scripts/collect_posix_network.py
150
+ ```
151
+
152
+ 采集器原始输出可能含本地标识,请留在本机,由 Skill 脱敏后再分享。
153
+
154
+ ## 报告
155
+
156
+ Skill 会返回一张紧凑的证据表(`signal`、`status`、`confidence`、`evidence`、`action`),后接三个短章节:**必须处理**、**可选一致性**、**保持不动**。完整报告格式与判定规则见 `SKILL.md`。
157
+
158
+ ## 手动网络替代方案(仅建议,绝不代改)
159
+
160
+ 当审计提示 DNS/HTTP 出口不一致时,有两个标准工具方案值得了解——均为手动、可逆,本工具绝不会替你执行:
161
+
162
+ - **socks5h 远程解析** — 把 Claude Code 的代理指向 `socks5h://127.0.0.1:<端口>` 形式(而非 `socks5://` 或 `http://`)。`h` 让域名解析在代理端完成,消除大部分本地 DNS 绕过路径。
163
+ - **SSH 动态转发** — 在保持打开的终端里运行 `ssh -N -D 1080 user@你的VPS`(Windows 自带 OpenSSH),再把工具指向 `socks5h://127.0.0.1:1080`,即可用自有 VPS 做固定出口、无需本地代理客户端。
164
+
165
+ 这是常规代理用法,不是伪装;审计保持只读,只做建议。
166
+
167
+ ## 隐私开关
168
+
169
+ 先预览:
170
+
171
+ ```powershell
172
+ pwsh -NoProfile -File .\scripts\remediate_windows_network.ps1
173
+ ```
174
+
175
+ 经明确批准后,应用文档化的 Claude Code 隐私环境变量:
176
+
177
+ ```powershell
178
+ pwsh -NoProfile -File .\scripts\remediate_windows_network.ps1 -Apply
179
+ ```
180
+
181
+ 脚本会写备份并打印精确的回滚命令。宽泛的非必要流量开关可能禁用 Claude Code 的某些可选功能,仅在明确接受该权衡时启用。POSIX 下 `--apply` 只创建私有环境文件并打印 `source` 命令,不修改 shell 配置或网络设置。
182
+
183
+ 报告在发现本地 Claude 目录/缓存或浏览器 WebRTC 策略偏松时,可以**建议**是否做本地 device-ID 重置、清理遥测缓存、加强浏览器隐私/WebRTC 设置;这些建议默认不自动执行,**不能**清除服务端设备标记,也**不**推荐反检测浏览器或指纹伪装。
184
+
185
+ ## 安全边界
186
+
187
+ - 不伪造指纹、不隐藏自动化、不绕过验证码,也不做多账号工具。
188
+ - 不编造身份、居住地、账单、税务或支付信息。
189
+ - 不自动删除设备 ID、遥测缓存,也不做全局网络修改。
190
+ - 不声称任何配置能防止账号审核或封禁。
191
+
192
+ Claude Code 隐私开关与限流规则以官方最新文档为准。第三方检测器标签只是观点,需有实时路由证据佐证。
193
+
194
+ 如果这个项目帮你发现了一个真实泄漏、或避免了一次不必要的破坏性改动,一个 GitHub star 能让更多人找到它。