From de16995f350d78e4e8cefe0896ec2411d6a2eefb Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Mon, 23 Nov 2026 19:14:00 +0000 Subject: [PATCH] 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 --- .pre-commit-config.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25c30c4..12e411f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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