claude-code - 💡(How to fix) Fix `# userEmail` and `# currentDate` auto-injected into MEMORY.md context cannot be suppressed [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53231Fetched 2026-04-26 05:21:02
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Code Example

# userEmail
The user's email address is ...

# currentDate
Today's date is ...

---

{
  "memory": {
    "injectUserEmail": false,
    "injectCurrentDate": false
  }
}
RAW_BUFFERClick to expand / collapse

Describe the bug / feature request

Claude Code automatically appends two sections to the MEMORY.md context block injected into every session:

# userEmail
The user's email address is ...

# currentDate
Today's date is ...

These appear in the system-reminder block at session start, after the actual MEMORY.md file contents. The file itself does not contain them — Claude Code appends them at injection time.

Problem

  • currentDate is ephemeral/stale the moment a session spans midnight or is resumed later. It misleads the model about recency.
  • userEmail is PII that users may not want injected into every session context.
  • There is no setting to opt out of either injection.

Expected behavior

A settings.json opt-out, e.g.:

{
  "memory": {
    "injectUserEmail": false,
    "injectCurrentDate": false
  }
}

Or simply: do not inject currentDate — the model can call a tool or read hook context for current time when it actually needs it.

Environment

  • Claude Code CLI (latest)
  • macOS

extent analysis

TL;DR

Adding a settings.json file with opt-out flags for injectUserEmail and injectCurrentDate may resolve the issue.

Guidance

  • Consider adding a settings.json file with the proposed structure to opt out of injecting userEmail and currentDate.
  • Verify that the Claude Code CLI respects the settings.json file and stops injecting the unwanted sections.
  • If the model needs the current date, explore alternative approaches, such as using a tool or hook context to retrieve the current time.
  • Review the documentation for the Claude Code CLI to ensure that the settings.json file is a supported configuration method.

Example

{
  "memory": {
    "injectUserEmail": false,
    "injectCurrentDate": false
  }
}

Notes

The effectiveness of this solution depends on the Claude Code CLI supporting the proposed settings.json structure. If this is not a supported configuration method, alternative solutions may be necessary.

Recommendation

Apply workaround: add a settings.json file with the proposed opt-out flags, as this is a non-invasive and targeted approach to addressing the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

A settings.json opt-out, e.g.:

{
  "memory": {
    "injectUserEmail": false,
    "injectCurrentDate": false
  }
}

Or simply: do not inject currentDate — the model can call a tool or read hook context for current time when it actually needs it.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix `# userEmail` and `# currentDate` auto-injected into MEMORY.md context cannot be suppressed [1 participants]