MCP and AI clients

Codex CLI

How Pathrule integrates with OpenAI's Codex CLI through MCP and a companion AGENTS.md file, with the same content tree as the other clients.


Codex CLI is OpenAI's terminal native coding assistant. Pathrule integrates with Codex through two pieces: a companion AGENTS.md file at the workspace root, and the same MCP tool surface the other clients use.

This page covers what gets written into your project for the integration, how it differs from the Claude Code and Cursor flows, and how to verify it.

What Pathrule writes

When you install Pathrule into Codex CLI, you get:

  • AGENTS.md at the workspace root. The protocol document Codex reads at session start. Updated when Pathrule cloud state changes.
  • An MCP server entry in Codex's config so the assistant can call pathrule_* tools.
  • Materialized skills attached to your workspace so Codex can invoke them by name.

AGENTS.md is the analogue of CLAUDE.md for Codex. Same workspace overview, same protocol, same router into the MCP server.

Hook coverage

Codex's hook contract is close to Claude Code's. Pathrule registers session-start, pre-tool, post-tool, and prompt-submit hooks, so Codex receives the path-scoped context on each prompt and tool call, and a strict rule can block a matching change at the pre-tool hook. AGENTS.md stays current so the assistant also sees the protocol at session start.

The main differences from Claude Code are in the tool surface: Codex uses its apply_patch format (with *** Update File: markers) instead of separate Edit and Write tools, and there is no Read hook. Pathrule's shared hook script understands apply_patch and resolves the affected paths back to workspace nodes.

The investment lives in the content layer, not in the client, so the same memories, rules and skills serve Codex and every other client.

Per client isolation

Codex coexists with Claude Code and Cursor on the same machine. You can install one, two, or all three. They share the same Pathrule workspace, the same MCP server, and the same content tree. The configs each client reads are independent.

Install

Through Pathrule Studio:

  1. Open the AI clients tab, enable Codex CLI.
  2. The app writes AGENTS.md and the MCP entry, and materializes skills.

Through Pathrule CLI:

pathrule install codex
pathrule sync
pathrule doctor --client codex

Verify

Open Codex CLI in a directory you attached to a workspace. The assistant should read AGENTS.md at session start and be able to call pathrule_get_context against your working directory.

Run a simple prompt that touches a path with content. The assistant should be able to surface that content through MCP. If it cannot, run:

pathrule doctor --client codex

The doctor reports whether the MCP server is reachable, whether AGENTS.md is up to date, and whether the runtime can resolve your working directory to a workspace.

What stays the same

The content layer is identical across clients.

  • The same memory shows up to Codex through the MCP tools that shows up to Claude Code through the hook.
  • A strict rule still blocks if the assistant tries to violate it through the hook path.
  • A skill is invokable by name.

If your team writes content for one assistant, every assistant gets it.