跪拜 Guibai
← All articles
Frontend · AI Programming · Claude

Claude Code Hid Tracking in a Unicode Apostrophe for Three Months

By kyriewen ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A widely used AI coding tool shipped hidden client-side logic that tagged user requests by region using steganography, not a documented feature flag. For any developer or enterprise that handles sensitive code, this resets the baseline expectation for what a trusted vendor can do inside a local binary without disclosure.

Summary

From April to July 2025, Claude Code versions v2.1.91 through v2.1.196 contained hidden tracking logic that checked the OS timezone for `Asia/Shanghai` or `Asia/Urumqi` and inspected proxy relay addresses against an XOR-obfuscated blacklist of over 100 Chinese domains. When triggered, the code altered the system prompt by replacing the standard apostrophe in "Today's date" with a visually identical but Unicode-distinct character, plus reformatting the date with slashes instead of hyphens. Anthropic's servers could then identify and potentially rate-limit or ban requests originating from China, all without any user notification or consent.

The tracking ran undetected for nearly three months until a developer reverse-engineered the client and published findings on Reddit. Anthropic acknowledged the mechanism the next day, calling it "policy compliance research," and removed it in v2.1.197. Alibaba subsequently banned Claude Code internally, and China's Ministry of Industry and Information Technology classified the incident as a serious security backdoor risk on July 8.

Takeaways
Claude Code v2.1.91–v2.1.196 checked the OS timezone for Asia/Shanghai or Asia/Urumqi to identify users in China, bypassing VPNs since timezone is a local setting.
The client inspected the ANTHROPIC_BASE_URL environment variable against an XOR-obfuscated blacklist of more than 100 Chinese domains, including code-hosting and cloud-service addresses.
When both checks passed, the tracking module replaced the standard apostrophe in the system prompt with a visually identical Unicode variant and changed the date format from hyphens to slashes.
Anthropic servers could read these markers to apply region-specific policies such as rate limiting or account bans, with no user-facing indication or opt-out.
The tracking code was publicly disclosed on June 30, acknowledged by Anthropic on July 1, and removed in v2.1.197 on July 2.
Alibaba banned Claude Code internally on July 3, and China's MIIT formally classified the incident as a serious security backdoor risk on July 8.
An open-source tool called clawgod on GitHub can detect and neutralize the XOR-obfuscated domain list and the Unicode apostrophe substitution.
Conclusions

Using steganography rather than a plaintext header or documented telemetry suggests an intent to avoid detection by both users and automated security scans.

Checking the OS timezone instead of the IP address is a deliberate choice that defeats VPN-based geo-unblocking, which many Chinese developers rely on to access Claude.

Anthropic's framing as 'policy compliance research' conflicts with the lack of disclosure, consent, or documentation—compliance research typically requires transparency to be legitimate.

The incident accelerates a practical split: enterprises with compliance requirements now have a concrete reason to migrate to domestic alternatives like Tongyi Lingma or auditable open-source models like DeepSeek Coder.

Concepts & terms
Steganography
A technique for hiding information inside otherwise normal-looking data. Here, a Unicode apostrophe that looks identical to the standard ASCII apostrophe carries a hidden signal readable only by Anthropic's servers.
XOR obfuscation
A simple encryption method using the bitwise XOR operation to obscure data. Claude Code used it to hide a blacklist of over 100 domain names so a plaintext search of the binary would not reveal them.
System prompt
A hidden instruction sent to a large language model at the start of a conversation that sets behavior rules. Claude Code's system prompt begins with a date string, which the tracking code modified to embed a regional marker.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗