feat(agentic-ai): track a shared global AGENTS.md - #66
Merged
Merged
Conversation
The global ~/AGENTS.md was untracked, stale, and inert. Railguard's installer created it on 9 Jul; three days later f9dbe01 made AGENTS.md the master agent doc and 29a2675 dropped the graphify reference, but both landed on the Claude side only. It still pointed at ~/.Codex/skills/graphify/, which no longer exists, and its four @rules/common/* imports resolved against a ~/rules/ that never existed — so none of its hand-authored content ever loaded. ~/.codex/AGENTS.md was a byte-identical copy with the same defects. Add agentic-ai/AGENTS.md as the tracked cross-agent set and move rules/ up from agentic-ai/Claude/ to agentic-ai/, since none of the four rule files are Claude-specific. CLAUDE.md slims to @AGENTS.md plus Claude-only notes, mirroring the repo-root split. install.sh now symlinks AGENTS.md and rules/ into ~/.claude/, ~/.codex/, and ~/; validate.sh checks all six. The siblings are required, not belt-and-braces: Claude Code resolves @-imports against the deployed directory of the importing file, does not follow '../', and for a symlinked file resolves relative to the symlink rather than its target. All three behaviors were verified with live claude -p probes, as was the CLAUDE.md -> @AGENTS.md -> @rules/... chain. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ulises-c
force-pushed
the
feat/global-agents-md
branch
from
July 28, 2026 20:59
eb4684a to
e7e0d0f
Compare
Running install.sh confirmed the caveat flagged on #66: 'railguard install' re-injects its guardrail block into ~/.claude/CLAUDE.md, which is a symlink to the tracked file. With AGENTS.md also carrying a copy, and CLAUDE.md importing AGENTS.md, Claude loaded the block twice. The install also showed the copy here was stale: railguard v0.5.1 writes a slim five-line block, while the one hand-carried into AGENTS.md was the old long-form version that railguard does not maintain and would never refresh. Drop it from AGENTS.md and let railguard own it per-tool in CLAUDE.md. Cross-agent railguard guidance already lives in rules/common/railguard.md. The explanatory note avoids reproducing the start/end marker strings — an unpaired marker in a file railguard scans could confuse its injector. Verified after deploying: validate.sh passes all checks, AGENTS.md holds zero markers, CLAUDE.md holds exactly one pair, and AGENTS.md + rules/ resolve from all three deployed locations. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the global agent instruction set under version control, mirroring the
repo-root
AGENTS.md/CLAUDE.mdsplit adopted inf9dbe01.The problem: untracked, stale, and inert
Railguard's installer created
~/AGENTS.mdon 9 Jul. On 12 Jul twochanges landed in this repo — and both went to the Claude side only:
~/AGENTS.md?f9dbe0129a2675So it froze at its 9 Jul state, still pointing at
~/.Codex/skills/graphify/,a directory that no longer exists.
The more serious finding is that it never worked at all. Its four
@rules/common/*imports resolve against~/rules/, which does not exist —only
~/.claude/ruleswas ever symlinked. Every hand-authored line in that filehas been dead since it was created.
~/.codex/AGENTS.mdwas a byte-identicalcopy with identical defects.
That inertness is likely why the drift went unnoticed for two weeks: nothing
observably changed when it went stale.
Import semantics, verified not assumed
The first draft of this change used
@../AGENTS.md. Rather than trust it, Iprobed the real behavior with live
claude -pruns. Three results, allload-bearing:
@rules/common/x.md(at or below the file's own dir)@../AGENTS.md(parent)CLAUDE.md→@AGENTS.md→@rules/...(transitive)The second row invalidated the first draft — and since
~/.claude/CLAUDE.mdis asymlink into this repo, that broken version was briefly live. The committed
design uses sibling imports only.
Rows 1 and 3 together are also the explanation for the inert
~/AGENTS.md: adeployed instruction file only sees
rules/ifrules/sits next to it.The change
agentic-ai/AGENTS.md— new, the tracked cross-agent instruction set.agentic-ai/rules/— moved up fromagentic-ai/Claude/rules/. None of thefour rule files are Claude-specific.
agentic-ai/Claude/CLAUDE.md— slimmed to@AGENTS.mdplus Claude-onlynotes.
install.sh— symlinksAGENTS.mdandrules/into~/.claude/,~/.codex/, and~/. The siblingrules/is mandatory, not belt-and-braces;omitting it is precisely the bug that made the old file inert.
validate.sh— checks all six links.Verification
shellcheck --severity=warningoninstall.shandvalidate.sh— clean(no second backup), symlinks resolve to the tracked file
AGENTS.md,rules/common/general.md, andrules/bash/style.mdall resolve from each of the three deploy locationsclaude -pprobes for the four import behaviors aboveNot done / please review
bash agentic-ai/Claude/install.shcreates thesymlinks; it backs up both existing
AGENTS.mdfiles first. Not run here —it writes to
$HOMEand performs acargo install.~/ruleswill appear as a dotless directory in$HOME. That is the costof making
~/AGENTS.mdfunctional rather than decorative. To keep$HOMEclean instead, drop
"$HOME"from the loop ininstall.shand deploy only to~/.claude/and~/.codex/.railguard:start/endblock intoCLAUDE.mdon the next
railguard install, duplicating the copy now carried inAGENTS.md. Worth a follow-up if it shows up.docs/CHANGELOG.md— both add an Unreleased section atthe same insertion point. Trivial to resolve on whichever merges second.
🤖 Generated with Claude Code