Claude reads the instruction file the repository keeps
claude/instructions-symlinked@v1
CLAUDE.md is a symbolic link to AGENTS.md, not a second copy of it or missing altogether.
| Id | claude/instructions-symlinked |
| Version | v1 |
| Category | claude |
| Default severity | warning |
| Interpreter | python3 |
| Timeout | 30 seconds |
| Violations tolerated | 0 |
| Collects | files |
Collectors
This guardrail doesn't gather anything itself. It relies on the collectors below, which the CLI runs once per build before any check, and reads what they found from GUARDRAIL_FACTS. If a collector collects nothing, this guardrail is skipped, not failed.
| Collector | Gathers | Inputs it is given |
|---|---|---|
files | Presence, size and line counts of the well known files a repository is expected to carry, plus any extra path the guardrail asks for. | paths |
The inputs above are this guardrail's own inputs, passed straight through to the collector. Setting one in buildnote.json changes what is collected, and two guardrails configured the same way share a single collection.
Configuration
{
"guardrails": {
"failOn": "error",
"checks": [
{
"use": "claude/instructions-symlinked@v1",
"severity": "warning",
"with": {
"paths": "CLAUDE.md,AGENTS.md"
},
"exemptions": []
}
]
}
}Inputs
| Input | Description | Default | Environment variable |
|---|---|---|---|
paths | The alias first, then the file it must be a symbolic link to. Both are relative to the directory the CLI runs in. | CLAUDE.md,AGENTS.md | GUARDRAIL_INPUT_PATHS |
How to fix
Point the alias at the file the repository actually keeps:
ln -sf AGENTS.md CLAUDE.md
git add CLAUDE.mdClaude Code reads CLAUDE.md, while every other agent follows the agents.md convention and reads AGENTS.md. With only one of the two files, only some of the agents working in the repository get instructions. With two separate files, the instructions drift apart within a month.
Make sure the link is committed as a link. On a Windows checkout, git config core.symlinks must be true; otherwise git writes a text file containing the target's name, and that is what both agents read.
More in claude
claude/cli-safe-flags. No Claude CLI invocation the build ran asked to skip its approval step.claude/cli-structured-output. Every headless Claude CLI invocation the build ran asked for structured output.