anthropics / anthropics/claude-code
CLAUDE_CONFIG_DIR does not redirect user memory — ~/.claude/CLAUDE.md still loaded (undocumented)
- Langage dominant
- Python
- Étoiles
- 145k
- Forks
- 23.1k
- Métriques de merge des PR
- Métriques de PR en attente
Description
**Version:** Claude Code v2.1.238, macOS (darwin 25.5)
**Setup:** A second, isolated environment via `CLAUDE_CONFIG_DIR=$HOME/.claude-vanilla`, which contains its own `CLAUDE.md`, `settings.json`, and skills.
**Observed:** `/context` in a session launched with the custom config dir lists **both** `$CLAUDE_CONFIG_DIR/CLAUDE.md` (and its `@`-imports, loaded without prompting) **and** `~/.claude/CLAUDE.md` — the literal default path — as loaded memory files. The "external includes" trust dialog fires for the `@`-import found in `~/.claude/CLAUDE.md`, naming that imported path. Declining keeps the import unresolved, but the pointer file itself still enters context in every session.
**Docs gap:** memory.md documents `~/.claude/CLAUDE.md` as user memory and sessions.md documents `CLAUDE_CONFIG_DIR` as relocating storage; neither specifies whether `~/.claude/CLAUDE.md` remains in the memory lookup under a custom config dir. Whichever behaviour is intended, it's currently unspecified — and the current behaviour breaks the isolated-second-environment use case (A/B baselining against vanilla, clean-room configs), since the default environment's memory leaks into the custom one.
**Repro:**
1. Put an `@`-import in `~/.claude/CLAUDE.md`.
2. Create `~/.claude-vanilla/` with its own `CLAUDE.md`.
3. `CLAUDE_CONFIG_DIR=~/.claude-vanilla claude`, then run `/context` → `~/.claude/CLAUDE.md` appears in memory files, and the trust dialog names its import.
**Ask:** document the intended lookup order under `CLAUDE_CONFIG_DIR`; ideally have it fully redirect user memory (or provide an explicit isolation flag).
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Read memory.md and sessions.md, then reproduce the reported behavior with CLAUDE_CONFIG_DIR and /context. Trace how the documented user-memory locations relate to the custom config directory, and confirm the intended lookup order with maintainers. Done means the docs clearly specify whether ~/.claude/CLAUDE.md is loaded and how to obtain an isolated environment.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- shell
- Domaine
- cli, documentation
- Type d'issue
- Documentation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100