razor
AGENTS.md8 starsChanged 48 days agoMITView on GitHub
razor is one plugin for Claude Code, Codex and Antigravity: a checklist before new code and a few checks behind it, so a small task stays small. Its hooks and scripts are dependency-free Node.js and run with Node.js 22 or later and Git; there is no install or build step. This repository is Foundry's razor submodule and ships from main. The README serves every host and names the host beside every host-specific instruction and result. Results identify the actual host,…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Before changing a check, read how razor works.
- Distinctive: line 11
Before adding or renaming a setting, read settings.
- Very specific: line 12
Before touching Codex behavior, read the Codex setup guide.
- Distinctive: line 13
Before touching a README number, read the numbers.
- Distinctive: line 14
Before a release, read the changelog and CONTRIBUTING.md.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
razor
razor is one plugin for Claude Code, Codex and Antigravity: a checklist before new code and a
few checks behind it, so a small task stays small. Its hooks and scripts are dependency-free Node.js and run
with Node.js 22 or later and Git; there is no install or build step. This repository is Foundry's
razor submodule and ships from main.
Start here
- Before changing a check, read how razor works; each check speaks at most once and the retry always goes through.
- Before adding or renaming a setting, read settings.
- Before touching Codex behavior, read the Codex setup guide; patch guards only see previewable local
apply_patchchanges. - Before touching a README number, read the numbers.
- Before a release, read the changelog and CONTRIBUTING.md.
Rules that outrank everything
- One package serves the three hosts. Shared checks live outside the host adapters, and a new hook event needs an entry in
hooks/hooks.json,hooks/codex-hooks.jsonand, when Antigravity has the event, the roothooks.json. - The three manifests,
.claude-plugin/plugin.json,.codex-plugin/plugin.jsonandplugin.json, carry the same version, changed together; the suite fails when they differ. Foundry's catalogs carry no version for razor and only movesource.sha. - razor never edits code, manifests or lockfiles and never grants a permission; every check is a message to the assistant.
Commands
| Command | Purpose | Cost |
node --test tests/*.test.js | The suite | Local fixtures inside the plugin root; fails from a checkout under the system temp directory |
node scripts/git-hooks/check-readme-nav.js | The root README has its nav, and every heading anchor linked from a tracked Markdown file resolves | Local |
node scripts/build-windows-launchers.js --write | After editing hooks/windows-launcher.ps1 or a hook in hooks/codex-hooks.json, regenerate that file's commandWindows launchers; the suite fails naming the first stale one | Local |
claude plugin validate . | Claude Code package shape | Local |
agy plugin validate . | Antigravity package shape | Local; needs the Antigravity CLI |
git config core.hooksPath scripts/git-hooks | One-time: the pre-commit hook runs the suite and the nav check | Local |
Where things live
| Path | Content |
hooks/ | pre-tool-use.js runs dep-guard.js, import-guard.js, manifest-guard.js and file-meter.js; build-ledger.js, mode-toggle.js, session-start.js and subagent-start.js cover the other events; codex-hook.js and antigravity-hook.js translate those hosts' events; razor-lib.js and lib/ hold the shared state and the three host adapters; windows-launcher.ps1 is the fnm fallback of each commandWindows in codex-hooks.json |
scripts/unused-deps.js | The scanner behind the unused skill; scripts/build-windows-launchers.js builds and checks the Windows launchers; scripts/git-hooks/ holds the commit gates |
skills/unused/ | The one skill |
tests/ | The node:test suite and the contract/ fixtures |
docs/knowledge/ | How it works, settings, Codex setup, benchmark details and the changelog |
.claude-plugin/, .codex-plugin/, plugin.json, hooks.json | Host manifests with the same version; the Codex manifest names hooks/codex-hooks.json, and the root manifest and hooks.json are what Antigravity reads |
Conventions
The README serves every host and names the host beside every host-specific instruction and
result. Results identify the actual host, model, source and date; keep losses and limits, show
Not measured where evidence is absent, and never present a Claude Code result as a Codex
result. Benchmark runners, datasets and experiments are not part of the package; tests/ holds
functional tests only. CLAUDE.md imports this file; keep shared contributor facts here.
Pitfalls
- Claude Code substitutes
${CLAUDE_PLUGIN_ROOT}in skill text; Codex and Antigravity do not. They need a path relative to the skill file. tests/dispatcher.test.jsandtests/contract.test.jsbuild workspaces inside the plugin root.disp-ws-*/andcontract-ws-*/residue from a failed run is ignored, never staged.- Files written by a shell command skip the file checks in every host. Only the assistant's own editing tool passes through them.
- Antigravity has no session, prompt or subagent event. An injected message reaches only the model call it is attached to, so the ladder and the drift note go with every call, except that the calls answering the build check carry no drift note, the ledger baseline only the first call of a conversation, and the toggle and the subagent checklist do not exist there; a turn starts at the call whose
invocationNumis 0, so a Stop continuation stays in its turn and a turn with no Stop still ends.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

