Skip to content
Back to search

email-guard

MarketplaceWorks with Claude CodeGitHub

email-guard, a Claude Code mod that keeps your Claude account email away from the model.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/anthonylau--claude-code-email-guard/badge.svg)](/listings/anthonylau--claude-code-email-guard)

HTML

<a href="/listings/anthonylau--claude-code-email-guard"><img src="/api/listings/anthonylau--claude-code-email-guard/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

claude plugin marketplace add anthonylau/claude-code-email-guard
claude plugin install email-guard@email-guard

Then start a new session. Installed into a running session, it has Claude Code render the context again without your email, but the model may already have read it in an earlier turn.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 14 lines
  1. {
  2. "name": "email-guard",
  3. "description": "email-guard, a Claude Code mod that keeps your Claude account email away from the model.",
  4. "owner": {
  5. "name": "anthonylau"
  6. },
  7. "plugins": [
  8. {
  9. "name": "email-guard",
  10. "source": "./",
  11. "description": "Keeps your Claude account email out of the model's context, asks you before any tool call that contains it or reads where it is kept, and redacts it from tool results."
  12. }
  13. ]
  14. }
README.md · README · 94 lines
  1. # Email Guard for Claude Code
  2. **Keep your Claude account email away from the model.**
  3. Claude Code tells the model your account email at the start of every conversation. From there it
  4. can end up in a commit, a sign-up form, an API request or a file. Email Guard is a Claude Code mod
  5. (early access) that stops that:
  6. - **The model never sees your email.** It is removed from the conversation before the model reads
  7. it.
  8. - **You're asked before it's used.** Any tool call that contains your email, or reads where it is
  9. stored, needs your approval every time. Allow rules and auto mode can't approve it for you.
  10. - **It's redacted from what the model reads.** If your email shows up in a file, `git log`, a web
  11. page or a file you @-mention, the model sees `[email redacted]` instead.
  12. ## Install
  13. ```sh
  14. claude plugin marketplace add anthonylau/claude-code-email-guard
  15. claude plugin install email-guard@email-guard
  16. ```
  17. Then start a new session. Installed into a running session, it has Claude Code render the
  18. context again without your email, but the model may already have read it in an earlier turn.
  19. ## Limits
  20. - It guards your Claude account email only. Your git `user.email` can be a different address, and
  21. commits made with it are untouched.
  22. - Text matching can't catch an email that is assembled at run time, such as a script that reads
  23. `.claude.json` and sends it on, or a base64-encoded copy. Hiding the email from the model covers
  24. most of those cases, because the model can't encode an address it doesn't know. An email you
  25. type into a prompt yourself is yours to share, and the model sees it.
  26. - If the model reads a file with the address redacted and then edits it, the edit can fail to
  27. match the original text where the address was.
  28. It works alongside Claude Code's built-in privacy mod (`cc-plugin-privacy`): a call that mod refuses
  29. stays refused, with its reason.
  30. Written and tested on Claude Code 2.1.327. The mod API may change between releases without notice.
  31. ## How it works
  32. Email Guard is a [mod](https://github.com/anthropics/claude-code/tree/main/mods): a plugin whose
  33. `hooks/register.ts` hooks the engine's events.
  34. | Event | What it does |
  35. | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  36. | `session.start` | reads the address from `oauthAccount` in `.claude.json` (under `CLAUDE_CONFIG_DIR` if set) and `CLAUDE_CODE_USER_EMAIL`; in a running session, re-renders the context |
  37. | `prompt.context` | drops the `userEmail` block, adding the address it names |
  38. | `prompt.attachment` | drops the `userEmail` section a context re-read announces, and redacts the address from reminders, @-mentioned files and hook context |
  39. | `tool.check` | asks for a call that holds the address or reaches where it is kept, unless the engine already denies it |
  40. | `tool.call` | redacts the address from the result, or withholds a result it can't redact |
  41. When nobody is there to approve a call, as in a background subagent or `claude -p`, the call is
  42. refused. A toast explains why a call was flagged, since the terminal's permission dialog doesn't.
  43. ### What counts as your email
  44. The address matches in any case, with any `+tag`, with `@` and `.` URL-encoded (`%40`), as HTML
  45. entities, or spelled out (`[at]`, `(dot)`). A Gmail address also matches with dots anywhere in
  46. its user part and at `googlemail.com`, since Gmail delivers all of those to one inbox.
  47. A call also asks for approval when its input names any of these, even without the address:
  48. | Pattern | Why |
  49. | ---------------------------------------------------------- | ------------------------------------------ |
  50. | `.claude.json` | where Claude Code keeps your account email |
  51. | `.credentials.json` | Claude Code's sign-in file |
  52. | `oauthAccount`, `CLAUDE_CODE_USER_EMAIL` | your account details |
  53. | `claude auth` | prints your account email |
  54. | `git … user.email`, `GIT_{AUTHOR,COMMITTER}_{EMAIL,IDENT}` | reads or sets your git email |
  55. A tool result that can't be redacted is withheld, and so is a reminder the mod fails to check.
  56. ## Development
  57. Run from source:
  58. ```sh
  59. git clone https://github.com/anthonylau/claude-code-email-guard
  60. claude --plugin-dir ./claude-code-email-guard
  61. ```
  62. Test:
  63. ```sh
  64. claude plugin validate .
  65. claude plugin test . # 14 tests, claude-code/testing kit
  66. ```
  67. ## License
  68. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.