Skip to content
BETAGuardrails are in beta. The library, the configuration format and the CLI command can still change.

Guardrails / claude

Claude reads the instruction file the repository keeps

claude/instructions-symlinked@v1

CLAUDE.md is a symbolic link to AGENTS.md rather than a second copy of it or nothing at all.

Idclaude/instructions-symlinked
Versionv1
Categoryclaude
Default severitywarning
Interpreterpython3
Timeout30 seconds
Violations tolerated0
Collectsfiles

Collectors

This guardrail gathers nothing itself. It depends on the collectors below, which the CLI runs once per build before any check, and reads what they found out of GUARDRAIL_FACTS. A collector that collects nothing skips this guardrail rather than failing it.

CollectorGathersInputs it is given
filesPresence, 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, passed straight through. Configuring one in buildnote.json changes what is collected, and two guardrails configured the same way share the one collection.

Configuration

json
{
  "guardrails": {
      "failOn": "error",
      "checks": [
          {
              "use": "claude/instructions-symlinked@v1",
              "severity": "warning",
              "with": {
                  "paths": "CLAUDE.md,AGENTS.md"
              },
              "exemptions": []
          }
      ]
  }
}

Inputs

InputDescriptionDefaultEnvironment variable
pathsThe 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.mdGUARDRAIL_INPUT_PATHS

How to fix

Point the alias at the file the repository actually keeps:

bash
ln -sf AGENTS.md CLAUDE.md
git add CLAUDE.md

Claude Code reads CLAUDE.md; the agents.md convention every other agent follows is AGENTS.md. A repository with only one of them instructs only some of the agents working in it, and a repository with two files instructs them differently within a month.

Check the link is committed as a link: git config core.symlinks must be true on a Windows checkout, or git writes a text file holding the target's name and both agents read that.

More in claude

All 3 claude guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412