Claude Code rules: CLAUDE.md is context, not enforcement — use deny rules and PreToolUse hooks

shoumikgoswami · reddit · 2026-10-30

Putting "never do X" in CLAUDE.md isn't enforcement — Anthropic's docs describe it as context, not enforced configuration. The author lays out three layers:

Suggested test: in a disposable repo, protect a dummy file and ask Claude to edit it — verify execution is actually blocked, not just verbally declined. Takeaway: use prompt files for workflow, enforcement controls for boundaries that must hold even when the model errs.

Original post →

More from coding & agent

coding & agent channel →