Join our Newsletter — 33% off our NHI Course

Are Claude Code instruction files safe once CLAUDE.md exists?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20842
Topic starter  

TL;DR: 56.9% of the repos studied saw no change when AGENTS.md support arrived, according to Dam Secure's repository analysis. Claude Code can still skip shared security guidance when a CLAUDE.md file takes precedence, so teams need explicit inheritance and review.

Editorial analysis by NHI Mgmt Group, based on content published by Dam Secure: “Does Claude Code read AGENTS.md? Why your security rules might not be loading”.

Key questions

Q: Why do local agent files create governance risk for repository rules?

A: Local agent files create governance risk because they can override central repository rules at the workspace level and vary by developer machine.

Q: How does instruction precedence work in Claude Code?

A: Instruction precedence in Claude Code is the order in which layered instruction files are read and applied, so a more specific local file can override broader repository guidance.

Q: How should teams govern shared instructions for coding agents?

A: Teams should govern shared instructions through one documented inheritance model that defines which repository files, local overrides and session prompts are authoritative.

Practitioner guidance

  • Define a single inheritance model for agent instructions Choose whether shared security rules live in AGENTS.md, managed CLAUDE.md, or both, then document which file wins when they conflict.
  • Verify the loaded instructions in every agent session Check the startup output, /memory and /config so developers can confirm which instruction file Claude Code actually loaded before trusting the session.
  • Move non-negotiable controls into managed settings Keep the minimum mandatory rules in an organisation-controlled CLAUDE.md so they survive local repo overrides and personal workspace files.

Bottom line: Claude Code can silently stop using shared AGENTS.md guidance when a local CLAUDE.md or CLAUDE.local.md takes precedence.

Glossary terms: AGENTS.md, Claude Code Routine, CLAUDE.md, Instruction precedence

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →



   
Quote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.