Problem Solutions
Claude Code Put Your Email in the User-Agent Header: What the Bug Report Says and How to Protect It
A GitHub bug report filed on November 5 says Claude Code writes the signed-in user's email address into the User-Agent header of its outbound web-search requests, broadcasting the address to every site the agent touches. The reporter, taylor-edwards, opens with the consequence: I receive dozens of scam emails per day because claude code divulged my email to arbitrary 3rd parties in the User-Agent request header while conducting web searches without my permission. Anthropic has triaged the report as a security bug. It has not publicly replied yet.
The report is an allegation, not a verified finding, and this article treats it as one. What is established is that the issue exists, that Anthropic's triage has tagged it area:security, area:tools, bug and platform:macos, and that the behavior it describes fits a pattern of email-exposure reports about Claude Code that goes back weeks. What is not established is how widely the header appears, or whether the reporter's spam is caused by it.
What the report says
The issue, number 107757 in the anthropics/claude-code repository, targets Claude Code version 2.1.318 on macOS. The reporter says the email should not be a setting with opt-out or opt-in behavior, and that it needs to be removed from the harness entirely. The reporter also says they are migrating their company to Pi with OpenRouter, having lost faith in Anthropic preserving their privacy.
The issue carries no reproduction log, no sample request dump and no indication of which versions first introduced the header, as AI Weekly notes in its coverage. That matters: without a captured request, nobody outside Anthropic can confirm exactly which requests carry the address, or whether the header appears on every web search or only on some.
This is not the first email-exposure report
The November 5 issue lands on top of a month of related reports. On October 24, security researcher Chris Lakin reported that Claude Code was adding user email addresses to outbound HTTP request headers without explicit consent, after analyzing network traffic from routine development work. On October 29, a Hacker News discussion picked up the same behavior, with users reporting the address appearing in request headers to sites including crates.io and the SEC.
The mechanism behind those reports is documented. Claude Code adds a block reading userEmail, followed by the user's email address, to the model's system prompt in every session. The value comes from oauthAccount.emailAddress in ~/.claude.json, and there is no supported way to stop it. The IS_DEMO=1 setting, which is documented as hiding the email from the header and the status line, only affects what is shown on screen and never reaches the context builder. A separate October report described a subagent leaking the address into a curl User-Agent header sent to sec.gov despite a no-disclosure instruction.
What Anthropic already changed
Claude Code 2.1.317, released November 3, adds a check that asks before a web or shell tool call sends your account email address to the network. The release notes describe it as a confirmation prompt, not a block, and it acts at the moment a web or shell tool call would send the address out. That is a different path from the one in the November 5 report: a confirmation at tool-call time does not necessarily cover a header the harness writes itself. Until Anthropic answers the new issue, it is not clear whether the 2.1.317 check touches the User-Agent path at all.
What you can do now
Start by checking whether your address is exposed. In a fresh Claude Code session, ask what is my email. Community reports say the model will answer with your address immediately, because the system-prompt block is always there. That test shows the address is in context; it does not prove it left your machine in a header, but it confirms the starting point.
The strongest practical fix, offered by the community, is to skip the account login and use an API key instead. With an API key there is no signed-in account, and no email to attach. A weaker fix is to add a rule to CLAUDE.md telling the model never to use your email. That stops the model using the address, but it does not stop the harness writing it into a header, so treat it as a partial measure and say so plainly if you recommend it.
Beyond that, watch issue 107757 for a fix, and treat any site your agent searched as a site that may now hold your address. If your spam volume jumped after you started using Claude Code for web research, the reporter's experience suggests you are not imagining the connection, even if the causal link is still unproven. The fix, when it comes, should be a removal, not a setting: that is the one point the reporter, the October researchers and the Hacker News thread all agree on.