update-agents-md
Installation
SKILL.md
Update AGENTS.md
Refresh the AGENTS.md that scopes the user's current working directory so its claims match the code today. Claude Code 2.1.277+ reads this file when no project CLAUDE.md is on the path; other agents read it directly.
Scope rules
- Target file: the closest
AGENTS.mdtocwdwalking upward. Prefer the app/package-level file whencwdis inside one; only touch the monorepo rootAGENTS.mdwhencwdis at the root (or no package-level file exists). - Legacy
CLAUDE.md. If noAGENTS.mdexists in scope but a projectCLAUDE.md,.claude/CLAUDE.md, orCLAUDE.local.mddoes, stop. Claude Code reads that file and ignoresAGENTS.mdwhile it remains. Ask the user to rename it toAGENTS.md, then continue this skill against the renamed file. Do not edit theCLAUDE.mdin place. - Shadowing. If the target
AGENTS.mdhas a projectCLAUDE.mdin the same directory or any parent, flag it before editing. Claude Code will not load theAGENTS.mduntil that file is migrated. - Never invent an
AGENTS.md. If none exists in scope and there is no legacyCLAUDE.mdto migrate, stop and tell the user. - Never touch
~/.claude/CLAUDE.md(global user instructions) or other packages' instruction files — single-package scope only. ## Task-specific plan/ scratch sections: prune, don't preserve. Entries for work that already landed are cruft — remove them (see the task-cruft sweep in step 5). Keep only entries for tasks still in flight; when you can't tell, keep and flag in the summary.
Detect progressive-disclosure structure
Before doing anything else, check whether the target AGENTS.md is a thin index that defers deep content to a context/ (or similar) directory of sibling .md files. Signals: