Claude Code troubleshooting
Fix CLAUDE.md Not Working
Fix CLAUDE.md instructions that are missing or inconsistently followed by checking loaded context, file location, nested loading, imports, conflicts, and specificity.
Run `/context` first. If the file is absent, move it to a supported project, user, local, or nested location and start a new session. If it is present, remove conflicts and rewrite vague instructions as exact commands, paths, or measurable rules.
Match the symptom
- `/context` does not list the expected CLAUDE.md file.
- A root file loads but a nested file or path rule does not.
- An `@` import does not contribute its expected content.
- Claude can repeat a rule but applies it inconsistently.
First checks
Collect evidence before changing configuration
/context
/memory
/doctorclaude doctorDiagnosis 1
Check what actually loaded
Use Claude Code's context view before renaming or duplicating files.
- Look under Memory files for the expected project and local entries.
- Confirm the displayed path is the file you edited.
- Start a new session after changing startup-level instructions.
/context
/memoryDecision: If the file is absent, fix discovery. If present, move to conflict and specificity checks.
Diagnosis 2
Correct the file location and scope
Shared project guidance belongs in `./CLAUDE.md` or `./.claude/CLAUDE.md`; private project guidance belongs in `CLAUDE.local.md`.
- Confirm the session started inside the intended project hierarchy.
- Remember that subdirectory CLAUDE.md files load on demand when Claude reads files there.
- For conditional rules, verify the file is under `.claude/rules/` and its `paths` pattern matches.
Decision: Read one known matching file, then rerun `/context` to distinguish on-demand loading from a broken rule.
Diagnosis 3
Debug imports without duplicating content
An unquoted `@path` imports content relative to the CLAUDE.md containing it; code-formatted paths are only mentioned.
- Use `@AGENTS.md` outside backticks to import shared guidance.
- Check that the relative path resolves from the instruction file, not the shell working directory.
- Approve external imports when Claude Code presents the trust dialog.
- Reduce deep or unnecessary imports that consume startup context.
Decision: Use `/context` to confirm the parent CLAUDE.md loaded, then ask Claude to summarize the imported rule specifically.
Diagnosis 4
Remove conflicts and vague instructions
CLAUDE.md is contextual guidance rather than enforced configuration. Contradictory or broad statements reduce reliable application.
- Review user, project, local, nested, and rules files together.
- Replace ‘follow best practices’ with an exact action and evidence.
- Move hard prohibitions into permissions or hooks.
- Keep each CLAUDE.md concise; Anthropic recommends targeting under 200 lines.
/doctorDecision: Test one rewritten rule on a small task, then inspect the diff and command output rather than relying on Claude's summary.
If it still fails, send this evidence
A useful support request is reproducible and does not expose credentials.
- Claude Code version and working directory.
- The Memory files portion of `/context`, with personal paths redacted.
- Relevant CLAUDE.md and rule locations, including imports.
- Output from `/doctor` or `claude doctor` and one minimal reproduction.
Related paths
Fix the adjacent layer without starting over.
Official sources
Commands and product behavior were checked against first-party documentation on August 13, 2026. Interfaces and authentication flows change; recheck the source when applying this across a team.