ci(pre-commit): refuse CLAUDE.md files by hook
Claude Code reads CLAUDE.md in place of AGENTS.md, so a stray CLAUDE.md, CLAUDE.local.md or .claude/CLAUDE.md at any depth leaves an agent without this repository's guidance, and nothing reports it. A language: fail hook refuses such a file at commit time. Refs: #244 Assisted-by: Claude Code
This commit is contained in:
1 parent
bca13f4139
commit
de16995f35
1 file changed
+10
@@ -126,6 +126,16 @@ repos:
|
||||
require_serial: true
|
||||
fail_fast: true
|
||||
|
||||
# apm compile (target claude), a tool's project init or a skill can create a CLAUDE.md, and
|
||||
# the failure is silent: the agent gets no guidance and no error.
|
||||
- id: refuse-claude-md
|
||||
name: Refuse CLAUDE.md files
|
||||
description: refuse CLAUDE.md, CLAUDE.local.md and .claude/CLAUDE.md at any depth
|
||||
entry: a CLAUDE.md file makes Claude Code ignore every AGENTS.md; delete it
|
||||
language: fail
|
||||
files: (^|/)(\.claude/)?CLAUDE(\.local)?\.md$
|
||||
stages: ['pre-commit']
|
||||
|
||||
- repo: meta
|
||||
hooks:
|
||||
- id: check-hooks-apply
|
||||
|
||||
Reference in new issue
Block a user