Claude Code sometimes skips reading CLAUDE.md at session start
Resolved 💬 4 comments Opened Apr 6, 2026 by mstang Closed Jun 1, 2026
Problem
Claude Code sometimes skips reading CLAUDE.md at session start, which means custom session lifecycle protocols defined there are not followed.
Context
We use CLAUDE.md to define a mandatory session start protocol for a case management system (CaseMgr). The protocol requires the agent to:
- Detect the current worktree case first (
worktrees-getby path/hostname) - Only fall back to global
preferences-get→current_case_idif not in a worktree
This distinction matters because current_case_id is one per user across all machines, while the worktree case is specific to the current directory on the current machine.
Failure Mode
When Claude Code skips CLAUDE.md:
- The agent calls
preferences-getdirectly, getting a stalecurrent_case_idfrom another machine - It resumes work on the wrong case (in this instance, a completed case from a different worktree)
- After context compaction, the agent has no memory of the correct case and no protocol to recover
Impact
- Agent works on the wrong case entirely
- Multi-machine workflows break — work machine picks up home machine's current case
- Session recovery after compaction fails because the wrong case is loaded
- User has to manually correct the agent every time
Expected Behavior
CLAUDE.md should always be read at session start, before any tool calls. The instructions in CLAUDE.md are user-defined mandatory protocols — skipping them defeats the purpose.
Environment
- Claude Code CLI v2.1.81 and v2.1.91
- Ubuntu Linux
- MCP server with session lifecycle management
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗