claude-code-no-email plugin

A Claude Code hook plugin that strips your email address from the context the client attaches to a conversation with the model

  • 71 ★ on the repository
  • Last commit
  • MIT
Plugin

Extended access

Why this level

  • The hook reads and changes the context Claude Code sends to the model with every request
  • It relies on an internal client hook module interface, and compatibility depends on the Claude Code version
All reasons and checks

alexerrant/claude-code-no-email

Install

Works in

Manual install

Text for your agent

Clone https://github.com/AlexErrant/claude-code-no-email and connect the plugin from the .claude/skills/no-email folder as a local Claude Code plugin. Then run claude --debug and find the line about no-email and prompt.context. Do not print my email address.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The hook reads and changes the context Claude Code sends to the model with every request
  • It relies on an internal client hook module interface, and compatibility depends on the Claude Code version

This is third-party code. Review the repository files before installing.

What it does

When you sign in through claude.ai, Claude Code adds a userEmail block to the context with the address from the oauthAccount.emailAddress field of ~/.claude.json, and no setting turns this off. The claude-code-no-email plugin intercepts the prompt.context event through a claude-code hook module, waits for the rest of the chain to return and filters the block named userEmail out of the context blocks. The model receives the rest of the context without the email. The plugin code is one small TypeScript file, register.ts: the register function subscribes to prompt.context, calls next and returns the context without that block. Beside it sit hooks.json that wires the module in, plugin.json with the description about dropping the userEmail block, and a register.test.ts test. The author wrote it after a Reddit thread where users noticed their email in requests. According to him, Opus likes to put it into request headers, so it is better to remove the block from the context.

Who it is for. People who use Claude Code with their claude.ai account and do not want their email address to reach the model context.

Good fit when

  • You signed in to Claude Code through claude.ai and do not want your email address in the model context
  • A demo or session recording is running and the request logs must not carry a personal address
  • You verify that the filter works by running claude --debug and looking for the prompt.context line
  • You want a sample of a small Claude Code hook module that changes context through on('prompt.context')
  • Other plugins are installed and you want one narrow filter with no side features

Not a fit when

  • A work account under an organization policy: plugin hooks may be disabled there
  • You need to protect other account data: the plugin removes only the userEmail block
  • You want a switch in Claude Code settings: there is no built-in one, which is why the plugin exists
  • You need the address substituted with another one: the plugin only cuts the block out

Example request

Connect the no-email plugin to Claude Code in this project and check with claude --debug that the userEmail block no longer reaches the context

Limitations

  • On Team and Enterprise logins and on machines with managed settings, organization policy may skip the plugin hooks. To check, run claude --debug and look for the line no-email: prompt.context bypassed by.
  • The plugin removes only the userEmail block, and the rest of the context and account data stay as they are.
  • The README has no install commands: the plugin sits in the .claude/skills/no-email folder of the repository and has to be installed by the rules Claude Code has for local plugins.
  • The plugin relies on the claude-code hook module interface, so it depends on the client version.
  • The plugin version is 0.1.0, a small project with one file of logic. The license is MIT.

How to disable. The plugin is turned off with the standard Claude Code tools for plugins and hooks. Deleting the no-email folder from where you put it and restarting the session is enough, and the userEmail block returns to the context.

FAQ

Why remove the email from the Claude Code context?

When you sign in through claude.ai the client adds a userEmail block with the address from ~/.claude.json, and there is no setting to disable it. The author does not want the address going to the model and into request headers.

How does the plugin work?

It subscribes to prompt.context, receives the finished context from the rest of the chain and returns it without the userEmail block.

How can I check that the plugin works?

Run claude --debug. If an organization policy skipped the plugin hooks, the output has the line no-email: prompt.context bypassed by.

Does the plugin work on Team and Enterprise?

Not guaranteed: an organization may disable the hooks, and then the block stays.

Where is the plugin code?

In .claude/skills/no-email: hooks/register.ts with the logic, hooks.json, .claude-plugin/plugin.json and the tests/register.test.ts test.

Discussion

No questions or reviews yet.

Plugins

A marketplace of 22 hook plugins for Claude Code: safety, cost control, observability and automation

PluginExtended access581Repository stars

MyPrivacy swaps configured names and company names for aliases in model input and restores the originals before tools run

PluginExtended access78Repository stars

A Codex plugin that shows in each session which personal data the agent sees and where it goes.

PluginBroad access110Repository stars

An offline personal-data firewall for agents: a Claude Code hook and a LiteLLM guardrail that mask emails, phones and cards.

PluginExtended access80Repository stars

Agent Governance Toolkit

Agent Governance Toolkit (Claude Code plugin)

Official

A Microsoft plugin for Claude Code whose hooks inspect prompts and tool calls against a policy and block dangerous commands.

PluginExtended access6.6KRepository stars

README in short

The README is very short. It calls the project a Claude Code hook that blocks your email from the system prompt, links a Reddit thread and warns that on Team and Enterprise logins organization policy may skip the hooks. The check is done with claude --debug. All the logic is in one file, register.ts.

README badge

Report a problem