[Feature Request] Mechanism to make CLAUDE.md instructions binding/mandatory, not advisory
Problem Statement
Currently, CLAUDE.md instructions are loaded as context but are fundamentally advisory. Claude can choose to ignore or forget these instructions mid-session. This creates a critical gap for users trying to enforce quality/safety policies.
Real-World Example
We implemented an "Anti-ABK" (Assumption-Based Knowledge) protocol requiring Claude to call hemisphere-languages MCP tools to verify syntax before writing code. Despite:
- Clear instructions in
CLAUDE.md - A
PreToolUsehook that blocks Edit/Write without verification - Behavioral checkpoint documentation
Claude still wrote syntactically invalid TypeScript files. The hook verified that lang_search was called, but couldn't verify that Claude actually applied the verification results.
The Architectural Gap
| Layer | Enforcement Level |
|-------|------------------|
| CLAUDE.md instructions | Advisory - Claude can ignore |
| PreToolUse hooks | Tool-blocking only - can't enforce cognition |
| PostToolUse hooks | Reactive only - damage already done |
| MCP tools | Optional - Claude chooses to call |
What's Missing
- No "strict mode" that makes
CLAUDE.mdrules non-bypassable - No cognitive enforcement - hooks block tools, not reasoning patterns
- No output validation - hooks can't verify that tool output quality matches requirements
- No binding between verification and action - calling a verification tool doesn't guarantee applying its results
Suggested Solutions
- Mandatory instruction flag in
CLAUDE.md:
``markdown``
<!-- @mandatory -->
## Anti-ABK Protocol
You MUST call lang_search before writing code.
- PostToolUse validation hooks that can:
- Run linters/compilers on written files
- Revert changes if validation fails
- Force Claude to retry with explicit error context
- Bound verification pattern:
- Require verification tool output hash to be referenced in edit
- Hook validates that edit content matches verified patterns
- Cognitive checkpoints (ambitious):
- Hook that fires before Claude completes reasoning
- Can inject "STOP - did you verify?" prompts
- Block response generation until checkpoint satisfied
Impact
Without mandatory enforcement, any safety/quality policy in CLAUDE.md is only as strong as Claude's willingness to follow it in that moment. This undermines the entire purpose of instruction files for enterprise/production use cases.
Environment
- Claude Code CLI
- Using PreToolUse hooks for enforcement
- MCP servers for verification tools
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗