Codex builds.
Pathrule remembers.
AGENTS.md plus scoped team context. Pathrule reaches Codex through hooks, including one that runs when you submit a prompt, and brings the knowledge your workspace shares, selected for the task.
Without
Done. The page fetches /api/orders in a useEffect.
Uses fetch where the team uses the api client.2 tries
With Pathrule
before Codex acts: 3 notes for features/orders
- Use the api client, not fetch
- React Query for data
- Shared buttons from ui/
Done. Orders load through the api client with React Query.
Matches what the team already decided.1 try
How Pathrule reaches Codex.
- files it reads: yesfiles it reads
- AGENTS.md and .codex config
- before each prompt: yesbefore each prompt
- Prompt hook
- around tool calls: yesaround tool calls
- Tool hooks
- when it asks: yeswhen it asks
- Local, or Remote MCP
The same delivery as Claude Code: hooks before each prompt and around tool calls, with AGENTS.md kept current.
AGENTS.md vs Pathrule
- Native instruction files can be scoped by path and shared through version control.
- Context depends on the files and guidance the client loads.
- Changes follow repository permissions and its Git or pull-request history.
- Tied to whichever tools read AGENTS.md natively.
- Onboarding follows the repository’s instruction setup.
- Path-scoped slice. Only what applies to the current directory.
- Token cost scales with the relevant slice, not the whole rule set.
- Reviewable rules and skills with server-enforced workspace access.
- Same content reaches Claude Code, Cursor, GitHub Copilot and Windsurf, each in its own format.
- Onboarding = "join the workspace; the right rules show up on the right paths".
Long read: AGENTS.md vs Pathrule: when each makes sense.
What Pathrule adds to Codex
- Hook-time injectionBefore the first tool callPathrule runs at the hooks Codex already exposes, including the one that fires when you submit a prompt, so the scoped slice arrives before Codex acts on each prompt, not only on session start.
- Path-indexed graphSubtree, not whole fileA rule attached to
/services/billingonly fires when Codex is acting under that path. AGENTS.md keeps the global rules; Pathrule keeps the scoped ones. - Three node typesMemories, rules, skillsMemories carry team-learned context. Rules are advisory or strict. Skills are multi-step playbooks Codex can invoke by name.
- Same content, every agentClaude Code, Cursor, Copilot, WindsurfThe same memories, rules and skills reach Claude Code, Cursor, GitHub Copilot and Windsurf, each through the hooks, files and MCP that client supports. How each is connected.
Questions.
What is AGENTS.md?
The open standard instruction file read natively by OpenAI Codex, GitHub Copilot, Cursor, Windsurf, Amp, Warp, Aider, Devin, Gemini CLI and Amazon Q. It sits at the repository root and can be nested in any directory below it; Codex concatenates the files from the root down to your working directory and ships that content on every turn.
What does Pathrule add to Codex?
A path-scoped layer above AGENTS.md. Pathrule indexes memories, rules and skills by path and injects the matching slice into Codex at hook time, before Codex acts on each prompt.
Do I have to delete AGENTS.md to use Pathrule?
No. Pathrule sits above AGENTS.md. Your existing file keeps working. AGENTS.md carries the repository-wide constants; Pathrule carries the path-scoped knowledge AGENTS.md cannot model well.
Why does AGENTS.md break down for team-scale work?
AGENTS.md can be nested and committed for team use, and Codex also has opt-in local memories. The remaining gap is sharing newly learned workspace knowledge across agent vendors, selecting it for the task and enforcing a strict requirement where a blocking hook exists. Codex's AGENTS.md chain has a documented 32 KiB combined size cap.
How does Pathrule install into Codex?
Run npm i -g @pathrule/cli, then pathrule setup in your project (add --local to run with no account). Setup turns on Codex's hook support in .codex/config.toml, registers hooks in .codex/hooks.json that point at a single unobfuscated Node.js script under ~/.pathrule/bin, updates AGENTS.md, and adds a local MCP entry. Codex receives the path-scoped context on each prompt and around tool calls. Removing the entries removes Pathrule.
Can I connect Codex to Pathrule without installing anything?
Yes, for the MCP tools only. codex mcp add pathrule --url https://cloud.pathrule.io/mcp connects Codex to Remote MCP with OAuth and a Pathrule account. Remote MCP does not install hooks or write local files, so knowledge arrives when Codex asks for it, and strict rules cannot block.
Does Pathrule see my source code?
No. Pathrule does not automatically upload your repository source code. In local mode there is no account and knowledge stays on your machine. In cloud mode, Pathrule Cloud stores the memories, rules and skills your team writes, the start of each prompt is sent to rank what applies, and pathrule snapshot, when you or your agent run it, uploads the file tree, manifests, short doc samples and recent git metadata. Full breakdown on the Security page.