Plugin safety: third-party plugins can silently disable auto_memory via env vars

Resolved 💬 5 comments Opened Jun 8, 2026 by HN84956371-code Closed Jul 15, 2026

Summary

A third-party plugin (claude-mem by thedotmack) silently disables Claude Code's built-in auto_memory system during installation by writing CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 to ~/.claude/settings.json env block. There is no user confirmation, no warning, and no protection against this.

This caused a power user with 75+ accumulated memory files to experience complete apparent memory loss on their next session.

The Problem

  1. CLAUDE_CODE_DISABLE_AUTO_MEMORY is an official env var toggle (per #23544)
  2. Any plugin installer can write to ~/.claude/settings.json freely
  3. There is no mechanism to:
  • Warn users when a plugin modifies core behavior settings
  • Require user consent before disabling built-in features
  • Sandbox plugin installers from modifying global settings
  • Show what settings changed after plugin installation

What Happened

  • User had 75 memory files (user profile, 25+ behavioral rules, 20+ active projects) in memory/MEMORY.md
  • Installed claude-mem plugin
  • Plugin's install.tsdisableClaudeAutoMemory() wrote CLAUDE_CODE_DISABLE_AUTO_MEMORY=1
  • Next session: Claude had zero memory, didn't recognize the user
  • Memory files were intact on disk but not loaded
  • User spent ~30 minutes diagnosing what appeared to be catastrophic data loss

Suggestion

  1. Protected settings: Core behavior toggles like auto_memory should require explicit user action (e.g. claude config set auto_memory false), not be silently writable by plugin installers
  2. Settings change audit: After plugin installation, show a diff of what changed in settings.json
  3. Plugin manifest declarations: Require plugins to declare in their manifest what settings they modify, and surface this to users before installation
  4. Sandboxing: Plugin installers should not have unrestricted write access to ~/.claude/settings.json

Environment

---
Reported via Claude Code session 2026-06-08.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗