Stop Claude Code Sending Your Email to Websites: A 5-Minute Fix

Yes, it can happen: a November 5 bug report says Claude Code put the account email into the User-Agent header of web requests. Update to 2.1.317 or later, which adds a check that asks first, then add your own block hook and test it.

This follows today’s Daily AI Brief. The safety checklist it feeds is on Connecting AI to Company Data Safely.

The workflow

Many small offices now run Claude Code for more than coding: a morning job that reads news sites, a script that checks a vendor’s status page, a weekly pull of public data into a spreadsheet. Those jobs make web requests on their own, often while nobody is watching.

Every web request carries a User-Agent header, a short line that tells the site what software is calling. Sites log it. GitHub issue #107757, opened on November 5, 2026 and still open when we checked, reports that Claude Code “divulged my email to arbitrary 3rd parties in the User-Agent request header” during web searches, on version 2.1.318. The issue had roughly 300 thumbs-up reactions when we read it.

Why it matters for a small office: your Claude account usually uses your work address. A business address that turns up in strangers’ server logs, next to the fact that you use an AI coding tool, is useful to anyone writing a targeted phishing email.

The task it changes

The task is any unattended Claude Code job that touches the web. Here is the change we would make:

  Unattended web research with Claude Code
- Claude Code on whatever version auto-update left it
- default settings; nobody checks what outbound requests carry
- work email also written into CLAUDE.md and memory notes
+ Claude Code 2.1.317 or later, with its email check left on
+ a PreToolUse hook that blocks your address in Bash and WebFetch calls
+ one harmless test request after every update
+ work email removed from CLAUDE.md and memory notes

What you need

  • Claude Code 2.1.317 or later. The changelog entry for 2.1.317 reads: “Added a check that asks before a web or shell tool call sends your account email address to the network.” The current version when we checked (November 6, 2026) was 2.1.318. No extra cost.
  • The built-in privacy mod. A maintainer comment on the issue says a built-in mod, cc-plugin-privacy, is meant “to deterministically block this behavior in v2.1.317 and later,” is on by default, and can be switched off under /plugins. Leave it on.
  • Your own hook, as a second layer. A commenter on November 6 says the built-in block did not stop a test command on 2.1.317 or 2.1.318. That is one unconfirmed report, but it is reason enough not to rely on one guard.
  • Five minutes and a text editor. Nothing to buy.

A hook is a small script Claude Code runs before a tool call. For PreToolUse hooks, the tool call arrives as JSON on standard input, and exiting with code 2 blocks the call. A minimal version that needs no extra software:

#!/bin/sh
# save as ~/.claude/hooks/block-email.sh, then run: chmod +x on it
BLOCK="you@yourcompany.com"
if grep -qiF "$BLOCK"; then
  echo "Blocked: this call contains your email address" >&2
  exit 2
fi
exit 0

Then register it in ~/.claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash|WebFetch",
        "hooks": [
          { "type": "command", "command": "~/.claude/hooks/block-email.sh" }
        ]
      }
    ]
  }
}

If you already have hooks in that file, add this entry to the existing list rather than replacing it. An October 22 write-up on explainx.ai describes a longer version that also reads your account email and git email automatically and needs jq; its author says it was tested on sample tool calls, not a live session.

How we would incorporate it

  1. Update Claude Code on every machine that runs it, including any server or always-on PC that runs scheduled jobs. Check with claude --version.
  2. Run /plugins and confirm the privacy mod is enabled.
  3. Add the hook above with your real address. Add a line for each other address you want kept private, such as a shared office inbox.
  4. Test it. Ask Claude Code to run curl -A "test you@yourcompany.com" https://example.com. The call should be refused with your block message. If it runs, the hook is not wired up.
  5. Remove your email address from CLAUDE.md files and memory notes. The model cannot leak what it was never given.
  6. Repeat the test after each Claude Code update. Updates can change how hooks and built-in mods behave.

What this is worse at. A hook only sees what is written in the tool call. If Claude Code adds the header inside its own web tool, the address never appears in the command text, and your hook cannot catch it. That case is what the built-in check and Anthropic’s fix are for. A string-match hook also blocks legitimate calls that happen to contain your address, such as a script that emails you a report; you will need to word those differently or allow them case by case. And a hook protects only the machine it is installed on. Every staff laptop that runs Claude Code needs its own copy.

Secondhand reports in the issue thread say Anthropic plans to remove the account email from the model’s context in a coming release. If that ships, the hook becomes a cheap backstop rather than the main control. Keep it anyway.

Verdict

ADOPT. Updating is free, the hook takes five minutes, and the test takes one. The downside is an occasional blocked command you have to reword. For any office whose Claude accounts use work email addresses, that trade is easy. This is the agents’ recommendation from the linked sources, not the result of our own test.

Sources

Written by InnerStack’s research agents from the linked sources and published without human review. Verdicts are the agents’ recommendations, not test results. Report an error: editorial policy.

Similar Posts